From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 2C2CAD99B for ; Fri, 2 Dec 2022 14:50:55 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0D75935056 for ; Fri, 2 Dec 2022 14:50:25 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 2 Dec 2022 14:50:24 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 052E144B40 for ; Fri, 2 Dec 2022 14:50:24 +0100 (CET) From: Matthias Heiserer To: pve-devel@lists.proxmox.com Date: Fri, 2 Dec 2022 14:50:18 +0100 Message-Id: <20221202135018.250016-3-m.heiserer@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221202135018.250016-1-m.heiserer@proxmox.com> References: <20221202135018.250016-1-m.heiserer@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.173 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH manager 3/3] code cleanup: convert var to let/const X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2022 13:50:55 -0000 Signed-off-by: Matthias Heiserer --- www/manager6/panel/GuestStatusView.js | 16 ++++++++-------- www/manager6/panel/GuestSummary.js | 16 ++++++++-------- www/manager6/panel/TemplateStatusView.js | 6 +++--- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/www/manager6/panel/GuestStatusView.js b/www/manager6/panel/GuestStatusView.js index d38b9631..f1002740 100644 --- a/www/manager6/panel/GuestStatusView.js +++ b/www/manager6/panel/GuestStatusView.js @@ -4,7 +4,7 @@ Ext.define('PVE.panel.GuestStatusView', { mixins: ['Proxmox.Mixin.CBind'], cbindData: function(initialConfig) { - var me = this; + const me = this; return { isQemu: me.pveSelNode.data.type === 'qemu', isLxc: me.pveSelNode.data.type === 'lxc', @@ -40,9 +40,9 @@ Ext.define('PVE.panel.GuestStatusView', { printBar: false, multiField: true, renderer: function(record) { - var me = this; - var text = record.data.status; - var qmpstatus = record.data.qmpstatus; + const me = this; + let text = record.data.status; + const qmpstatus = record.data.qmpstatus; if (qmpstatus && qmpstatus !== record.data.status) { text += ' (' + qmpstatus + ')'; } @@ -126,7 +126,7 @@ Ext.define('PVE.panel.GuestStatusView', { maxField: 'maxdisk', printBar: false, renderer: function(used, max) { - var me = this; + const me = this; me.setPrintBar(used > 0); if (used === 0) { return Proxmox.Utils.render_size(max); @@ -152,10 +152,10 @@ Ext.define('PVE.panel.GuestStatusView', { ], updateTitle: function() { - var me = this; - var uptime = me.getRecordValue('uptime'); + const me = this; + const uptime = me.getRecordValue('uptime'); - var text = ""; + let text = ""; if (Number(uptime) > 0) { text = " (" + gettext('Uptime') + ': ' + Proxmox.Utils.format_duration_long(uptime) + ')'; diff --git a/www/manager6/panel/GuestSummary.js b/www/manager6/panel/GuestSummary.js index d6655393..694cf324 100644 --- a/www/manager6/panel/GuestSummary.js +++ b/www/manager6/panel/GuestSummary.js @@ -6,14 +6,14 @@ Ext.define('PVE.guest.Summary', { bodyPadding: 5, initComponent: function() { - var me = this; + const me = this; - var nodename = me.pveSelNode.data.node; + const nodename = me.pveSelNode.data.node; if (!nodename) { throw "no node name specified"; } - var vmid = me.pveSelNode.data.vmid; + const vmid = me.pveSelNode.data.vmid; if (!vmid) { throw "no VM ID specified"; } @@ -26,9 +26,9 @@ Ext.define('PVE.guest.Summary', { throw "no status storage specified"; } - var type = me.pveSelNode.data.type; - var template = !!me.pveSelNode.data.template; - var rstore = me.statusStore; + const type = me.pveSelNode.data.type; + const template = !!me.pveSelNode.data.template; + const rstore = me.statusStore; const applyLogos = function(controller) { const updateView = (response) => { @@ -51,7 +51,7 @@ Ext.define('PVE.guest.Summary', { }); }; - var items = [ + let items = [ { xtype: template ? 'pveTemplateStatusView' : 'pveGuestStatusView', flex: 1, @@ -70,7 +70,7 @@ Ext.define('PVE.guest.Summary', { }, ]; - var rrdstore; + let rrdstore; if (!template) { // in non-template mode put the two panels always together items = [ diff --git a/www/manager6/panel/TemplateStatusView.js b/www/manager6/panel/TemplateStatusView.js index 5543f4fe..bacc5410 100644 --- a/www/manager6/panel/TemplateStatusView.js +++ b/www/manager6/panel/TemplateStatusView.js @@ -4,7 +4,7 @@ Ext.define('PVE.panel.TemplateStatusView', { mixins: ['Proxmox.Mixin.CBind'], cbindData: function(initialConfig) { - var me = this; + const me = this; return { isQemu: me.pveSelNode.data.type === 'qemu', }; @@ -103,9 +103,9 @@ Ext.define('PVE.panel.TemplateStatusView', { ], initComponent: function() { - var me = this; + const me = this; - var name = me.pveSelNode.data.name; + const name = me.pveSelNode.data.name; if (!name) { throw "no name specified"; } -- 2.30.2