mirror of
git://git.proxmox.com/git/proxmox-backup.git
synced 2025-03-05 20:58:33 +03:00
ui: datastore summary: only start/stop other stores on edges
Disabling basically was already done only on an transition edge from "success" -> "failure" (= !success), as we stopped the periodic store load in that case, thus we never trigger to "failures" after each other without any user input. But on success we always unconditionally fired an activate, which cause the status store to start its store updates, which in turn immediately triggered as store load. So the verbose status call of the info panel was now coupled to the 1s update period of the encompassing summary panel, not the slower 5s period it actually wanted to trigger an update. So save the last state and check if it actually differs before causing such action. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
d11deccff1
commit
2de3d5385c
@ -368,10 +368,13 @@ Ext.define('PBS.DataStoreSummary', {
|
||||
interval: 1000,
|
||||
});
|
||||
|
||||
let lastRequestWasFailue = false;
|
||||
me.mon(me.statusStore, 'load', (s, records, success) => {
|
||||
let mountBtn = me.lookupReferenceHolder().lookupReference('mountButton');
|
||||
let unmountBtn = me.lookupReferenceHolder().lookupReference('unmountButton');
|
||||
if (!success) {
|
||||
lastRequestWasFailue = true;
|
||||
|
||||
me.statusStore.stopUpdate();
|
||||
me.down('pbsDataStoreInfo').fireEvent('deactivate');
|
||||
Proxmox.Utils.API2Request({
|
||||
@ -395,9 +398,13 @@ Ext.define('PBS.DataStoreSummary', {
|
||||
},
|
||||
});
|
||||
} else {
|
||||
me.down('pbsDataStoreInfo').fireEvent('activate');
|
||||
// only trigger on edges, else we couple our interval to the info one
|
||||
if (lastRequestWasFailue) {
|
||||
me.down('pbsDataStoreInfo').fireEvent('activate');
|
||||
}
|
||||
unmountBtn.setDisabled(false);
|
||||
mountBtn.setDisabled(true);
|
||||
lastRequestWasFailue = false;
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user