[pve-devel] [PATCH v5 manager 3/6] ui: backup window: set loading mask early enough

Fabian Ebner f.ebner at proxmox.com
Thu May 6 14:16:29 CEST 2021


but not too early. Because of an ExtJS bug/limitation, it can only happen after
the window is rendered, so use an afterrender listener. Without setting the
mask there, the window will be active already before the storage selectors
change listener triggers, which can only happen after the storage selectors
store is loaded.

Made noticable by the new "filling in defaults" behavior, but the issue was
already present earlier, where the compression selector for PBS storages would
be disabled late, after the window was already active.

Also move the setValue call into the afterrender listener, so ordering is easy
to verify/more stable.

Reported-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 www/manager6/window/Backup.js | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/www/manager6/window/Backup.js b/www/manager6/window/Backup.js
index 76a4987e..8d9824f3 100644
--- a/www/manager6/window/Backup.js
+++ b/www/manager6/window/Backup.js
@@ -46,6 +46,10 @@ Ext.define('PVE.window.Backup', {
 	    allowBlank: false,
 	    listeners: {
 		change: function(f, v) {
+		    if (!initialDefaults) {
+			me.setLoading(false);
+		    }
+
 		    if (v === null || v === undefined || v === '') {
 			return;
 		    }
@@ -87,7 +91,6 @@ Ext.define('PVE.window.Backup', {
 		},
 	    },
 	});
-	storagesel.setValue(me.storage);
 
 	me.formPanel = Ext.create('Ext.form.Panel', {
 	    bodyPadding: 10,
@@ -172,6 +175,13 @@ Ext.define('PVE.window.Backup', {
 	    border: false,
 	    items: [me.formPanel],
 	    buttons: [helpBtn, '->', submitBtn],
+	    listeners: {
+		afterrender: function() {
+		    /// cleared within the storage selector's change listener
+		    me.setLoading(gettext('Please wait...'));
+		    storagesel.setValue(me.storage);
+		},
+	    },
 	});
 
 	me.callParent();
-- 
2.20.1






More information about the pve-devel mailing list