[pve-devel] applied: [PATCH manager] gui: show 0 for max_relocate/restart correctly

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jul 8 19:27:45 CEST 2019


On 7/8/19 2:12 PM, Dominik Csapak wrote:
> 0 || '1' will always return '1'
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  www/manager6/ha/Resources.js | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/www/manager6/ha/Resources.js b/www/manager6/ha/Resources.js
> index 0b142c8d..bd6c337c 100644
> --- a/www/manager6/ha/Resources.js
> +++ b/www/manager6/ha/Resources.js
> @@ -146,7 +146,10 @@ Ext.define('PVE.ha.ResourcesView', {
>  		    width: 100,
>  		    sortable: true,
>  		    renderer: function(v) {
> -			return v || '1';
> +			if (v === undefined) {
> +			    return '1';
> +			}
> +			return v;
>  		    },
>  		    dataIndex: 'max_restart'
>  		},
> @@ -155,7 +158,10 @@ Ext.define('PVE.ha.ResourcesView', {
>  		    width: 100,
>  		    sortable: true,
>  		    renderer: function(v) {
> -			return v || '1';
> +			if (v === undefined) {
> +			    return '1';
> +			}
> +			return v;
>  		    },
>  		    dataIndex: 'max_relocate'
>  		},
> 

applied to stable 5 and to master, but for the latter I just had
to follouwp with some arrow function use ^^




More information about the pve-devel mailing list