[pve-devel] r5984 - pve-manager/pve2/www/new/qemu

svn-commits at proxmox.com svn-commits at proxmox.com
Mon May 16 14:17:18 CEST 2011


Author: dietmar
Date: 2011-05-16 14:17:18 +0200 (Mon, 16 May 2011)
New Revision: 5984

Modified:
   pve-manager/pve2/www/new/qemu/Config.js
   pve-manager/pve2/www/new/qemu/HardwareView.js
Log:
fix hardware view


Modified: pve-manager/pve2/www/new/qemu/Config.js
===================================================================
--- pve-manager/pve2/www/new/qemu/Config.js	2011-05-16 11:16:36 UTC (rev 5983)
+++ pve-manager/pve2/www/new/qemu/Config.js	2011-05-16 12:17:18 UTC (rev 5984)
@@ -208,6 +208,7 @@
 			align: 'stretchmax'
 		    },
 		    width: 800,
+		    height: 160,
 		    border: false,
 		    items: [
 			{
@@ -301,6 +302,7 @@
 		    xtype: 'pveKVMConsole',
 		    title: 'Console',
 		    itemId: 'console',
+		    //disabled: true,
 		    nodename: nodename,
 		    vmid: vmid
 		},
@@ -313,10 +315,17 @@
 	    ]
 	});
 
-	me.callParent();
+	me.mon(me.rstore, 'load', function(s, records, success) {
+	    var statusrec = s.data.get('status');
+	    var status = statusrec ? statusrec.data.value : 'unknown';
+	    // fixme: this does not work - why ?
+	    me.down('#console').setDisabled(status !== 'running');
+	});
 
 	me.rstore.startUpdate();
 
+	me.callParent();
+
 	me.on('destroy', function() {
 	    me.rstore.stopUpdate();
 	});

Modified: pve-manager/pve2/www/new/qemu/HardwareView.js
===================================================================
--- pve-manager/pve2/www/new/qemu/HardwareView.js	2011-05-16 11:16:36 UTC (rev 5983)
+++ pve-manager/pve2/www/new/qemu/HardwareView.js	2011-05-16 12:17:18 UTC (rev 5984)
@@ -80,24 +80,37 @@
 	    };
 	}
 
+	me.rstore = Ext.create('PVE.data.ObjectStore', {
+	    url: "/api2/json/nodes/" + nodename + "/qemu/" + vmid + "/config"
+	});
+
+	var run_editor = function() {
+	    
+	    console.log("TEST EDIT");
+
+	    me.rstore.load();
+	};
+
 	Ext.applyIf(me, {
-	    url: "/api2/json/nodes/" + nodename + "/qemu/" + vmid + "/config",
-	    interval: 1000,
 	    cwidth1: 150,
 	    tbar: [ 
 		{
-		    text: "Edit"
-		    //handler: run_editor
+		    text: "Edit",
+		    handler: run_editor
 		}
 	    ],
 	    rows: rows,
 	    listeners: {
 		itemdblclick: function() {
-		    //run_editor();
+		    run_editor();
 		}
 	    }
 	});
 
+	me.rstore.load();
+
 	me.callParent();
+
+
     }
 });




More information about the pve-devel mailing list