ui: remove cartridge memory panel (show window after butten press instead)

This commit is contained in:
Dietmar Maurer 2021-03-08 12:52:06 +01:00
parent b0156179b9
commit 9bcdade85f
2 changed files with 22 additions and 73 deletions

View File

@ -499,6 +499,7 @@ Ext.define('PBS.Utils', {
columns: [ columns: [
{ {
text: gettext('ID'), text: gettext('ID'),
hidden: true,
dataIndex: 'id', dataIndex: 'id',
width: 60, width: 60,
}, },

View File

@ -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) { init: function(view) {
let me = this; let me = this;
me.mon(me.lookup('statusgrid').getStore().rstore, 'load', 'onLoad'); 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', xtype: 'proxmoxButton',
handler: 'volumeStatistics', handler: 'volumeStatistics',
iconCls: 'fa fa-line-chart', iconCls: 'fa fa-line-chart',
@ -213,6 +223,16 @@ Ext.define('PBS.TapeManagement.DriveStatus', {
disabled: '{!online}', 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', { Ext.define('PBS.TapeManagement.DriveInfoPanel', {
extend: 'Ext.panel.Panel', extend: 'Ext.panel.Panel',
alias: 'widget.pbsDriveInfoPanel', alias: 'widget.pbsDriveInfoPanel',