[pve-devel] [PATCH manager v2 4/6] ui: refactor refreshing the the resource store/tree
Dominik Csapak
d.csapak at proxmox.com
Thu Feb 2 15:41:33 CET 2023
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/UIOptions.js | 13 ++++++++-----
www/manager6/dc/OptionView.js | 1 +
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/www/manager6/UIOptions.js b/www/manager6/UIOptions.js
index c80a7c859..dcdf01ee1 100644
--- a/www/manager6/UIOptions.js
+++ b/www/manager6/UIOptions.js
@@ -16,6 +16,7 @@ Ext.define('PVE.UIOptions', {
PVE.UIOptions.updateTagList(PVE.UIOptions.options['allowed-tags']);
PVE.UIOptions.updateTagSettings(PVE.UIOptions.options['tag-style']);
+ PVE.UIOptions.fireUIConfigChanged();
},
});
},
@@ -65,11 +66,6 @@ Ext.define('PVE.UIOptions', {
}
Ext.ComponentQuery.query('pveResourceTree')[0].setUserCls(`proxmox-tags-${shape}`);
-
- if (!PVE.data.ResourceStore.isLoading() && PVE.data.ResourceStore.isLoaded()) {
- PVE.data.ResourceStore.fireEvent('load');
- }
- Ext.GlobalEvents.fireEvent('loadedUiOptions');
},
tagTreeStyles: {
@@ -89,4 +85,11 @@ Ext.define('PVE.UIOptions', {
shouldSortTags: function() {
return !(PVE.UIOptions.options['tag-style']?.ordering === 'config');
},
+
+ fireUIConfigChanged: function() {
+ if (!PVE.data.ResourceStore.isLoading() && PVE.data.ResourceStore.isLoaded()) {
+ PVE.data.ResourceStore.fireEvent('load');
+ }
+ Ext.GlobalEvents.fireEvent('loadedUiOptions');
+ },
});
diff --git a/www/manager6/dc/OptionView.js b/www/manager6/dc/OptionView.js
index 4435876dd..f36a68560 100644
--- a/www/manager6/dc/OptionView.js
+++ b/www/manager6/dc/OptionView.js
@@ -566,6 +566,7 @@ Ext.define('PVE.dc.OptionView', {
PVE.UIOptions.options['tag-style'] = store.getById('tag-style')?.data?.value;
PVE.UIOptions.updateTagSettings(PVE.UIOptions.options['tag-style']);
+ PVE.UIOptions.fireUIConfigChanged();
});
me.on('activate', me.rstore.startUpdate);
--
2.30.2
More information about the pve-devel
mailing list