ui: tape: reload drive status on user actions
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>
This commit is contained in:
parent
e045d154e9
commit
69e5ba29c4
|
@ -33,6 +33,10 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
|
||||||
controller: {
|
controller: {
|
||||||
xclass: 'Ext.app.ViewController',
|
xclass: 'Ext.app.ViewController',
|
||||||
|
|
||||||
|
reloadTapeStore: function() {
|
||||||
|
Ext.ComponentQuery.query('navigationtree')[0].reloadTapeStore();
|
||||||
|
},
|
||||||
|
|
||||||
reload: function() {
|
reload: function() {
|
||||||
let me = this;
|
let me = this;
|
||||||
me.lookup('statusgrid').rstore.load();
|
me.lookup('statusgrid').rstore.load();
|
||||||
|
@ -46,6 +50,7 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
|
||||||
vm.set('online', online);
|
vm.set('online', online);
|
||||||
let title = online ? gettext('Status') : gettext('Status (No Tape loaded)');
|
let title = online ? gettext('Status') : gettext('Status (No Tape loaded)');
|
||||||
statusgrid.setTitle(title);
|
statusgrid.setTitle(title);
|
||||||
|
Ext.ComponentQuery.query('navigationtree')[0].reloadTapeStore();
|
||||||
},
|
},
|
||||||
|
|
||||||
onStateLoad: function(store) {
|
onStateLoad: function(store) {
|
||||||
|
@ -79,6 +84,11 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
|
||||||
let me = this;
|
let me = this;
|
||||||
Ext.create('PBS.TapeManagement.LabelMediaWindow', {
|
Ext.create('PBS.TapeManagement.LabelMediaWindow', {
|
||||||
driveid: me.getView().drive,
|
driveid: me.getView().drive,
|
||||||
|
apiCallDone: function(success) {
|
||||||
|
if (success) {
|
||||||
|
me.reloadTapeStore();
|
||||||
|
}
|
||||||
|
},
|
||||||
}).show();
|
}).show();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -90,6 +100,7 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
|
||||||
waitMsgTarget: view,
|
waitMsgTarget: view,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
|
me.reloadTapeStore();
|
||||||
Ext.create('Proxmox.window.TaskProgress', {
|
Ext.create('Proxmox.window.TaskProgress', {
|
||||||
upid: response.result.data,
|
upid: response.result.data,
|
||||||
taskDone: function() {
|
taskDone: function() {
|
||||||
|
@ -108,6 +119,7 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
|
||||||
waitMsgTarget: view,
|
waitMsgTarget: view,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
|
me.reloadTapeStore();
|
||||||
Ext.create('Proxmox.window.TaskProgress', {
|
Ext.create('Proxmox.window.TaskProgress', {
|
||||||
upid: response.result.data,
|
upid: response.result.data,
|
||||||
taskDone: function() {
|
taskDone: function() {
|
||||||
|
@ -126,6 +138,7 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
|
||||||
waitMsgTarget: view,
|
waitMsgTarget: view,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
|
me.reloadTapeStore();
|
||||||
Ext.create('Proxmox.window.TaskViewer', {
|
Ext.create('Proxmox.window.TaskViewer', {
|
||||||
upid: response.result.data,
|
upid: response.result.data,
|
||||||
taskDone: function() {
|
taskDone: function() {
|
||||||
|
@ -143,7 +156,10 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
|
||||||
|
|
||||||
PBS.Utils.driveCommand(drive, 'read-label', {
|
PBS.Utils.driveCommand(drive, 'read-label', {
|
||||||
waitMsgTarget: view,
|
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;
|
let drive = view.drive;
|
||||||
PBS.Utils.driveCommand(drive, 'volume-statistics', {
|
PBS.Utils.driveCommand(drive, 'volume-statistics', {
|
||||||
waitMsgTarget: view,
|
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;
|
let drive = view.drive;
|
||||||
PBS.Utils.driveCommand(drive, 'cartridge-memory', {
|
PBS.Utils.driveCommand(drive, 'cartridge-memory', {
|
||||||
waitMsgTarget: me.getView(),
|
waitMsgTarget: me.getView(),
|
||||||
success: PBS.Utils.showCartridgeMemoryWindow,
|
success: function(response) {
|
||||||
|
me.reloadTapeStore();
|
||||||
|
PBS.Utils.showCartridgeMemoryWindow(response);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue