ui: eslint: fix usage of 'me'
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
03153d556b
commit
46d9a35c33
@ -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 */
|
||||
|
@ -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'),
|
||||
|
@ -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();
|
||||
},
|
||||
});
|
||||
},
|
||||
|
@ -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);
|
||||
},
|
||||
|
@ -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);
|
||||
});
|
||||
|
@ -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;
|
||||
|
@ -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: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user