like we do for qemu vms

Signed-off-by: Dominik Csapak <d.csa...@proxmox.com>
---
 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');
-               }
-           },
-           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');
+                   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;
                }
            },
-           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
            }
-- 
2.11.0


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to