[pve-devel] [PATCH v2 manager 2/2] ui: vm selector: don't add invalid not found items

Dominik Csapak d.csapak at proxmox.com
Mon Sep 25 13:18:19 CEST 2023


On 7/7/23 10:02, Fiona Ebner wrote:
> Doing a simple numericity check and warn in the console so developers
> can notice if there is something off.
> 
> Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
> ---
> 
> New in v2.
> 
>   www/manager6/form/VMSelector.js | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/www/manager6/form/VMSelector.js b/www/manager6/form/VMSelector.js
> index bf2c8df7..4b04ac30 100644
> --- a/www/manager6/form/VMSelector.js
> +++ b/www/manager6/form/VMSelector.js
> @@ -136,7 +136,11 @@ Ext.define('PVE.form.VMSelector', {
>   	let selection = value.map(item => {
>   	    let found = store.findRecord('vmid', item, 0, false, true, true);
>   	    if (!found) {
> -		notFound.push(item);
> +		if (Ext.isNumeric(item)) {
> +		    notFound.push(item);
> +		} else {
> +		    console.warn(`invalid item in vm selection: ${item}`);
> +		}
>   	    }
>   	    return found;
>   	}).filter(r => r);


LGTM

Reviewed-by: Dominik Csapak <d.csapak at proxmox.com>





More information about the pve-devel mailing list