[pve-devel] [PATCH 1/2] ui/lxc: cleanup pveSelNode to variable

Stefan Reiter s.reiter at proxmox.com
Thu Dec 19 12:17:48 CET 2019


Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---

Déjà vu ;)

 www/manager6/lxc/Config.js | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/www/manager6/lxc/Config.js b/www/manager6/lxc/Config.js
index 1b9ab048..773be1a4 100644
--- a/www/manager6/lxc/Config.js
+++ b/www/manager6/lxc/Config.js
@@ -6,20 +6,21 @@ Ext.define('PVE.lxc.Config', {
 
     initComponent: function() {
         var me = this;
+	var vm = me.pveSelNode.data;
 
-	var nodename = me.pveSelNode.data.node;
+	var nodename = vm.node;
 	if (!nodename) {
 	    throw "no node name specified";
 	}
 
-	var vmid = me.pveSelNode.data.vmid;
+	var vmid = vm.vmid;
 	if (!vmid) {
 	    throw "no VM ID specified";
 	}
 
-	var template = !!me.pveSelNode.data.template;
+	var template = !!vm.template;
 
-	var running = !!me.pveSelNode.data.uptime;
+	var running = !!vm.uptime;
 
 	var caps = Ext.state.Manager.get('GuiCap');
 
@@ -135,7 +136,7 @@ Ext.define('PVE.lxc.Config', {
 		    hidden: !caps.nodes['Sys.Console'],
 		    text: gettext('Manage HA'),
 		    handler: function() {
-			var ha = me.pveSelNode.data.hastate;
+			var ha = vm.hastate;
 			Ext.create('PVE.ha.VMResourceEdit', {
 			    vmid: vmid,
 			    guestType: 'ct',
@@ -158,8 +159,6 @@ Ext.define('PVE.lxc.Config', {
 	    ]}
 	});
 
-	var vm = me.pveSelNode.data;
-
 	var consoleBtn = Ext.create('PVE.button.ConsoleButton', {
 	    disabled: !caps.vms['VM.Console'],
 	    consoleType: 'lxc',
-- 
2.20.1





More information about the pve-devel mailing list