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

Stefan Priebe s.priebe at profihost.ag
Mon Apr 22 11:54:12 CEST 2013


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

diff --git a/www/manager/Workspace.js b/www/manager/Workspace.js
index 015e526..a561d14 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 5dc06c3..24cf379 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;
 
@@ -77,6 +79,10 @@ Ext.define('PVE.form.NodeSelector', {
 	    }
 	});
 
+        if (me.selectCurNode && PVE.curSelectedNode.data.node) {
+            me.value = PVE.curSelectedNode.data.node;
+        }
+
         me.callParent();
     }
-});
\ No newline at end of file
+});
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