ui: use grid to display tape label information

This commit is contained in:
Dietmar Maurer 2021-02-23 11:13:48 +01:00
parent 00fdaaf12b
commit 965bd58693
1 changed files with 33 additions and 9 deletions

View File

@ -289,18 +289,42 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
let me = this; let me = this;
let drive = record.data.name; let drive = record.data.name;
me.driveCommand(drive, 'read-label', function(response) { me.driveCommand(drive, 'read-label', 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 === 'ctime' || key === 'media-set-ctime') {
val = Proxmox.Utils.render_timestamp(val);
}
list.push({ key: key, value: val });
} }
let txt = lines.join('<br>'); Ext.create('Ext.window.Window', {
Ext.Msg.show({
title: gettext('Label Information'), title: gettext('Label Information'),
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();
}); });
}, },