public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] ui: tape: reload drive status on user actions
@ 2021-04-23 10:52 Dominik Csapak
  0 siblings, 0 replies; only message in thread
From: Dominik Csapak @ 2021-04-23 10:52 UTC (permalink / raw)
  To: pbs-devel

when the user start an action where we know that it locks the drive,
reload the tape store, so that the state is refreshed

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/tape/DriveStatus.js | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/www/tape/DriveStatus.js b/www/tape/DriveStatus.js
index acc77680..2c55fc97 100644
--- a/www/tape/DriveStatus.js
+++ b/www/tape/DriveStatus.js
@@ -33,6 +33,10 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
     controller: {
 	xclass: 'Ext.app.ViewController',
 
+	reloadTapeStore: function() {
+	    Ext.ComponentQuery.query('navigationtree')[0].reloadTapeStore();
+	},
+
 	reload: function() {
 	    let me = this;
 	    me.lookup('statusgrid').rstore.load();
@@ -46,6 +50,7 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
 	    vm.set('online', online);
 	    let title = online ? gettext('Status') : gettext('Status (No Tape loaded)');
 	    statusgrid.setTitle(title);
+	    Ext.ComponentQuery.query('navigationtree')[0].reloadTapeStore();
 	},
 
 	onStateLoad: function(store) {
@@ -79,6 +84,11 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
 	    let me = this;
 	    Ext.create('PBS.TapeManagement.LabelMediaWindow', {
 		driveid: me.getView().drive,
+		apiCallDone: function(success) {
+		    if (success) {
+			me.reloadTapeStore();
+		    }
+		},
 	    }).show();
 	},
 
@@ -90,6 +100,7 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
 		waitMsgTarget: view,
 		method: 'POST',
 		success: function(response) {
+		    me.reloadTapeStore();
 		    Ext.create('Proxmox.window.TaskProgress', {
 			upid: response.result.data,
 			taskDone: function() {
@@ -108,6 +119,7 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
 		waitMsgTarget: view,
 		method: 'POST',
 		success: function(response) {
+		    me.reloadTapeStore();
 		    Ext.create('Proxmox.window.TaskProgress', {
 			upid: response.result.data,
 			taskDone: function() {
@@ -126,6 +138,7 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
 		waitMsgTarget: view,
 		method: 'POST',
 		success: function(response) {
+		    me.reloadTapeStore();
 		    Ext.create('Proxmox.window.TaskViewer', {
 			upid: response.result.data,
 			taskDone: function() {
@@ -143,7 +156,10 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
 
 	    PBS.Utils.driveCommand(drive, 'read-label', {
 		waitMsgTarget: view,
-		success: PBS.Utils.showMediaLabelWindow,
+		success: function(response) {
+		    me.reloadTapeStore();
+		    PBS.Utils.showMediaLabelWindow(response);
+		},
 	    });
 	},
 
@@ -153,7 +169,10 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
 	    let drive = view.drive;
 	    PBS.Utils.driveCommand(drive, 'volume-statistics', {
 		waitMsgTarget: view,
-		success: PBS.Utils.showVolumeStatisticsWindow,
+		success: function(response) {
+		    me.reloadTapeStore();
+		    PBS.Utils.showVolumeStatisticsWindow(response);
+		},
 	    });
 	},
 
@@ -163,7 +182,10 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
 	    let drive = view.drive;
 	    PBS.Utils.driveCommand(drive, 'cartridge-memory', {
 		waitMsgTarget: me.getView(),
-		success: PBS.Utils.showCartridgeMemoryWindow,
+		success: function(response) {
+		    me.reloadTapeStore();
+		    PBS.Utils.showCartridgeMemoryWindow(response);
+		},
 	    });
 	},
 
-- 
2.20.1





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-23 10:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 10:52 [pbs-devel] [PATCH proxmox-backup] ui: tape: reload drive status on user actions Dominik Csapak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal