ui: tape/ChangerStatus: add Inventory column to drives/import-export

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-02-18 09:18:07 +01:00 committed by Dietmar Maurer
parent dea8e2cb54
commit 4094fe5a31

View File

@ -470,6 +470,26 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
Proxmox.Utils.setErrorMask(me.lookup('content'), err);
}
},
renderIsLabeled: function(value, mD, record) {
if (!record.data['label-text']) {
return "";
}
if (record.data['label-text'].startsWith("CLN")) {
return "";
}
if (!value) {
return gettext('Not Labeled');
}
let status = record.data.status;
if (record.data.pool) {
return `${status} (${record.data.pool})`;
}
return status;
},
},
listeners: {
@ -551,26 +571,8 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
{
text: gettext('Inventory'),
dataIndex: 'is-labeled',
renderer: 'renderIsLabeled',
flex: 1,
renderer: function(value, mD, record) {
if (!record.data['label-text']) {
return "";
}
if (record.data['label-text'].startsWith("CLN")) {
return "";
}
if (!value) {
return gettext('Not Labeled');
}
let status = record.data.status;
if (record.data.pool) {
return `${status} (${record.data.pool})`;
}
return status;
},
},
{
text: gettext('Actions'),
@ -626,6 +628,12 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
flex: 1,
renderer: (value) => value || '',
},
{
text: gettext('Inventory'),
dataIndex: 'is-labeled',
renderer: 'renderIsLabeled',
flex: 1,
},
{
text: gettext("Name"),
sortable: true,
@ -716,6 +724,12 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
renderer: (value) => value || '',
flex: 1,
},
{
text: gettext('Inventory'),
dataIndex: 'is-labeled',
renderer: 'renderIsLabeled',
flex: 1,
},
{
text: gettext('Actions'),
xtype: 'actioncolumn',