ui: eslint: State equalities more precisely
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
1f32acfdd7
commit
16b8c3ddab
@ -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 };
|
||||
|
@ -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;
|
||||
|
@ -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'];
|
||||
|
@ -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) {
|
||||
|
@ -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));
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user