[pve-devel] [PATCH] Qemu CreateWizard preselect current node

Stefan Priebe s.priebe at profihost.ag
Mon Apr 22 10:31:52 CEST 2013


Signed-off-by: Stefan Priebe <s.priebe at profihost.ag>
---
 www/manager/Workspace.js         |    1 +
 www/manager/form/NodeSelector.js |    6 ++++++
 www/manager/qemu/CreateWizard.js |    1 +
 3 files changed, 8 insertions(+)

diff --git a/www/manager/Workspace.js b/www/manager/Workspace.js
index 8aab449..e8a42fc 100644
--- a/www/manager/Workspace.js
+++ b/www/manager/Workspace.js
@@ -290,6 +290,7 @@ Ext.define('PVE.StdWorkspace', {
 				workspace: me,
 				viewFilter: selview.getViewFilter()
 			    };
+			    PVE.curSelectedNode = n;
 			}
 
 			me.setContent(comp);
diff --git a/www/manager/form/NodeSelector.js b/www/manager/form/NodeSelector.js
index a472d7f..81ac5c3 100644
--- a/www/manager/form/NodeSelector.js
+++ b/www/manager/form/NodeSelector.js
@@ -5,6 +5,8 @@ Ext.define('PVE.form.NodeSelector', {
     // invalidate nodes which are offline
     onlineValidator: false,
 
+    selectCurNode: false,
+
     initComponent: function() {
 	var me = this;
 
@@ -79,6 +81,10 @@ Ext.define('PVE.form.NodeSelector', {
 	    }
 	});
 
+        if (me.selectCurNode && PVE.curSelectedNode.data.node) {
+            me.value = PVE.curSelectedNode.data.node;
+        }
+
         me.callParent();
     }
 });
diff --git a/www/manager/qemu/CreateWizard.js b/www/manager/qemu/CreateWizard.js
index 67a9091..d2ab385 100644
--- a/www/manager/qemu/CreateWizard.js
+++ b/www/manager/qemu/CreateWizard.js
@@ -46,6 +46,7 @@ Ext.define('PVE.qemu.CreateWizard', {
 			{
 			    xtype: 'PVE.form.NodeSelector',
 			    name: 'nodename',
+			    selectCurNode: true,
 			    fieldLabel: gettext('Node'),
 			    allowBlank: false,
 			    onlineValidator: true,
-- 
1.7.10.4




More information about the pve-devel mailing list