[pve-devel] [PATCH] Make max_workers configurable in GUI
Caspar Smit
casparsmit at supernas.eu
Thu Mar 17 16:51:08 CET 2016
Forgot to add that the only problem with this addition is that when the
value of max_workers is configured, you cannot return to the default
anymore (schema check only allows integers).
So when you don't have max_workers in datacenter.cfg the default is to use
the number of CPUs as max_workers.
If max_workers is set in datacenter.cfg (value 1-64) you cannot 'clear' the
value and use the default again, i'm not really sure how to achieve that.
Caspar
Met vriendelijke groet,
Caspar Smit
Systemengineer
SuperNAS
Dorsvlegelstraat 13
1445 PA Purmerend
t: (+31) 299 410 414
e: casparsmit at supernas.eu
w: www.supernas.eu
2016-03-17 16:44 GMT+01:00 Caspar Smit <casparsmit at supernas.eu>:
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.proxmox.com/pipermail/pve-devel/attachments/20160317/a80f066d/attachment.htm>
More information about the pve-devel
mailing list