[pve-devel] [PATCH manager 04/19] use IntegerField from widget toolkit

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jan 8 12:21:31 CET 2018


On 12/21/17 1:36 PM, Dominik Csapak wrote:
> diff --git a/www/manager6/lxc/Options.js b/www/manager6/lxc/Options.js
> index 4a438877..4a855d52 100644
> --- a/www/manager6/lxc/Options.js
> +++ b/www/manager6/lxc/Options.js
> @@ -81,23 +81,14 @@ Ext.define('PVE.lxc.Options', {
>  		    xtype: 'pveWindowEdit',
>  		    subject: gettext('TTY count'),
>  		    items: {
> -			xtype: 'pveIntegerField',
> +			xtype: 'proxmoxintegerfield',
>  			name: 'tty',
>  			minValue: 0,
>  			maxValue: 6,
>  			value: 2,
>  			fieldLabel: gettext('TTY count'),
> -			allowEmpty: gettext('Default'),
> -			getSubmitData: function() {
> -			    var me = this;
> -			    var val = me.getSubmitValue();
> -			    if (val !== null && val !== '' && val !== '2') {
> -				return { tty: val };
> -			    } else {
> -				return { 'delete' : 'tty' };
> -			    }
> -			}
> -
> +			emptyText: gettext('Default'),
> +			deleteEmpty: true

Slight regression, here when we set the value to the default of 2,
previously it was deleted now it doesn't.

The proxmoxintegerfield could be changed to also delete the value if
it's equal to the initial configured value (aka the default value) when
deleteEmpty is set, just as an idea.

could be also just ignored, though, it's not a harm.

>  		    }
>  		} : undefined
>  	    },





More information about the pve-devel mailing list