[pve-devel] [PATCH manager 5/6] State equalities more precisely

Dominic Jäger d.jaeger at proxmox.com
Tue May 18 14:12:17 CEST 2021


Signed-off-by: Dominic Jäger <d.jaeger at proxmox.com>
---
 www/manager6/lxc/FeaturesEdit.js   | 2 +-
 www/manager6/lxc/Resources.js      | 2 +-
 www/manager6/qemu/AgentIPView.js   | 4 ++--
 www/manager6/qemu/BootOrderEdit.js | 4 ++--
 www/manager6/qemu/OSTypeEdit.js    | 2 +-
 www/manager6/qemu/RNGEdit.js       | 2 +-
 www/manager6/storage/ImageView.js  | 4 ++--
 7 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/www/manager6/lxc/FeaturesEdit.js b/www/manager6/lxc/FeaturesEdit.js
index 1c2795b9..807c2623 100644
--- a/www/manager6/lxc/FeaturesEdit.js
+++ b/www/manager6/lxc/FeaturesEdit.js
@@ -83,7 +83,7 @@ Ext.define('PVE.lxc.FeaturesInputPanel', {
 	}
 
 	var featuresstring = PVE.Parser.printPropertyString(values, undefined);
-	if (featuresstring == '') {
+	if (featuresstring === '') {
 	    return { 'delete': 'features' };
 	}
 	return { features: featuresstring };
diff --git a/www/manager6/lxc/Resources.js b/www/manager6/lxc/Resources.js
index a571c19e..58344385 100644
--- a/www/manager6/lxc/Resources.js
+++ b/www/manager6/lxc/Resources.js
@@ -231,7 +231,7 @@ Ext.define('PVE.lxc.RessourceView', {
 	    var rowdef = rows[key];
 
 	    var pending = rec.data.delete || me.hasPendingChanges(key);
-	    var isDisk = rowdef.tdCls == 'pve-itype-icon-storage';
+	    var isDisk = rowdef.tdCls === 'pve-itype-icon-storage';
 	    var isUnusedDisk = key.match(/^unused\d+/);
 
 	    var noedit = rec.data.delete || !rowdef.editor;
diff --git a/www/manager6/qemu/AgentIPView.js b/www/manager6/qemu/AgentIPView.js
index 8a9a4bb4..1411361a 100644
--- a/www/manager6/qemu/AgentIPView.js
+++ b/www/manager6/qemu/AgentIPView.js
@@ -104,8 +104,8 @@ Ext.define('PVE.qemu.AgentIPView', {
 	var ips = [];
 	nics.forEach(function(nic) {
 	    if (nic['hardware-address'] &&
-		nic['hardware-address'] != '00:00:00:00:00:00' &&
-		nic['hardware-address'] != '0:0:0:0:0:0') {
+		nic['hardware-address'] !== '00:00:00:00:00:00' &&
+		nic['hardware-address'] !== '0:0:0:0:0:0') {
 		var nic_ips = nic['ip-addresses'] || [];
 		nic_ips.forEach(function(ip) {
 		    var p = ip['ip-address'];
diff --git a/www/manager6/qemu/BootOrderEdit.js b/www/manager6/qemu/BootOrderEdit.js
index 73c28946..de80c7e1 100644
--- a/www/manager6/qemu/BootOrderEdit.js
+++ b/www/manager6/qemu/BootOrderEdit.js
@@ -28,10 +28,10 @@ Ext.define('PVE.qemu.BootOrderPanel', {
     },
 
     isBootdev: function(dev, value) {
-	return this.isDisk(dev) && !this.isCloudinit(value) ||
+	return (this.isDisk(dev) && !this.isCloudinit(value)) ||
 	    (/^net\d+/).test(dev) ||
 	    (/^hostpci\d+/).test(dev) ||
-	    (/^usb\d+/).test(dev) && !(/spice/).test(value);
+	    ((/^usb\d+/).test(dev) && !(/spice/).test(value));
     },
 
     setVMConfig: function(vmconfig) {
diff --git a/www/manager6/qemu/OSTypeEdit.js b/www/manager6/qemu/OSTypeEdit.js
index ece80c39..438d7c6b 100644
--- a/www/manager6/qemu/OSTypeEdit.js
+++ b/www/manager6/qemu/OSTypeEdit.js
@@ -79,7 +79,7 @@ Ext.define('PVE.qemu.OSTypeInputPanel', {
 			datachanged: function(store) {
 			    var ostype = me.lookup('ostype');
 			    var old_val = ostype.getValue();
-			    if (!me.insideWizard && old_val && store.find('val', old_val) != -1) {
+			    if (!me.insideWizard && old_val && store.find('val', old_val) !== -1) {
 				ostype.setValue(old_val);
 			    } else {
 				ostype.setValue(store.getAt(0));
diff --git a/www/manager6/qemu/RNGEdit.js b/www/manager6/qemu/RNGEdit.js
index c196fb0b..e34e2c08 100644
--- a/www/manager6/qemu/RNGEdit.js
+++ b/www/manager6/qemu/RNGEdit.js
@@ -19,7 +19,7 @@ Ext.define('PVE.qemu.RNGInputPanel', {
     },
 
     setValues: function(values) {
-	if (values.max_bytes == 0) {
+	if (values.max_bytes === 0) {
 	    values.max_bytes = null;
 	}
 
diff --git a/www/manager6/storage/ImageView.js b/www/manager6/storage/ImageView.js
index 612c419b..dda4b8e6 100644
--- a/www/manager6/storage/ImageView.js
+++ b/www/manager6/storage/ImageView.js
@@ -16,7 +16,7 @@ Ext.define('PVE.storage.ImageView', {
 	    throw "no storage ID specified";
 	}
 
-	if (!me.content || me.content !== 'images' && me.content !== 'rootdir') {
+	if (!me.content || (me.content !== 'images' && me.content !== 'rootdir')) {
 	    throw "content needs to be either 'images' or 'rootdir'";
 	}
 
@@ -44,7 +44,7 @@ Ext.define('PVE.storage.ImageView', {
 			var storage_path = 'storage/' + nodename + '/' + storage;
 
 			// allow to delete local backed images if a VMID exists on another node.
-			if (store.storageIsShared(storage_path) || guest_node == nodename) {
+			if (store.storageIsShared(storage_path) || guest_node === nodename) {
 			    var msg = Ext.String.format(
 				gettext("Cannot remove image, a guest with VMID '{0}' exists!"), vmid);
 			    msg += '<br />' + gettext("You can delete the image from the guest's hardware pane");
-- 
2.20.1






More information about the pve-devel mailing list