From d0a0bad9d6be80ddace99dbe307bbfec04f03d1f Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Mon, 8 Mar 2021 10:06:07 +0100 Subject: [PATCH] ui: tape/Drive{Config, Status} move actions to status panel so that the 'DriveConfig' panel is purely for configuration Signed-off-by: Dominik Csapak --- www/tape/DriveConfig.js | 55 ----------------------------------------- www/tape/DriveStatus.js | 42 +++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 55 deletions(-) diff --git a/www/tape/DriveConfig.js b/www/tape/DriveConfig.js index de6a0525..763f8e55 100644 --- a/www/tape/DriveConfig.js +++ b/www/tape/DriveConfig.js @@ -55,34 +55,6 @@ Ext.define('PBS.TapeManagement.DrivePanel', { }); }, - readLabel: function(view, rI, cI, button, el, record) { - let me = this; - let drive = record.data.name; - - PBS.Utils.driveCommand(drive, 'read-label', { - waitMsgTarget: me.getView(), - success: PBS.Utils.showMediaLabelWindow, - }); - }, - - volumeStatistics: function(view, rI, cI, button, el, record) { - let me = this; - let drive = record.data.name; - PBS.Utils.driveCommand(drive, 'volume-statistics', { - waitMsgTarget: me.getView(), - success: PBS.Utils.showVolumeStatisticsWindow, - }); - }, - - cartridgeMemory: function(view, rI, cI, button, el, record) { - let me = this; - let drive = record.data.name; - PBS.Utils.driveCommand(drive, 'cartridge-memory', { - waitMsgTarget: me.getView(), - success: PBS.Utils.showCartridgeMemoryWindow, - }); - }, - reload: function() { this.getView().getStore().rstore.load(); }, @@ -193,33 +165,6 @@ Ext.define('PBS.TapeManagement.DrivePanel', { return record.data.changer ? value : ''; }, }, - { - text: gettext('Actions'), - width: 140, - xtype: 'actioncolumn', - items: [ - { - iconCls: 'fa fa-hdd-o', - handler: 'cartridgeMemory', - tooltip: gettext('Cartridge Memory'), - }, - { - iconCls: 'fa fa-line-chart', - handler: 'volumeStatistics', - tooltip: gettext('Volume Statistics'), - }, - { - iconCls: 'fa fa-tag', - handler: 'readLabel', - tooltip: gettext('Read Label'), - }, - { - iconCls: 'fa fa-info-circle', - handler: 'status', - tooltip: gettext('Status'), - }, - ], - }, ], }); diff --git a/www/tape/DriveStatus.js b/www/tape/DriveStatus.js index ec1b9fb9..284eb975 100644 --- a/www/tape/DriveStatus.js +++ b/www/tape/DriveStatus.js @@ -120,6 +120,27 @@ Ext.define('PBS.TapeManagement.DriveStatus', { }); }, + readLabel: function() { + let me = this; + let view = me.getView(); + let drive = view.drive; + + PBS.Utils.driveCommand(drive, 'read-label', { + waitMsgTarget: view, + success: PBS.Utils.showMediaLabelWindow, + }); + }, + + volumeStatistics: function() { + let me = this; + let view = me.getView(); + let drive = view.drive; + PBS.Utils.driveCommand(drive, 'volume-statistics', { + waitMsgTarget: view, + success: PBS.Utils.showVolumeStatisticsWindow, + }); + }, + init: function(view) { let me = this; me.mon(me.lookup('statusgrid').getStore().rstore, 'load', 'onLoad'); @@ -172,6 +193,27 @@ Ext.define('PBS.TapeManagement.DriveStatus', { disabled: '{!online}', }, }, + { + text: gettext('Read Label'), + xtype: 'proxmoxButton', + handler: 'readLabel', + iconCls: 'fa fa-tag', + disabled: true, + bind: { + disabled: '{!online}', + }, + }, + { + text: gettext('Show Volume Statistics'), + xtype: 'proxmoxButton', + handler: 'volumeStatistics', + iconCls: 'fa fa-line-chart', + disabled: true, + bind: { + disabled: '{!online}', + }, + }, + ], items: [