diff --git a/js/ClusterAdministration.js b/js/ClusterAdministration.js index ccbc9d7..be85ac1 100644 --- a/js/ClusterAdministration.js +++ b/js/ClusterAdministration.js @@ -11,6 +11,51 @@ Ext.define('pmg-cluster', { idProperty: 'cid' }); +Ext.define('PMG.ClusterAddNodeWindow', { + extend: 'Ext.window.Window', + xtype: 'pmgClusterAddNodeWindow', + mixins: ['Proxmox.Mixin.CBind'], + + width: 800, + + modal: true, + + title: gettext('Cluster Join Information'), + + ipAddress: undefined, + + fingerprint: undefined, + + items: [ + { + xtype: 'component', + border: false, + padding: 10, + html: gettext("Please use the 'Join' button on the node you want to add, using the following IP address and fingerprint.") + }, + { + xtype: 'container', + layout: 'form', + border: false, + padding: '0 10 10 10', + items: [ + { + xtype: 'textfield', + fieldLabel: gettext('IP Address'), + cbind: { value: '{ipAddress}' }, + editable: false + }, + { + xtype: 'textfield', + fieldLabel: gettext('Fingerprint'), + cbind: { value: '{fingerprint}' }, + editable: false + } + ] + } + ] +}); + Ext.define('PMG.ClusterAdministration', { extend: 'Ext.tab.Panel', xtype: 'pmgClusterAdministration', @@ -54,38 +99,12 @@ Ext.define('PMG.ClusterAdministration', { onAdd: function() { var vm = this.getViewModel(); - var win = Ext.create('Ext.window.Window', { - width: 800, - modal: true, - title: gettext('Cluster Join Information'), - items: [ - { - xtype: 'component', - border: false, - padding: 10, - html: gettext("Please use the 'Join' button on the node you want to add, using the following IP address and fingerprint.") - }, - { - layout: 'form', - border: false, - padding: '0 10 10 10', - items: [ - { - xtype: 'textfield', - fieldLabel: gettext('IP Address'), - value: vm.get('master').get('ip'), - editable: false - }, - { - xtype: 'textfield', - fieldLabel: gettext('Fingerprint'), - value: vm.get('master').get('fingerprint'), - editable: false - } - ] - } - ] + + var win = Ext.create('PMG.ClusterAddNodeWindow', { + ipAddress: vm.get('master').get('ip'), + fingerprint: vm.get('master').get('fingerprint') }); + win.show(); } },