]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: eslint: State equalities more precisely
authorDominic Jäger <d.jaeger@proxmox.com>
Tue, 18 May 2021 12:12:17 +0000 (14:12 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 18 May 2021 13:22:05 +0000 (15:22 +0200)
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/lxc/FeaturesEdit.js
www/manager6/lxc/Resources.js
www/manager6/qemu/AgentIPView.js
www/manager6/qemu/BootOrderEdit.js
www/manager6/qemu/OSTypeEdit.js
www/manager6/qemu/RNGEdit.js
www/manager6/storage/ImageView.js

index 1c2795b9c45590f4f9bdc391049271b723839965..807c262302e0bb25cf4fe5fa7fe71587f4d481ad 100644 (file)
@@ -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 };
index a571c19eb2c8a1c7a9a7c537158cecb3bfc81063..58344385902783cc911ce95884ffc697f6319509 100644 (file)
@@ -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;
index 8a9a4bb400fba2a12d0db52346edb22759f2348a..1411361abebad60e882bb6aadd6ba7de8de15218 100644 (file)
@@ -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'];
index 73c2894655b64fccb15bf87bdfb9181cbc2cc155..de80c7e1eeabe28d1f4e6f69afed88867e5bc782 100644 (file)
@@ -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) {
index ece80c39f34dfcc8768b81eccf885ffedeec4e5a..438d7c6bf62f548ff84d421cceddf681170c3055 100644 (file)
@@ -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));
index c196fb0bf594b8de498f6267fc7b222c5030a6be..e34e2c08dd4be09a14c4002b788a21d1e8dba58c 100644 (file)
@@ -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;
        }
 
index 612c419b3864b5ee95c539302b687ebd9af821d2..dda4b8e621c22142e5d38e2477cfc91dd0e75307 100644 (file)
@@ -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");