public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Matthias Heiserer <m.heiserer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 3/3] code cleanup: convert var to let/const
Date: Fri,  2 Dec 2022 14:50:18 +0100	[thread overview]
Message-ID: <20221202135018.250016-3-m.heiserer@proxmox.com> (raw)
In-Reply-To: <20221202135018.250016-1-m.heiserer@proxmox.com>

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
---
 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





      parent reply	other threads:[~2022-12-02 13:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-02 13:50 [pve-devel] [PATCH manager 1/3] fix #2435: GUI: LXC summary: Add privileged status and os type Matthias Heiserer
2022-12-02 13:50 ` [pve-devel] [PATCH manager 2/3] GUI: LXC Template Summary: display " Matthias Heiserer
2022-12-02 13:50 ` Matthias Heiserer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221202135018.250016-3-m.heiserer@proxmox.com \
    --to=m.heiserer@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal