* [pve-devel] [PATCH manager 1/6] Fix usage of 'me'
2021-05-18 12:12 [pve-devel] [PATCH manager 0/6] eslint fixes Dominic Jäger
@ 2021-05-18 12:12 ` Dominic Jäger
2021-05-18 12:12 ` [pve-devel] [PATCH manager 2/6] No unused or duplicate variables Dominic Jäger
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Dominic Jäger @ 2021-05-18 12:12 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
---
www/manager6/lxc/MPEdit.js | 6 ++---
www/manager6/qemu/AgentIPView.js | 4 +--
www/manager6/qemu/CloudInit.js | 44 ++++++++++++++++----------------
www/manager6/qemu/DisplayEdit.js | 4 +--
www/manager6/qemu/SSHKey.js | 4 +--
www/manager6/qemu/SerialEdit.js | 4 +--
www/manager6/storage/Base.js | 8 +++---
7 files changed, 37 insertions(+), 37 deletions(-)
diff --git a/www/manager6/lxc/MPEdit.js b/www/manager6/lxc/MPEdit.js
index d9a160a0..2a30cd27 100644
--- a/www/manager6/lxc/MPEdit.js
+++ b/www/manager6/lxc/MPEdit.js
@@ -189,11 +189,11 @@ Ext.define('PVE.lxc.MountPointInputPanel', {
disabled: '{hasMP}',
},
validator: function(value) {
- var me = this.up('inputpanel');
- if (!me.rendered) {
+ let view = this.up('inputpanel');
+ if (!view.rendered) {
return;
}
- if (Ext.isDefined(me.vmconfig["mp"+value])) {
+ if (Ext.isDefined(view.vmconfig["mp"+value])) {
return "Mount point is already in use.";
}
/* returns a string above */
diff --git a/www/manager6/qemu/AgentIPView.js b/www/manager6/qemu/AgentIPView.js
index fd75437f..6518dfd6 100644
--- a/www/manager6/qemu/AgentIPView.js
+++ b/www/manager6/qemu/AgentIPView.js
@@ -87,10 +87,10 @@ Ext.define('PVE.qemu.AgentIPView', {
hidden: true,
ui: 'default-toolbar',
handler: function(btn) {
- var me = this.up('pveAgentIPView');
+ let view = this.up('pveAgentIPView');
var win = Ext.create('PVE.window.IPInfo');
- win.down('grid').getStore().setData(me.nics);
+ win.down('grid').getStore().setData(view.nics);
win.show();
},
text: gettext('More'),
diff --git a/www/manager6/qemu/CloudInit.js b/www/manager6/qemu/CloudInit.js
index 43405a67..8465b402 100644
--- a/www/manager6/qemu/CloudInit.js
+++ b/www/manager6/qemu/CloudInit.js
@@ -10,19 +10,19 @@ Ext.define('PVE.qemu.CloudInit', {
disabled: true,
dangerous: true,
confirmMsg: function(rec) {
- var me = this.up('grid');
+ let view = this.up('grid');
var warn = gettext('Are you sure you want to remove entry {0}');
var entry = rec.data.key;
var msg = Ext.String.format(warn, "'"
- + me.renderKey(entry, {}, rec) + "'");
+ + view.renderKey(entry, {}, rec) + "'");
return msg;
},
enableFn: function(record) {
- var me = this.up('grid');
+ let view = this.up('grid');
var caps = Ext.state.Manager.get('GuiCap');
- if (me.rows[record.data.key].never_delete ||
+ if (view.rows[record.data.key].never_delete ||
!caps.vms['VM.Config.Network']) {
return false;
}
@@ -33,8 +33,8 @@ Ext.define('PVE.qemu.CloudInit', {
return true;
},
handler: function() {
- var me = this.up('grid');
- var records = me.getSelection();
+ let view = this.up('grid');
+ let records = view.getSelection();
if (!records || !records.length) {
return;
}
@@ -48,15 +48,15 @@ Ext.define('PVE.qemu.CloudInit', {
var params = {};
params.delete = id;
Proxmox.Utils.API2Request({
- url: me.baseurl + '/config',
- waitMsgTarget: me,
+ url: view.baseurl + '/config',
+ waitMsgTarget: view,
method: 'PUT',
params: params,
failure: function(response, opts) {
Ext.Msg.alert('Error', response.htmlStatus);
},
callback: function() {
- me.reload();
+ view.reload();
},
});
},
@@ -66,12 +66,12 @@ Ext.define('PVE.qemu.CloudInit', {
xtype: 'proxmoxButton',
disabled: true,
enableFn: function(rec) {
- let me = this.up('pveCiPanel');
- return !!me.rows[rec.data.key].editor;
+ let view = this.up('pveCiPanel');
+ return !!view.rows[rec.data.key].editor;
},
handler: function() {
- var me = this.up('grid');
- me.run_editor();
+ let view = this.up('grid');
+ view.run_editor();
},
text: gettext('Edit'),
},
@@ -81,37 +81,37 @@ Ext.define('PVE.qemu.CloudInit', {
itemId: 'savebtn',
text: gettext('Regenerate Image'),
handler: function() {
- var me = this.up('grid');
+ let view = this.up('grid');
var eject_params = {};
var insert_params = {};
- var disk = PVE.Parser.parseQemuDrive(me.ciDriveId, me.ciDrive);
+ let disk = PVE.Parser.parseQemuDrive(view.ciDriveId, view.ciDrive);
var storage = '';
var stormatch = disk.file.match(/^([^\:]+)\:/);
if (stormatch) {
storage = stormatch[1];
}
- eject_params[me.ciDriveId] = 'none,media=cdrom';
- insert_params[me.ciDriveId] = storage + ':cloudinit';
+ eject_params[view.ciDriveId] = 'none,media=cdrom';
+ insert_params[view.ciDriveId] = storage + ':cloudinit';
var failure = function(response, opts) {
Ext.Msg.alert('Error', response.htmlStatus);
};
Proxmox.Utils.API2Request({
- url: me.baseurl + '/config',
- waitMsgTarget: me,
+ url: view.baseurl + '/config',
+ waitMsgTarget: view,
method: 'PUT',
params: eject_params,
failure: failure,
callback: function() {
Proxmox.Utils.API2Request({
- url: me.baseurl + '/config',
- waitMsgTarget: me,
+ url: view.baseurl + '/config',
+ waitMsgTarget: view,
method: 'PUT',
params: insert_params,
failure: failure,
callback: function() {
- me.reload();
+ view.reload();
},
});
},
diff --git a/www/manager6/qemu/DisplayEdit.js b/www/manager6/qemu/DisplayEdit.js
index 9f1c4fdd..82e6777e 100644
--- a/www/manager6/qemu/DisplayEdit.js
+++ b/www/manager6/qemu/DisplayEdit.js
@@ -34,7 +34,7 @@ Ext.define('PVE.qemu.DisplayInputPanel', {
},
listeners: {
change: function(cb, val) {
- var me = this.up('panel');
+ let view = this.up('panel');
if (!val) {
return;
}
@@ -70,7 +70,7 @@ Ext.define('PVE.qemu.DisplayInputPanel', {
default:
break;
}
- var memoryfield = me.down('field[name=memory]');
+ let memoryfield = view.down('field[name=memory]');
memoryfield.setEmptyText(emptyText);
memoryfield.setDisabled(disable);
},
diff --git a/www/manager6/qemu/SSHKey.js b/www/manager6/qemu/SSHKey.js
index ec030777..f38e5fab 100644
--- a/www/manager6/qemu/SSHKey.js
+++ b/www/manager6/qemu/SSHKey.js
@@ -34,11 +34,11 @@ Ext.define('PVE.qemu.SSHKeyInputPanel', {
fieldLabel: 'test',
listeners: {
change: function(btn, e, value) {
- var me = this.up('inputpanel');
+ let view = this.up('inputpanel');
e = e.event;
Ext.Array.each(e.target.files, function(file) {
PVE.Utils.loadSSHKeyFromFile(file, function(res) {
- var keysField = me.down('#sshkeys');
+ let keysField = view.down('#sshkeys');
var old = keysField.getValue();
keysField.setValue(old + res);
});
diff --git a/www/manager6/qemu/SerialEdit.js b/www/manager6/qemu/SerialEdit.js
index 21a7a839..6ce18ec2 100644
--- a/www/manager6/qemu/SerialEdit.js
+++ b/www/manager6/qemu/SerialEdit.js
@@ -37,8 +37,8 @@ Ext.define('PVE.qemu.SerialnputPanel', {
if (!this.rendered) {
return true;
}
- var me = this.up('panel');
- if (me.vmconfig !== undefined && Ext.isDefined(me.vmconfig['serial' + id])) {
+ let view = this.up('panel');
+ if (view.vmconfig !== undefined && Ext.isDefined(view.vmconfig['serial' + id])) {
return "This device is already in use.";
}
return true;
diff --git a/www/manager6/storage/Base.js b/www/manager6/storage/Base.js
index 186ddc9c..4336d634 100644
--- a/www/manager6/storage/Base.js
+++ b/www/manager6/storage/Base.js
@@ -89,15 +89,15 @@ Ext.define('PVE.panel.StoragePruneInputPanel', {
},
updateComponents: function() {
- let panel = this;
+ let me = this;
- let keepAll = panel.down('proxmoxcheckbox[name=keep-all]').getValue();
+ let keepAll = me.down('proxmoxcheckbox[name=keep-all]').getValue();
let anyValue = false;
- panel.query('pmxPruneKeepField').forEach(field => {
+ me.query('pmxPruneKeepField').forEach(field => {
anyValue = anyValue || field.getValue() !== null;
field.setDisabled(keepAll);
});
- panel.down('component[name=no-keeps-hint]').setHidden(anyValue || keepAll);
+ me.down('component[name=no-keeps-hint]').setHidden(anyValue || keepAll);
},
listeners: {
--
2.20.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [pve-devel] [PATCH manager 2/6] No unused or duplicate variables
2021-05-18 12:12 [pve-devel] [PATCH manager 0/6] eslint fixes Dominic Jäger
2021-05-18 12:12 ` [pve-devel] [PATCH manager 1/6] Fix usage of 'me' Dominic Jäger
@ 2021-05-18 12:12 ` Dominic Jäger
2021-05-18 12:12 ` [pve-devel] [PATCH manager 3/6] Functions may not be completely empty Dominic Jäger
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Dominic Jäger @ 2021-05-18 12:12 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
---
www/manager6/lxc/CreateWizard.js | 1 -
www/manager6/lxc/DNS.js | 5 ++---
www/manager6/lxc/Options.js | 5 ++---
www/manager6/lxc/Resources.js | 2 +-
www/manager6/qemu/AgentIPView.js | 1 -
www/manager6/qemu/HDEdit.js | 1 -
www/manager6/qemu/HDMove.js | 2 --
www/manager6/qemu/Options.js | 4 +---
www/manager6/qemu/Smbios1Edit.js | 1 -
www/manager6/storage/NFSEdit.js | 1 -
www/manager6/storage/TemplateView.js | 2 --
11 files changed, 6 insertions(+), 19 deletions(-)
diff --git a/www/manager6/lxc/CreateWizard.js b/www/manager6/lxc/CreateWizard.js
index 7be300ad..3ea271bf 100644
--- a/www/manager6/lxc/CreateWizard.js
+++ b/www/manager6/lxc/CreateWizard.js
@@ -269,7 +269,6 @@ Ext.define('PVE.lxc.CreateWizard', {
if (key === 'password') { // don't show pw
return;
}
- var html = Ext.htmlEncode(Ext.JSON.encode(value));
data.push({ key: key, value: value });
});
diff --git a/www/manager6/lxc/DNS.js b/www/manager6/lxc/DNS.js
index 9eb3d657..f277370c 100644
--- a/www/manager6/lxc/DNS.js
+++ b/www/manager6/lxc/DNS.js
@@ -99,7 +99,6 @@ Ext.define('PVE.lxc.DNS', {
initComponent: function() {
var me = this;
- var i;
var nodename = me.pveSelNode.data.node;
if (!nodename) {
@@ -215,8 +214,8 @@ Ext.define('PVE.lxc.DNS', {
var revert_btn = new PVE.button.PendingRevert();
var set_button_status = function() {
- var sm = me.getSelectionModel();
- var rec = sm.getSelection()[0];
+ let button_sm = me.getSelectionModel();
+ let rec = button_sm.getSelection()[0];
if (!rec) {
edit_btn.disable();
diff --git a/www/manager6/lxc/Options.js b/www/manager6/lxc/Options.js
index e1c4ce10..b64d03a9 100644
--- a/www/manager6/lxc/Options.js
+++ b/www/manager6/lxc/Options.js
@@ -6,7 +6,6 @@ Ext.define('PVE.lxc.Options', {
initComponent: function() {
var me = this;
- var i;
var nodename = me.pveSelNode.data.node;
if (!nodename) {
@@ -163,8 +162,8 @@ Ext.define('PVE.lxc.Options', {
var revert_btn = new PVE.button.PendingRevert();
var set_button_status = function() {
- var sm = me.getSelectionModel();
- var rec = sm.getSelection()[0];
+ let button_sm = me.getSelectionModel();
+ let rec = button_sm.getSelection()[0];
if (!rec) {
edit_btn.disable();
diff --git a/www/manager6/lxc/Resources.js b/www/manager6/lxc/Resources.js
index 96114460..a571c19e 100644
--- a/www/manager6/lxc/Resources.js
+++ b/www/manager6/lxc/Resources.js
@@ -17,7 +17,7 @@ Ext.define('PVE.lxc.RessourceView', {
initComponent: function() {
var me = this;
- var i, confid;
+ let confid;
var nodename = me.pveSelNode.data.node;
if (!nodename) {
diff --git a/www/manager6/qemu/AgentIPView.js b/www/manager6/qemu/AgentIPView.js
index 6518dfd6..8a9a4bb4 100644
--- a/www/manager6/qemu/AgentIPView.js
+++ b/www/manager6/qemu/AgentIPView.js
@@ -157,7 +157,6 @@ Ext.define('PVE.qemu.AgentIPView', {
text = ips.join('<br>');
}
} else if (me.nics && me.nics.error) {
- var msg = gettext('Cannot get info from Guest Agent<br>Error: {0}');
text = Ext.String.format(text, me.nics.error.desc);
}
} else if (me.agent) {
diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
index e22111bf..95a98b0b 100644
--- a/www/manager6/qemu/HDEdit.js
+++ b/www/manager6/qemu/HDEdit.js
@@ -375,7 +375,6 @@ Ext.define('PVE.qemu.HDEdit', {
isCreate: me.isCreate,
});
- var subject;
if (unused) {
me.subject = gettext('Unused Disk');
} else if (me.isCreate) {
diff --git a/www/manager6/qemu/HDMove.js b/www/manager6/qemu/HDMove.js
index c9ef34d7..5bae5314 100644
--- a/www/manager6/qemu/HDMove.js
+++ b/www/manager6/qemu/HDMove.js
@@ -44,8 +44,6 @@ Ext.define('PVE.window.HDMove', {
initComponent: function() {
var me = this;
- var diskarray = [];
-
if (!me.nodename) {
throw "no node name specified";
}
diff --git a/www/manager6/qemu/Options.js b/www/manager6/qemu/Options.js
index a08da6e1..ef7a336f 100644
--- a/www/manager6/qemu/Options.js
+++ b/www/manager6/qemu/Options.js
@@ -6,7 +6,6 @@ Ext.define('PVE.qemu.Options', {
initComponent: function() {
var me = this;
- var i;
var nodename = me.pveSelNode.data.node;
if (!nodename) {
@@ -99,7 +98,6 @@ Ext.define('PVE.qemu.Options', {
if (boot.order) {
let list = boot.order.split(';');
let ret = '';
- let i = 1;
list.forEach(dev => {
if (ret) {
ret += ', ';
@@ -110,7 +108,7 @@ Ext.define('PVE.qemu.Options', {
}
// legacy style and fallback
- var i;
+ let i;
var text = '';
var bootdisk = me.getObjectValue('bootdisk', undefined, pending);
order = boot.legacy || 'cdn';
diff --git a/www/manager6/qemu/Smbios1Edit.js b/www/manager6/qemu/Smbios1Edit.js
index af64cc07..fc159125 100644
--- a/www/manager6/qemu/Smbios1Edit.js
+++ b/www/manager6/qemu/Smbios1Edit.js
@@ -106,7 +106,6 @@ Ext.define('PVE.qemu.Smbios1Edit', {
me.load({
success: function(response, options) {
- var i, confid;
me.vmconfig = response.result.data;
var value = me.vmconfig.smbios1;
if (value) {
diff --git a/www/manager6/storage/NFSEdit.js b/www/manager6/storage/NFSEdit.js
index 5fc8265c..a1be8e74 100644
--- a/www/manager6/storage/NFSEdit.js
+++ b/www/manager6/storage/NFSEdit.js
@@ -93,7 +93,6 @@ Ext.define('PVE.storage.NFSInputPanel', {
setValues: function(values) {
var me = this;
if (values.options) {
- var res = values.options;
me.options = values.options.split(',');
me.options.forEach(function(item) {
var match = item.match(/^vers=(.*)$/);
diff --git a/www/manager6/storage/TemplateView.js b/www/manager6/storage/TemplateView.js
index 6fcfd1d3..a2a05e00 100644
--- a/www/manager6/storage/TemplateView.js
+++ b/www/manager6/storage/TemplateView.js
@@ -183,8 +183,6 @@ Ext.define('PVE.storage.TemplateView', {
me.content = 'vztmpl';
- var sm = me.sm = Ext.create('Ext.selection.RowModel', {});
-
var reload = function() {
me.store.load();
};
--
2.20.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [pve-devel] [PATCH manager 3/6] Functions may not be completely empty
2021-05-18 12:12 [pve-devel] [PATCH manager 0/6] eslint fixes Dominic Jäger
2021-05-18 12:12 ` [pve-devel] [PATCH manager 1/6] Fix usage of 'me' Dominic Jäger
2021-05-18 12:12 ` [pve-devel] [PATCH manager 2/6] No unused or duplicate variables Dominic Jäger
@ 2021-05-18 12:12 ` Dominic Jäger
2021-05-18 12:12 ` [pve-devel] [PATCH manager 4/6] Remove useless escapes Dominic Jäger
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Dominic Jäger @ 2021-05-18 12:12 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
---
www/manager6/storage/GlusterFsEdit.js | 1 +
www/manager6/storage/IScsiEdit.js | 1 +
www/manager6/storage/LvmThinEdit.js | 1 +
www/manager6/storage/NFSEdit.js | 1 +
www/manager6/storage/StatusView.js | 2 +-
5 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/www/manager6/storage/GlusterFsEdit.js b/www/manager6/storage/GlusterFsEdit.js
index 4ea5da26..8155d9c2 100644
--- a/www/manager6/storage/GlusterFsEdit.js
+++ b/www/manager6/storage/GlusterFsEdit.js
@@ -12,6 +12,7 @@ Ext.define('PVE.storage.GlusterFsScan', {
width: 350,
},
doRawQuery: function() {
+ // nothing
},
onTriggerClick: function() {
diff --git a/www/manager6/storage/IScsiEdit.js b/www/manager6/storage/IScsiEdit.js
index c5afa53b..341e0535 100644
--- a/www/manager6/storage/IScsiEdit.js
+++ b/www/manager6/storage/IScsiEdit.js
@@ -11,6 +11,7 @@ Ext.define('PVE.storage.IScsiScan', {
width: 350,
},
doRawQuery: function() {
+ // do nothing
},
onTriggerClick: function() {
diff --git a/www/manager6/storage/LvmThinEdit.js b/www/manager6/storage/LvmThinEdit.js
index 97248f11..4eab7740 100644
--- a/www/manager6/storage/LvmThinEdit.js
+++ b/www/manager6/storage/LvmThinEdit.js
@@ -8,6 +8,7 @@ Ext.define('PVE.storage.TPoolSelector', {
editable: false,
doRawQuery: function() {
+ // nothing
},
onTriggerClick: function() {
diff --git a/www/manager6/storage/NFSEdit.js b/www/manager6/storage/NFSEdit.js
index a1be8e74..faa41732 100644
--- a/www/manager6/storage/NFSEdit.js
+++ b/www/manager6/storage/NFSEdit.js
@@ -12,6 +12,7 @@ Ext.define('PVE.storage.NFSScan', {
width: 350,
},
doRawQuery: function() {
+ // do nothing
},
onTriggerClick: function() {
diff --git a/www/manager6/storage/StatusView.js b/www/manager6/storage/StatusView.js
index 90631b0b..6a5ba36f 100644
--- a/www/manager6/storage/StatusView.js
+++ b/www/manager6/storage/StatusView.js
@@ -66,6 +66,6 @@ Ext.define('PVE.storage.StatusView', {
],
updateTitle: function() {
- return;
+ // nothing
},
});
--
2.20.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [pve-devel] [PATCH manager 4/6] Remove useless escapes
2021-05-18 12:12 [pve-devel] [PATCH manager 0/6] eslint fixes Dominic Jäger
` (2 preceding siblings ...)
2021-05-18 12:12 ` [pve-devel] [PATCH manager 3/6] Functions may not be completely empty Dominic Jäger
@ 2021-05-18 12:12 ` Dominic Jäger
2021-05-18 12:12 ` [pve-devel] [PATCH manager 5/6] State equalities more precisely Dominic Jäger
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Dominic Jäger @ 2021-05-18 12:12 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
---
www/manager6/lxc/DNS.js | 2 +-
www/manager6/qemu/CloudInit.js | 2 +-
www/manager6/qemu/USBEdit.js | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/www/manager6/lxc/DNS.js b/www/manager6/lxc/DNS.js
index f277370c..6c519023 100644
--- a/www/manager6/lxc/DNS.js
+++ b/www/manager6/lxc/DNS.js
@@ -13,7 +13,7 @@ Ext.define('PVE.lxc.DNSInputPanel', {
}
if (values.nameserver) {
- var list = values.nameserver.split(/[\ \,\;]+/);
+ let list = values.nameserver.split(/[ ,;]+/);
values.nameserver = list.join(' ');
} else if (!me.insideWizard) {
deletes.push('nameserver');
diff --git a/www/manager6/qemu/CloudInit.js b/www/manager6/qemu/CloudInit.js
index 8465b402..77ff93d4 100644
--- a/www/manager6/qemu/CloudInit.js
+++ b/www/manager6/qemu/CloudInit.js
@@ -86,7 +86,7 @@ Ext.define('PVE.qemu.CloudInit', {
var insert_params = {};
let disk = PVE.Parser.parseQemuDrive(view.ciDriveId, view.ciDrive);
var storage = '';
- var stormatch = disk.file.match(/^([^\:]+)\:/);
+ var stormatch = disk.file.match(/^([^:]+):/);
if (stormatch) {
storage = stormatch[1];
}
diff --git a/www/manager6/qemu/USBEdit.js b/www/manager6/qemu/USBEdit.js
index 6a8b93bd..a2204584 100644
--- a/www/manager6/qemu/USBEdit.js
+++ b/www/manager6/qemu/USBEdit.js
@@ -149,11 +149,11 @@ Ext.define('PVE.qemu.USBEdit', {
var type = 'spice';
for (let i = 0; i < data.length; i++) {
- if (/^(host=)?(0x)?[a-zA-Z0-9]{4}\:(0x)?[a-zA-Z0-9]{4}$/.test(data[i])) {
+ if (/^(host=)?(0x)?[a-zA-Z0-9]{4}:(0x)?[a-zA-Z0-9]{4}$/.test(data[i])) {
hostdevice = data[i];
hostdevice = hostdevice.replace('host=', '').replace('0x', '');
type = 'hostdevice';
- } else if (/^(host=)?(\d+)\-(\d+(\.\d+)*)$/.test(data[i])) {
+ } else if (/^(host=)?(\d+)-(\d+(\.\d+)*)$/.test(data[i])) {
port = data[i];
port = port.replace('host=', '');
type = 'port';
--
2.20.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [pve-devel] [PATCH manager 5/6] State equalities more precisely
2021-05-18 12:12 [pve-devel] [PATCH manager 0/6] eslint fixes Dominic Jäger
` (3 preceding siblings ...)
2021-05-18 12:12 ` [pve-devel] [PATCH manager 4/6] Remove useless escapes Dominic Jäger
@ 2021-05-18 12:12 ` Dominic Jäger
2021-05-18 12:12 ` [pve-devel] [PATCH manager 6/6] Miscellaneous eslint fixes Dominic Jäger
2021-05-18 13:23 ` [pve-devel] applied-series: [PATCH manager 0/6] " Thomas Lamprecht
6 siblings, 0 replies; 8+ messages in thread
From: Dominic Jäger @ 2021-05-18 12:12 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Dominic Jäger <d.jaeger@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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [pve-devel] [PATCH manager 6/6] Miscellaneous eslint fixes
2021-05-18 12:12 [pve-devel] [PATCH manager 0/6] eslint fixes Dominic Jäger
` (4 preceding siblings ...)
2021-05-18 12:12 ` [pve-devel] [PATCH manager 5/6] State equalities more precisely Dominic Jäger
@ 2021-05-18 12:12 ` Dominic Jäger
2021-05-18 13:23 ` [pve-devel] applied-series: [PATCH manager 0/6] " Thomas Lamprecht
6 siblings, 0 replies; 8+ messages in thread
From: Dominic Jäger @ 2021-05-18 12:12 UTC (permalink / raw)
To: pve-devel
Function syntax, raw words, string templates, no prototype builtins
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
---
www/manager6/lxc/MPResize.js | 5 -----
www/manager6/qemu/HDResize.js | 4 ----
www/manager6/qemu/OSDefaults.js | 2 +-
www/manager6/storage/Base.js | 2 +-
www/manager6/storage/ImageView.js | 3 +--
www/manager6/storage/ZFSEdit.js | 2 +-
6 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/www/manager6/lxc/MPResize.js b/www/manager6/lxc/MPResize.js
index f73c5c3f..881c037b 100644
--- a/www/manager6/lxc/MPResize.js
+++ b/www/manager6/lxc/MPResize.js
@@ -91,11 +91,6 @@ Ext.define('PVE.window.MPResize', {
items: [me.formPanel],
});
-
me.callParent();
-
- if (!me.disk) {
- return;
- }
},
});
diff --git a/www/manager6/qemu/HDResize.js b/www/manager6/qemu/HDResize.js
index a18e242c..f9c7290d 100644
--- a/www/manager6/qemu/HDResize.js
+++ b/www/manager6/qemu/HDResize.js
@@ -92,9 +92,5 @@ Ext.define('PVE.window.HDResize', {
me.callParent();
-
- if (!me.disk) {
- return;
- }
},
});
diff --git a/www/manager6/qemu/OSDefaults.js b/www/manager6/qemu/OSDefaults.js
index 8e585651..f464133e 100644
--- a/www/manager6/qemu/OSDefaults.js
+++ b/www/manager6/qemu/OSDefaults.js
@@ -24,7 +24,7 @@ Ext.define('PVE.qemu.OSDefaults', {
var me = this;
var addOS = function(settings) {
- if (me.hasOwnProperty(settings.parent)) {
+ if (Object.prototype.hasOwnProperty.call(settings, 'parent')) {
var child = Ext.clone(me[settings.parent]);
me[settings.pveOS] = Ext.apply(child, settings);
} else {
diff --git a/www/manager6/storage/Base.js b/www/manager6/storage/Base.js
index 4336d634..20ec3464 100644
--- a/www/manager6/storage/Base.js
+++ b/www/manager6/storage/Base.js
@@ -78,7 +78,7 @@ Ext.define('PVE.panel.StoragePruneInputPanel', {
}
// always delete old 'maxfiles' on edit, we map it to keep-last on window load
return {
- delete: ['prune-backups', 'maxfiles'],
+ 'delete': ['prune-backups', 'maxfiles'],
};
}
let options = { 'prune-backups': retention };
diff --git a/www/manager6/storage/ImageView.js b/www/manager6/storage/ImageView.js
index dda4b8e6..69517b5e 100644
--- a/www/manager6/storage/ImageView.js
+++ b/www/manager6/storage/ImageView.js
@@ -33,8 +33,7 @@ Ext.define('PVE.storage.ImageView', {
text: gettext('Remove'),
disabled: true,
handler: function(btn, event, rec) {
- var url = "/nodes/" + nodename + "/storage/" + storage +
- "/content" + '/' + rec.data.volid;
+ let url = `/nodes/${nodename}/storage/${storage}/content/${rec.data.volid}`;
var vmid = rec.data.vmid;
var store = PVE.data.ResourceStore;
diff --git a/www/manager6/storage/ZFSEdit.js b/www/manager6/storage/ZFSEdit.js
index e348d1a1..0c5a3ceb 100644
--- a/www/manager6/storage/ZFSEdit.js
+++ b/www/manager6/storage/ZFSEdit.js
@@ -38,7 +38,7 @@ Ext.define('PVE.storage.ZFSInputPanel', {
return me.callParent([values]);
},
- setValues: function diff(values) {
+ setValues: function(values) {
values.writecache = values.nowritecache ? 0 : 1;
this.callParent([values]);
},
--
2.20.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [pve-devel] applied-series: [PATCH manager 0/6] eslint fixes
2021-05-18 12:12 [pve-devel] [PATCH manager 0/6] eslint fixes Dominic Jäger
` (5 preceding siblings ...)
2021-05-18 12:12 ` [pve-devel] [PATCH manager 6/6] Miscellaneous eslint fixes Dominic Jäger
@ 2021-05-18 13:23 ` Thomas Lamprecht
6 siblings, 0 replies; 8+ messages in thread
From: Thomas Lamprecht @ 2021-05-18 13:23 UTC (permalink / raw)
To: Proxmox VE development discussion, Dominic Jäger
On 18.05.21 14:12, Dominic Jäger wrote:
> Reduce eslint problems in qemu/lxc/storage to 3 Errors and 2 Warnings.
> Those are a little trickier, I'll fix them tomorrow.
>
> I clicked through a couple of wizards to test, but not yet every single
> possible window.
>
> Dominic Jäger (6):
> Fix usage of 'me'
> No unused or duplicate variables
> Functions may not be completely empty
> Remove useless escapes
> State equalities more precisely
> Miscellaneous eslint fixes
>
applied series, much thanks for your help on this task!
^ permalink raw reply [flat|nested] 8+ messages in thread