[pbs-devel] [PATCH proxmox-backup 1/4] ui: tape/ChangerStatus: only show loading on 'force refresh'

Dominik Csapak d.csapak at proxmox.com
Mon Feb 22 14:25:34 CET 2021


so that we can update in the background without interfering with the
users workflow

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
another alternative would be to have a 'spinning' loading icon
at the top, but i think this is also ok, since the user explicitely
pressed 'reload'

 www/tape/ChangerStatus.js | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/www/tape/ChangerStatus.js b/www/tape/ChangerStatus.js
index bedeaaec..8e5ee900 100644
--- a/www/tape/ChangerStatus.js
+++ b/www/tape/ChangerStatus.js
@@ -413,8 +413,10 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
 	    }
 
 	    try {
-		Proxmox.Utils.setErrorMask(view, true);
-		Proxmox.Utils.setErrorMask(me.lookup('content'));
+		if (!use_cache) {
+		    Proxmox.Utils.setErrorMask(view, true);
+		    Proxmox.Utils.setErrorMask(me.lookup('content'));
+		}
 		let status_fut = PBS.Async.api2({
 		    timeout: 5*60*1000,
 		    method: 'GET',
@@ -484,10 +486,15 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
 		me.lookup('import_export').getStore().setData(data['import-export']);
 		me.lookup('drives').getStore().setData(data.drive);
 
-		Proxmox.Utils.setErrorMask(view);
+		if (!use_cache) {
+		    Proxmox.Utils.setErrorMask(view);
+		}
+		Proxmox.Utils.setErrorMask(me.lookup('content'));
 	    } catch (err) {
-		Proxmox.Utils.setErrorMask(view);
-		Proxmox.Utils.setErrorMask(me.lookup('content'), err);
+		if (!use_cache) {
+		    Proxmox.Utils.setErrorMask(view);
+		}
+		Proxmox.Utils.setErrorMask(me.lookup('content'), err.toString());
 	    }
 	},
 
-- 
2.20.1






More information about the pbs-devel mailing list