mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-24 16:59:02 +00:00
ui: fire config change: always pass required parameters
As otherwise the listeners might choke on the missing records. For our usage it was only a problem when one changed the tree UI options while having the Datacenter -> Summary panel open, as that listens to the UI changes to adapt the shown gauges for e.g., memory, storage, or CPUs, and thus actually uses the current result (unlike we do in the store load listener). Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
e98edb4c37
commit
4aa70a6b3a
@ -99,9 +99,7 @@ Ext.define('PVE.UIOptions', {
|
||||
},
|
||||
|
||||
fireUIConfigChanged: function() {
|
||||
if (!PVE.data.ResourceStore.isLoading() && PVE.data.ResourceStore.isLoaded()) {
|
||||
PVE.data.ResourceStore.fireEvent('load');
|
||||
}
|
||||
PVE.data.ResourceStore.refresh();
|
||||
Ext.GlobalEvents.fireEvent('loadedUiOptions');
|
||||
},
|
||||
});
|
||||
|
@ -53,6 +53,15 @@ Ext.define('PVE.data.ResourceStore', {
|
||||
return '';
|
||||
},
|
||||
|
||||
refresh: function() {
|
||||
let me = this;
|
||||
// can only refresh if we're loaded at least once and are not currently loading
|
||||
if (!me.isLoading() && me.isLoaded()) {
|
||||
let records = (me.getData().getSource() || me.getData()).getRange()
|
||||
me.fireEvent('load', me, records);
|
||||
}
|
||||
},
|
||||
|
||||
constructor: function(config) {
|
||||
let me = this;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user