[pve-devel] [PATCH manager 1/3] ui: Utils: refactor refreshing the the resource store/tree

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Feb 2 11:22:29 CET 2023


Am 01/02/2023 um 16:49 schrieb Dominik Csapak:
> we'll need it elsewhere too, and it was rather hidden in the
> updateTagSettings call.
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  www/manager6/Utils.js         | 3 +++
>  www/manager6/dc/OptionView.js | 1 +
>  2 files changed, 4 insertions(+)
> 
> diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
> index fcc668c3a..ee9e4bd5d 100644
> --- a/www/manager6/Utils.js
> +++ b/www/manager6/Utils.js
> @@ -1871,6 +1871,7 @@ Ext.define('PVE.Utils', {
>  
>  		PVE.Utils.updateTagList(PVE.UIOptions['allowed-tags']);
>  		PVE.Utils.updateTagSettings(PVE.UIOptions?.['tag-style']);
> +		PVE.Utils.fireUIUpdate();
>  	    },
>  	});
>      },
> @@ -1920,7 +1921,9 @@ Ext.define('PVE.Utils', {
>  	}
>  
>  	Ext.ComponentQuery.query('pveResourceTree')[0].setUserCls(`proxmox-tags-${shape}`);
> +    },
>  
> +    fireUIUpdate: function() {

naming is off for this as it uses the action desired (but that's not future proof)
instead of using the actual event being fired, e.g., do s/fireUIUpdate/fireUIConfigChange/

btw, utils _really_ is a convoluted mess that needs some basic cleanup rather sooner
than later...

>  	if (!PVE.data.ResourceStore.isLoading() && PVE.data.ResourceStore.isLoaded()) {
>  	    PVE.data.ResourceStore.fireEvent('load');
>  	}
> diff --git a/www/manager6/dc/OptionView.js b/www/manager6/dc/OptionView.js
> index 9c803beef..2e4f76263 100644
> --- a/www/manager6/dc/OptionView.js
> +++ b/www/manager6/dc/OptionView.js
> @@ -566,6 +566,7 @@ Ext.define('PVE.dc.OptionView', {
>  
>  	    PVE.UIOptions['tag-style'] = store.getById('tag-style')?.data?.value;
>  	    PVE.Utils.updateTagSettings(PVE.UIOptions['tag-style']);
> +	    PVE.Utils.fireUIUpdate();
>  	});
>  
>  	me.on('activate', me.rstore.startUpdate);






More information about the pve-devel mailing list