ui: TapeInventory - show catalog status

Clearly mark tapes without valid catalog.
This commit is contained in:
Dietmar Maurer 2021-02-26 07:48:13 +01:00
parent 917230e4f8
commit ed24142767
2 changed files with 27 additions and 9 deletions

View File

@ -5,6 +5,8 @@ console.log("Starting Backup Server GUI");
Ext.define('PBS.Utils', { Ext.define('PBS.Utils', {
singleton: true, singleton: true,
missingText: gettext('missing'),
updateLoginData: function(data) { updateLoginData: function(data) {
Proxmox.Utils.setAuthData(data); Proxmox.Utils.setAuthData(data);
}, },

View File

@ -1,9 +1,9 @@
Ext.define('pbs-model-tapes', { Ext.define('pbs-model-tapes', {
extend: 'Ext.data.Model', extend: 'Ext.data.Model',
fields: [ fields: [
'catalog', { name: 'catalog', type: 'boolean' },
'ctime', 'ctime',
'expired', { name: 'expired', type: 'boolean' },
'label-text', 'label-text',
'location', 'location',
'media-set-ctime', 'media-set-ctime',
@ -104,13 +104,13 @@ Ext.define('PBS.TapeManagement.TapeInventory', {
reload: function() { reload: function() {
this.getView().getStore().load({ this.getView().getStore().load({
params: { 'update-status': false } params: { 'update-status': false },
}); });
}, },
reload_update_status: function() { reload_update_status: function() {
this.getView().getStore().load({ this.getView().getStore().load({
params: { 'update-status': true } params: { 'update-status': true },
}); });
}, },
}, },
@ -163,11 +163,20 @@ Ext.define('PBS.TapeManagement.TapeInventory', {
} else { } else {
return pool; return pool;
} }
} },
} },
]
}
], ],
},
],
viewConfig: {
stripeRows: false, // does not work with getRowClass()
getRowClass: function(record, index) {
let catalog = record.get('catalog');
return catalog ? '' : "proxmox-invalid-row";
},
},
columns: [ columns: [
{ {
@ -188,7 +197,14 @@ Ext.define('PBS.TapeManagement.TapeInventory', {
} else { } else {
return value; return value;
} }
} },
},
{
text: gettext('Catalog'),
dataIndex: 'catalog',
renderer: function(value, metaData, record) {
return value ? Proxmox.Utils.yesText : PBS.Utils.missingText;
},
}, },
{ {
text: gettext('Location'), text: gettext('Location'),