From 3e4b78dc683d0ef3693cc9ad91ae68d341da5cca Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Fri, 6 Apr 2018 13:03:57 +0200 Subject: [PATCH] merge cores, cpulimit and cpuunits for containers like we do for qemu vms Signed-off-by: Dominik Csapak --- www/manager6/lxc/Resources.js | 41 ++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/www/manager6/lxc/Resources.js b/www/manager6/lxc/Resources.js index c4ae2db8..676ad340 100644 --- a/www/manager6/lxc/Resources.js +++ b/www/manager6/lxc/Resources.js @@ -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 }