ui: use grid to display tape drivbe status

This commit is contained in:
Dietmar Maurer 2021-02-23 11:29:43 +01:00
parent e1beaae4a2
commit 35a7ab5778

View File

@ -331,18 +331,45 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
let me = this; let me = this;
let drive = record.data.name; let drive = record.data.name;
me.driveCommand(drive, 'status', function(response) { me.driveCommand(drive, 'status', function(response) {
let lines = []; let list = [];
for (const [key, val] of Object.entries(response.result.data)) { for (let [key, val] of Object.entries(response.result.data)) {
lines.push(`${key}: ${val}`); if (key === 'manufactured') {
val = Proxmox.Utils.render_timestamp(val);
}
if (key === 'bytes-read' || key === 'bytes-written') {
val = Proxmox.Utils.format_size(val);
}
list.push({ key: key, value: val });
} }
let txt = lines.join('<br>'); Ext.create('Ext.window.Window', {
Ext.Msg.show({
title: gettext('Status'), title: gettext('Status'),
message: txt, modal: true,
icon: undefined, width: 600,
}); height: 450,
layout: 'fit',
scrollable: true,
items: [
{
xtype: 'grid',
store: {
data: list,
},
columns: [
{
text: gettext('Property'),
dataIndex: 'key',
width: 120,
},
{
text: gettext('Value'),
dataIndex: 'value',
flex: 1,
},
],
},
],
}).show();
}); });
}, },