merge cores, cpulimit and cpuunits for containers

like we do for qemu vms

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2018-04-06 13:03:57 +02:00 committed by Dietmar Maurer
parent 34c235bea6
commit 3e4b78dc68

View File

@ -59,32 +59,37 @@ Ext.define('PVE.lxc.RessourceView', {
defaultValue: '',
tdCls: 'pve-itype-icon-processor',
renderer: function(value) {
if (value) { return value; }
return gettext('unlimited');
var cpulimit = me.getObjectValue('cpulimit');
var cpuunits = me.getObjectValue('cpuunits');
var res;
if (value) {
res = value;
} else {
res = gettext('unlimited');
}
if (cpulimit) {
res += ' [cpulimit=' + cpulimit + ']';
}
if (cpuunits) {
res += ' [cpuunits=' + cpuunits + ']';
}
return res;
}
},
cpulimit: {
header: gettext('CPU limit'),
editor: caps.vms['VM.Config.CPU'] ? 'PVE.lxc.CPUEdit' : undefined,
defaultValue: 0,
tdCls: 'pve-itype-icon-processor',
renderer: function(value) {
if (value > 0) { return value; }
return gettext('unlimited');
}
},
cpuunits: {
header: gettext('CPU units'),
editor: caps.vms['VM.Config.CPU'] ? 'PVE.lxc.CPUEdit' : undefined,
defaultValue: 1024,
tdCls: 'pve-itype-icon-processor'
},
rootfs: {
header: gettext('Root Disk'),
defaultValue: Proxmox.Utils.noneText,
editor: mpeditor,
tdCls: 'pve-itype-icon-storage'
},
cpulimit: {
visible: false
},
cpuunits: {
visible: false
},
unprivileged: {
visible: false
}