[pve-devel] [PATCH manager v2] fix #1698: add_integer_row should add an integer row

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Mar 16 11:33:59 CET 2018


On 03/16/2018 10:55 AM, Dominik Csapak wrote:
> this got mixed up during the change to the widget toolkit
> also set deleteEmpty and give a renderer
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
> changes from v1:
> * add deleteEmpty
> * add renderer
> 
> this needs the widget toolkit patch:
> [PATCH widget-toolkit] add an optional renderer for integer rows in ObjectGrid
> for the renderer to work
> 
>  www/manager6/grid/FirewallOptions.js | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/www/manager6/grid/FirewallOptions.js b/www/manager6/grid/FirewallOptions.js
> index 819ebb8d..4121f90f 100644
> --- a/www/manager6/grid/FirewallOptions.js
> +++ b/www/manager6/grid/FirewallOptions.js
> @@ -29,7 +29,13 @@ Ext.define('PVE.FirewallOptions', {
>  	    me.add_boolean_row(name, text, { defaultValue: defaultValue });
>  	};
>  	var add_integer_row = function(name, text, minValue) {
> -	    me.add_boolean_row(name, text, { minValue: minValue });
> +	    me.add_integer_row(name, text, {
> +		minValue: minValue,
> +		deleteEmpty: true,
> +		renderer: function(value) {
> +		    return value || Proxmox.Utils.defaultText;
> +		}

this is a common integer add function, so what when
0 is a valid, non-default value?

It work now, as the both users of this function (nf_conntrack_max,
nf_conntrack_tcp_timeout_established) do not have 0 in their valid
range...

I'd rather have this in two changesets, the change to
add_integer_row and the rest...


> +	    });
>  	};
>  
>  	var add_log_row = function(name, labelWidth) {
> 





More information about the pve-devel mailing list