[pve-devel] r6208 - pve-manager/pve2/www/manager/qemu

svn-commits at proxmox.com svn-commits at proxmox.com
Thu Jun 30 10:58:50 CEST 2011


Author: dietmar
Date: 2011-06-30 10:58:50 +0200 (Thu, 30 Jun 2011)
New Revision: 6208

Modified:
   pve-manager/pve2/www/manager/qemu/HardwareView.js
Log:
remove unnecessary optimization


Modified: pve-manager/pve2/www/manager/qemu/HardwareView.js
===================================================================
--- pve-manager/pve2/www/manager/qemu/HardwareView.js	2011-06-30 08:01:24 UTC (rev 6207)
+++ pve-manager/pve2/www/manager/qemu/HardwareView.js	2011-06-30 08:58:50 UTC (rev 6208)
@@ -4,17 +4,6 @@
     initComponent : function() {
 	var me = this;
 
-	if (!me.store) 
-	    throw "no store specified";
-	
-	var data = {};
-	var rec = me.store.getById('sockets');
-	data.sockets = rec && rec.data.value ? rec.data.value : 1;
-	rec = me.store.getById('cores');
-	data.cores = rec && rec.data.value ? rec.data.value : 1;
-	rec = me.store.getById('cpu');
- 	data.cpu = rec && rec.data.value ? rec.data.value : '';
-
 	me.column1 = [
 	    {
 		xtype: 'numberfield',
@@ -61,6 +50,7 @@
 	    {
 		xtype: 'CPUModelSelector',
 		name: 'cpu',
+		value: '',
 		fieldLabel: 'CPU type',
 	    }
 	];
@@ -71,8 +61,7 @@
 
 	me.callParent();
 
-	var form = me.down('form').getForm();
-	form.setValues(data);
+	me.load();
     }
 });
 
@@ -193,6 +182,8 @@
 	    };
 	}
 
+	var baseurl = 'nodes/' + nodename + '/qemu/' + vmid + '/config';
+
 	var run_editor = function() {
 	    var sm = me.getSelectionModel();
 	    var rec = sm.getSelection()[0];
@@ -205,8 +196,7 @@
 
 	    var win = Ext.create(rowdef.editor, {
 		pveSelNode: me.pveSelNode,
-		url: me.url,
-		store: me.rstore
+		url: '/api2/extjs/' + baseurl
 	    });
 
 	    win.show();
@@ -247,7 +237,7 @@
 	}
 
 	Ext.applyIf(me, {
-	    url: "/api2/extjs/nodes/" + nodename + "/qemu/" + vmid + "/config",
+	    url: '/api2/json/' + baseurl,
 	    cwidth1: 150,
 	    tbar: [ 
 		{




More information about the pve-devel mailing list