let isCloudInitKey = v => v && v.toString().match(/vm-.*-cloudinit/);
+ const nodeInfo = PVE.data.ResourceStore.getNodes().find(node => node.node === nodename);
+ let processorEditor = {
+ xtype: 'pveQemuProcessorEdit',
+ cgroupMode: nodeInfo['cgroup-mode'],
+ };
+
let rows = {
memory: {
header: gettext('Memory'),
header: gettext('Processors'),
never_delete: true,
editor: caps.vms['VM.Config.CPU'] || caps.vms['VM.Config.HWType']
- ? 'PVE.qemu.ProcessorEdit' : undefined,
+ ? processorEditor : undefined,
tdCls: 'pve-itype-icon-cpu',
group: 3,
defaultValue: '1',
return;
}
- Ext.create('PVE.window.HDReassign', {
+ Ext.create('PVE.window.GuestDiskReassign', {
autoShow: true,
disk: rec.data.key,
nodename: nodename,
let counts = {};
let isAtLimit = (type) => counts[type] >= PVE.Utils.hardware_counts[type];
+ let isAtUsbLimit = () => {
+ let ostype = me.getObjectValue('ostype');
+ let machine = me.getObjectValue('machine');
+ return counts.usb >= PVE.Utils.get_max_usb_count(ostype, machine);
+ };
let set_button_status = function() {
let selection_model = me.getSelectionModel();
const noVMConfigNetPerm = !caps.vms['VM.Config.Network'];
const noVMConfigDiskPerm = !caps.vms['VM.Config.Disk'];
- me.down('#addUsb').setDisabled(noSysConsolePerm || isAtLimit('usb'));
+ me.down('#addUsb').setDisabled(noSysConsolePerm || isAtUsbLimit());
me.down('#addPci').setDisabled(noSysConsolePerm || isAtLimit('hostpci'));
me.down('#addAudio').setDisabled(noVMConfigHWTypePerm || isAtLimit('audio'));
me.down('#addSerial').setDisabled(noVMConfigHWTypePerm || isAtLimit('serial'));