From 2e63a4641491032a3a29c57bd63256cc5037b82a Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Sat, 14 May 2022 14:38:58 +0200 Subject: [PATCH] ui: trigger datastore update after maintenance mode edit This provides immediate feedback for adding the respective icon in the navigation tree entry most of the time, and we can then increase the query period of the datastore list store to the original 15 again, as it was lowered to 5 seconds for just this reason in commit fbd6f54f39b243e5 Signed-off-by: Thomas Lamprecht --- www/NavigationTree.js | 2 +- www/window/MaintenanceOptions.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/www/NavigationTree.js b/www/NavigationTree.js index 04de8dae..5f44aace 100644 --- a/www/NavigationTree.js +++ b/www/NavigationTree.js @@ -155,7 +155,7 @@ Ext.define('PBS.view.main.NavigationTree', { init: function(view) { view.rstore = Ext.create('Proxmox.data.UpdateStore', { autoStart: true, - interval: 5 * 1000, + interval: 15 * 1000, storeId: 'pbs-datastore-list', // NOTE: this is queried by selectors, avoid change! model: 'pbs-datastore-list', }); diff --git a/www/window/MaintenanceOptions.js b/www/window/MaintenanceOptions.js index 713da569..757c9fcf 100644 --- a/www/window/MaintenanceOptions.js +++ b/www/window/MaintenanceOptions.js @@ -21,6 +21,16 @@ Ext.define('PBS.window.MaintenanceOptions', { labelWidth: 120, }, + apiCallDone: function(success, response, options) { + if (success) { + let datastoreStore = Ext.data.StoreManager.lookup('pbs-datastore-list'); + if (datastoreStore) { + // delay a bit to allow the window to close and maintenance mode to take effect + setTimeout(() => datastoreStore.load(), 10); + } + } + }, + items: { xtype: 'inputpanel', onGetValues: function(values) {