[pve-devel] [PATCH manager] lxc: correctly display cpulimit

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Sep 15 14:51:56 CEST 2016


the backend defaults to 0 (unlimited), so this should also be the default
in the GUI if nothing is set.
---
 www/manager6/lxc/ResourceEdit.js | 1 +
 www/manager6/lxc/Resources.js    | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/www/manager6/lxc/ResourceEdit.js b/www/manager6/lxc/ResourceEdit.js
index 498e789..ff49e2f 100644
--- a/www/manager6/lxc/ResourceEdit.js
+++ b/www/manager6/lxc/ResourceEdit.js
@@ -131,6 +131,7 @@ Ext.define('PVE.lxc.CPUInputPanel', {
 	    me.column1 = items;
 	} else {
 	    me.items = items;
+	    me.items[0].value = 0;
 	}
    
 	me.callParent();
diff --git a/www/manager6/lxc/Resources.js b/www/manager6/lxc/Resources.js
index 355b903..70dfba5 100644
--- a/www/manager6/lxc/Resources.js
+++ b/www/manager6/lxc/Resources.js
@@ -62,10 +62,10 @@ Ext.define('PVE.lxc.RessourceView', {
 		header: gettext('CPU limit'),
 		never_delete: true,
 		editor: caps.vms['VM.Config.CPU'] ? 'PVE.lxc.CPUEdit' : undefined,
-		defaultValue: 1,
+		defaultValue: 0,
 		tdCls: 'pve-itype-icon-processor',
 		renderer: function(value) {
-		    if (value) { return value; }
+		    if (value > 0) { return value; }
 		    return gettext('unlimited');
 		}
 	    },
-- 
2.1.4





More information about the pve-devel mailing list