[pve-devel] [PATCH] Make max_workers configurable in GUI

Caspar Smit casparsmit at supernas.eu
Thu Mar 17 16:44:45 CET 2016


Signed-off-by: Caspar Smit <casparsmit at supernas.eu>
---
 www/manager/dc/OptionView.js | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/www/manager/dc/OptionView.js b/www/manager/dc/OptionView.js
index 1a94be7..d09434a 100644
--- a/www/manager/dc/OptionView.js
+++ b/www/manager/dc/OptionView.js
@@ -99,6 +99,33 @@ Ext.define('PVE.dc.EmailFromEdit', {
     }
 });
 
+Ext.define('PVE.dc.MaxWorkersEdit', {
+    extend: 'PVE.window.Edit',
+
+    initComponent : function() {
+	var me = this;
+
+	Ext.applyIf(me, {
+	    subject: gettext('Maximum Workers'),
+	    items: {
+		xtype: 'numberfield',
+		name: 'max_workers',
+		minValue: 1,
+		maxValue: 64,
+		step: 1,
+		fieldLabel: gettext('Max Workers'),
+		allowBlank: true,
+		emptyText: gettext('Number of CPUs'),
+		value: ''
+	    }
+	});
+
+	me.callParent();
+
+	me.load();
+    }
+});
+
 Ext.define('PVE.dc.OptionView', {
     extend: 'PVE.grid.ObjectGrid',
     alias: ['widget.pveDcOptionView'],
@@ -147,6 +174,17 @@ Ext.define('PVE.dc.OptionView', {
 		    }
 		    return value;
 		}
+	    },
+	    max_workers: {
+		header: gettext('Maximum Workers'),
+		editor: 'PVE.dc.MaxWorkersEdit',
+		required: true,
+		renderer: function(value) {
+		    if (!value) {
+			return PVE.Utils.defaultText + ' (Number of CPUs)';
+		    }
+		    return value;
+		}
 	    }
 	};
 
-- 
2.1.4




More information about the pve-devel mailing list