diff --git a/www/Utils.js b/www/Utils.js index 9861d40f..c531edbb 100644 --- a/www/Utils.js +++ b/www/Utils.js @@ -5,6 +5,8 @@ console.log("Starting Backup Server GUI"); Ext.define('PBS.Utils', { singleton: true, + missingText: gettext('missing'), + updateLoginData: function(data) { Proxmox.Utils.setAuthData(data); }, diff --git a/www/tape/TapeInventory.js b/www/tape/TapeInventory.js index d7c0b93f..508f4a4f 100644 --- a/www/tape/TapeInventory.js +++ b/www/tape/TapeInventory.js @@ -1,9 +1,9 @@ Ext.define('pbs-model-tapes', { extend: 'Ext.data.Model', fields: [ - 'catalog', + { name: 'catalog', type: 'boolean' }, 'ctime', - 'expired', + { name: 'expired', type: 'boolean' }, 'label-text', 'location', 'media-set-ctime', @@ -104,13 +104,13 @@ Ext.define('PBS.TapeManagement.TapeInventory', { reload: function() { this.getView().getStore().load({ - params: { 'update-status': false } + params: { 'update-status': false }, }); }, reload_update_status: function() { this.getView().getStore().load({ - params: { 'update-status': true } + params: { 'update-status': true }, }); }, }, @@ -163,12 +163,21 @@ Ext.define('PBS.TapeManagement.TapeInventory', { } else { 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: [ { text: gettext('Label'), @@ -188,7 +197,14 @@ Ext.define('PBS.TapeManagement.TapeInventory', { } else { return value; } - } + }, + }, + { + text: gettext('Catalog'), + dataIndex: 'catalog', + renderer: function(value, metaData, record) { + return value ? Proxmox.Utils.yesText : PBS.Utils.missingText; + }, }, { text: gettext('Location'),