public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Daniel Kral <d.kral@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager v3 1/6] ui: vm: change var to let in CDROM and CloudInit edit modals
Date: Wed, 23 Oct 2024 14:37:17 +0200	[thread overview]
Message-ID: <20241023123722.124478-2-d.kral@proxmox.com> (raw)
In-Reply-To: <20241023123722.124478-1-d.kral@proxmox.com>

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
---
 www/manager6/qemu/CDEdit.js      | 35 +++++++++++++++++---------------
 www/manager6/qemu/CIDriveEdit.js | 20 ++++++++++--------
 2 files changed, 31 insertions(+), 24 deletions(-)

diff --git a/www/manager6/qemu/CDEdit.js b/www/manager6/qemu/CDEdit.js
index 3cc16205..fd8e5233 100644
--- a/www/manager6/qemu/CDEdit.js
+++ b/www/manager6/qemu/CDEdit.js
@@ -5,9 +5,10 @@ Ext.define('PVE.qemu.CDInputPanel', {
     insideWizard: false,
 
     onGetValues: function(values) {
-	var me = this;
+	let me = this;
 
-	var confid = me.confid || values.controller + values.deviceid;
+	let params = {};
+	let confid = me.confid || values.controller + values.deviceid;
 
 	me.drive.media = 'cdrom';
 	if (values.mediaType === 'iso') {
@@ -18,15 +19,13 @@ Ext.define('PVE.qemu.CDInputPanel', {
 	    me.drive.file = 'none';
 	}
 
-	var params = {};
-
 	params[confid] = PVE.Parser.printQemuDrive(me.drive);
 
 	return params;
     },
 
     setVMConfig: function(vmconfig) {
-	var me = this;
+	let me = this;
 
 	if (me.bussel) {
 	    me.bussel.setVMConfig(vmconfig, 'cdrom');
@@ -34,9 +33,10 @@ Ext.define('PVE.qemu.CDInputPanel', {
     },
 
     setDrive: function(drive) {
-	var me = this;
+	let me = this;
+
+	let values = {};
 
-	var values = {};
 	if (drive.file === 'cdrom') {
 	    values.mediaType = 'cdrom';
 	} else if (drive.file === 'none') {
@@ -52,17 +52,17 @@ Ext.define('PVE.qemu.CDInputPanel', {
     },
 
     setNodename: function(nodename) {
-	var me = this;
+	let me = this;
 
 	me.isosel.setNodename(nodename);
     },
 
     initComponent: function() {
-	var me = this;
+	let me = this;
 
 	me.drive = {};
 
-	var items = [];
+	let items = [];
 
 	if (!me.confid) {
 	    me.bussel = Ext.create('PVE.form.ControllerSelector', {
@@ -82,7 +82,7 @@ Ext.define('PVE.qemu.CDInputPanel', {
 		    if (!me.rendered) {
 			return;
 		    }
-		    var cdImageField = me.down('pveIsoSelector');
+		    let cdImageField = me.down('pveIsoSelector');
 		    cdImageField.setDisabled(!value);
 		    if (value) {
 			cdImageField.validate();
@@ -128,16 +128,16 @@ Ext.define('PVE.qemu.CDEdit', {
     width: 400,
 
     initComponent: function() {
-	var me = this;
+	let me = this;
 
-	var nodename = me.pveSelNode.data.node;
+	let nodename = me.pveSelNode.data.node;
 	if (!nodename) {
 	    throw "no node name specified";
 	}
 
 	me.isCreate = !me.confid;
 
-	var ipanel = Ext.create('PVE.qemu.CDInputPanel', {
+	let ipanel = Ext.create('PVE.qemu.CDInputPanel', {
 	    confid: me.confid,
 	    nodename: nodename,
 	});
@@ -152,14 +152,17 @@ Ext.define('PVE.qemu.CDEdit', {
 	me.load({
 	    success: function(response, options) {
 		ipanel.setVMConfig(response.result.data);
+
 		if (me.confid) {
-		    var value = response.result.data[me.confid];
-		    var drive = PVE.Parser.parseQemuDrive(me.confid, value);
+		    let value = response.result.data[me.confid];
+		    let drive = PVE.Parser.parseQemuDrive(me.confid, value);
+
 		    if (!drive) {
 			Ext.Msg.alert('Error', 'Unable to parse drive options');
 			me.close();
 			return;
 		    }
+
 		    ipanel.setDrive(drive);
 		}
 	    },
diff --git a/www/manager6/qemu/CIDriveEdit.js b/www/manager6/qemu/CIDriveEdit.js
index a9ca8bf1..a8f57963 100644
--- a/www/manager6/qemu/CIDriveEdit.js
+++ b/www/manager6/qemu/CIDriveEdit.js
@@ -7,29 +7,33 @@ Ext.define('PVE.qemu.CIDriveInputPanel', {
     vmconfig: {}, // used to select usused disks
 
     onGetValues: function(values) {
-	var me = this;
+	let me = this;
+
+	let drive = {};
+	let params = {};
 
-	var drive = {};
-	var params = {};
 	drive.file = values.hdstorage + ":cloudinit";
 	drive.format = values.diskformat;
 	params[values.controller + values.deviceid] = PVE.Parser.printQemuDrive(drive);
+
 	return params;
     },
 
     setNodename: function(nodename) {
-	var me = this;
+	let me = this;
+
 	me.down('#hdstorage').setNodename(nodename);
 	me.down('#hdimage').setStorage(undefined, nodename);
     },
 
     setVMConfig: function(config) {
-	var me = this;
+	let me = this;
+
 	me.down('#drive').setVMConfig(config, 'cdrom');
     },
 
     initComponent: function() {
-	var me = this;
+	let me = this;
 
 	me.drive = {};
 
@@ -61,9 +65,9 @@ Ext.define('PVE.qemu.CIDriveEdit', {
     subject: gettext('CloudInit Drive'),
 
     initComponent: function() {
-	var me = this;
+	let me = this;
 
-	var nodename = me.pveSelNode.data.node;
+	let nodename = me.pveSelNode.data.node;
 	if (!nodename) {
 	    throw "no node name specified";
 	}
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  reply	other threads:[~2024-10-23 12:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-23 12:37 [pve-devel] [PATCH manager v3 0/6] fix #5430: ocfs2 io_uring read write Daniel Kral
2024-10-23 12:37 ` Daniel Kral [this message]
2024-10-23 12:37 ` [pve-devel] [PATCH manager v3 2/6] ui: vm: improve code readability of CDROM and CloudInit edit modals Daniel Kral
2024-10-23 12:37 ` [pve-devel] [PATCH manager v3 3/6] ui: vm: factor out async I/O type selector Daniel Kral
2024-10-23 12:37 ` [pve-devel] [PATCH manager v3 4/6] fix #5430: ui: vm: allow editing cdrom aio and cache options Daniel Kral
2024-10-23 12:37 ` [pve-devel] [PATCH manager v3 5/6] ui: vm: make cloudinit drive editable Daniel Kral
2024-10-23 12:37 ` [pve-devel] [PATCH manager v3 6/6] fix #5430: ui: vm: allow editing cloudinit aio and cache options Daniel Kral

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=20241023123722.124478-2-d.kral@proxmox.com \
    --to=d.kral@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