mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-17 02:33:13 +00:00
Fix JSLint type confusion warnings
The type confusion warnings arose from string and integer concatenation, and object properties of the name which were alternatively set with strings and integers. Signed-off-by: Emmanuel Kasper <e.kasper@proxmox.com>
This commit is contained in:
parent
48f65bb454
commit
72408db913
@ -1,5 +1,3 @@
|
|||||||
// fixme: howto avoid jslint type confusion?
|
|
||||||
/*jslint confusion: true */
|
|
||||||
Ext.define('PVE.qemu.HardwareView', {
|
Ext.define('PVE.qemu.HardwareView', {
|
||||||
extend: 'PVE.grid.PendingObjectGrid',
|
extend: 'PVE.grid.PendingObjectGrid',
|
||||||
alias: ['widget.PVE.qemu.HardwareView'],
|
alias: ['widget.PVE.qemu.HardwareView'],
|
||||||
@ -47,7 +45,7 @@ Ext.define('PVE.qemu.HardwareView', {
|
|||||||
header: gettext('Memory'),
|
header: gettext('Memory'),
|
||||||
editor: caps.vms['VM.Config.Memory'] ? 'PVE.qemu.MemoryEdit' : undefined,
|
editor: caps.vms['VM.Config.Memory'] ? 'PVE.qemu.MemoryEdit' : undefined,
|
||||||
never_delete: true,
|
never_delete: true,
|
||||||
defaultValue: 512,
|
defaultValue: '512',
|
||||||
tdCls: 'pve-itype-icon-memory',
|
tdCls: 'pve-itype-icon-memory',
|
||||||
renderer: function(value, metaData, record) {
|
renderer: function(value, metaData, record) {
|
||||||
var balloon = me.getObjectValue('balloon');
|
var balloon = me.getObjectValue('balloon');
|
||||||
@ -65,7 +63,7 @@ Ext.define('PVE.qemu.HardwareView', {
|
|||||||
editor: (caps.vms['VM.Config.CPU'] || caps.vms['VM.Config.HWType']) ?
|
editor: (caps.vms['VM.Config.CPU'] || caps.vms['VM.Config.HWType']) ?
|
||||||
'PVE.qemu.ProcessorEdit' : undefined,
|
'PVE.qemu.ProcessorEdit' : undefined,
|
||||||
tdCls: 'pve-itype-icon-processor',
|
tdCls: 'pve-itype-icon-processor',
|
||||||
defaultValue: 1,
|
defaultValue: '1',
|
||||||
multiKey: ['sockets', 'cpu', 'cores', 'numa', 'vcpus', 'cpulimit', 'cpuunits'],
|
multiKey: ['sockets', 'cpu', 'cores', 'numa', 'vcpus', 'cpulimit', 'cpuunits'],
|
||||||
renderer: function(value, metaData, record, rowIndex, colIndex, store, pending) {
|
renderer: function(value, metaData, record, rowIndex, colIndex, store, pending) {
|
||||||
|
|
||||||
@ -77,8 +75,9 @@ Ext.define('PVE.qemu.HardwareView', {
|
|||||||
var cpulimit = me.getObjectValue('cpulimit', undefined, pending);
|
var cpulimit = me.getObjectValue('cpulimit', undefined, pending);
|
||||||
var cpuunits = me.getObjectValue('cpuunits', undefined, pending);
|
var cpuunits = me.getObjectValue('cpuunits', undefined, pending);
|
||||||
|
|
||||||
var res = (sockets*cores) + ' (' + sockets + ' sockets, ' + cores + ' cores)';
|
var res = Ext.String.format('{0} ({1} sockets, {2} cores)',
|
||||||
|
sockets*cores, sockets, cores);
|
||||||
|
|
||||||
if (model) {
|
if (model) {
|
||||||
res += ' [' + model + ']';
|
res += ' [' + model + ']';
|
||||||
}
|
}
|
||||||
@ -149,7 +148,7 @@ Ext.define('PVE.qemu.HardwareView', {
|
|||||||
};
|
};
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
confid = "ide" + i;
|
confid = "ide" + i.toString();
|
||||||
rows[confid] = {
|
rows[confid] = {
|
||||||
group: 1,
|
group: 1,
|
||||||
tdCls: 'pve-itype-icon-storage',
|
tdCls: 'pve-itype-icon-storage',
|
||||||
@ -160,7 +159,7 @@ Ext.define('PVE.qemu.HardwareView', {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
for (i = 0; i < 6; i++) {
|
for (i = 0; i < 6; i++) {
|
||||||
confid = "sata" + i;
|
confid = "sata" + i.toString();
|
||||||
rows[confid] = {
|
rows[confid] = {
|
||||||
group: 1,
|
group: 1,
|
||||||
tdCls: 'pve-itype-icon-storage',
|
tdCls: 'pve-itype-icon-storage',
|
||||||
@ -171,7 +170,7 @@ Ext.define('PVE.qemu.HardwareView', {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
for (i = 0; i < 16; i++) {
|
for (i = 0; i < 16; i++) {
|
||||||
confid = "scsi" + i;
|
confid = "scsi" + i.toString();
|
||||||
rows[confid] = {
|
rows[confid] = {
|
||||||
group: 1,
|
group: 1,
|
||||||
tdCls: 'pve-itype-icon-storage',
|
tdCls: 'pve-itype-icon-storage',
|
||||||
@ -182,7 +181,7 @@ Ext.define('PVE.qemu.HardwareView', {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
for (i = 0; i < 16; i++) {
|
for (i = 0; i < 16; i++) {
|
||||||
confid = "virtio" + i;
|
confid = "virtio" + i.toString();
|
||||||
rows[confid] = {
|
rows[confid] = {
|
||||||
group: 1,
|
group: 1,
|
||||||
tdCls: 'pve-itype-icon-storage',
|
tdCls: 'pve-itype-icon-storage',
|
||||||
@ -193,7 +192,7 @@ Ext.define('PVE.qemu.HardwareView', {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
for (i = 0; i < 32; i++) {
|
for (i = 0; i < 32; i++) {
|
||||||
confid = "net" + i;
|
confid = "net" + i.toString();
|
||||||
rows[confid] = {
|
rows[confid] = {
|
||||||
group: 2,
|
group: 2,
|
||||||
tdCls: 'pve-itype-icon-network',
|
tdCls: 'pve-itype-icon-network',
|
||||||
@ -210,7 +209,7 @@ Ext.define('PVE.qemu.HardwareView', {
|
|||||||
header: gettext('EFI Disk')
|
header: gettext('EFI Disk')
|
||||||
};
|
};
|
||||||
for (i = 0; i < 5; i++) {
|
for (i = 0; i < 5; i++) {
|
||||||
confid = "usb" + i;
|
confid = "usb" + i.toString();
|
||||||
rows[confid] = {
|
rows[confid] = {
|
||||||
group: 4,
|
group: 4,
|
||||||
tdCls: 'pve-itype-icon-usb',
|
tdCls: 'pve-itype-icon-usb',
|
||||||
@ -220,7 +219,7 @@ Ext.define('PVE.qemu.HardwareView', {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
confid = "hostpci" + i;
|
confid = "hostpci" + i.toString();
|
||||||
rows[confid] = {
|
rows[confid] = {
|
||||||
group: 5,
|
group: 5,
|
||||||
tdCls: 'pve-itype-icon-pci',
|
tdCls: 'pve-itype-icon-pci',
|
||||||
@ -229,11 +228,11 @@ Ext.define('PVE.qemu.HardwareView', {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
rows["unused" + i] = {
|
rows["unused" + i.toString()] = {
|
||||||
group: 6,
|
group: 6,
|
||||||
tdCls: 'pve-itype-icon-storage',
|
tdCls: 'pve-itype-icon-storage',
|
||||||
editor: caps.vms['VM.Config.Disk'] ? 'PVE.qemu.HDEdit' : undefined,
|
editor: caps.vms['VM.Config.Disk'] ? 'PVE.qemu.HDEdit' : undefined,
|
||||||
header: gettext('Unused Disk') + ' ' + i
|
header: gettext('Unused Disk') + ' ' + i.toString()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user