diff --git a/www/Utils.js b/www/Utils.js index 4667efb2..6c8ca5cb 100644 --- a/www/Utils.js +++ b/www/Utils.js @@ -499,6 +499,7 @@ Ext.define('PBS.Utils', { columns: [ { text: gettext('ID'), + hidden: true, dataIndex: 'id', width: 60, }, diff --git a/www/tape/DriveStatus.js b/www/tape/DriveStatus.js index 0aec5031..3b67ce6f 100644 --- a/www/tape/DriveStatus.js +++ b/www/tape/DriveStatus.js @@ -141,6 +141,16 @@ Ext.define('PBS.TapeManagement.DriveStatus', { }); }, + cartridgeMemory: function() { + let me = this; + let view = me.getView(); + let drive = view.drive; + PBS.Utils.driveCommand(drive, 'cartridge-memory', { + waitMsgTarget: me.getView(), + success: PBS.Utils.showCartridgeMemoryWindow, + }); + }, + init: function(view) { let me = this; me.mon(me.lookup('statusgrid').getStore().rstore, 'load', 'onLoad'); @@ -204,7 +214,7 @@ Ext.define('PBS.TapeManagement.DriveStatus', { }, }, { - text: gettext('Show Volume Statistics'), + text: gettext('Volume Statistics'), xtype: 'proxmoxButton', handler: 'volumeStatistics', iconCls: 'fa fa-line-chart', @@ -213,6 +223,16 @@ Ext.define('PBS.TapeManagement.DriveStatus', { disabled: '{!online}', }, }, + { + text: gettext('Cartridge Memory'), + xtype: 'proxmoxButton', + iconCls: 'fa fa-hdd-o', + handler: 'cartridgeMemory', + disabled: true, + bind: { + disabled: '{!online}', + }, + }, ], @@ -243,18 +263,6 @@ Ext.define('PBS.TapeManagement.DriveStatus', { }, ], }, - { - xtype: 'pbsDriveCartridgeMemoryGrid', - flex: 1, - padding: 5, - reference: 'cartridgegrid', - bind: { - disabled: '{!online}', - }, - cbind: { - url: '{cartridgeMemoryUrl}', - }, - }, ], }); @@ -319,66 +327,6 @@ Ext.define('PBS.TapeManagement.DriveStatusGrid', { }, }); -Ext.define('PBS.TapeManagement.CartridgeMemoryGrid', { - extend: 'Ext.grid.Panel', - alias: 'widget.pbsDriveCartridgeMemoryGrid', - - title: gettext('Cartridge Memory'), - - emptyText: gettext('Not Loaded yet'), - viewConfig: { - deferEmptyText: false, - }, - - controller: { - xclass: 'Ext.app.ViewController', - - loadCartridgeMemory: function() { - console.log(this); - this.getView().getStore().load(); - }, - - init: function(view) { - if (!view.url) { - throw "no url given"; - } - - view.getStore().getProxy().setUrl(view.url); - }, - }, - - store: { - proxy: { - type: 'proxmox', - }, - }, - - tbar: [ - { - text: gettext('Reload'), - handler: 'loadCartridgeMemory', - }, - ], - - columns: [ - { - text: gettext('ID'), - dataIndex: 'id', - width: 60, - }, - { - text: gettext('Name'), - dataIndex: 'name', - flex: 2, - }, - { - text: gettext('Value'), - dataIndex: 'value', - flex: 1, - }, - ], -}); - Ext.define('PBS.TapeManagement.DriveInfoPanel', { extend: 'Ext.panel.Panel', alias: 'widget.pbsDriveInfoPanel',