ui: dashboards statistics: visualize datastores where quering the usage failed

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-05-21 13:21:46 +02:00
parent 64591e731e
commit af39c399bc

View File

@ -2,7 +2,12 @@ Ext.define('pbs-datastore-statistics', {
extend: 'Ext.data.Model',
fields: [
'store', 'total', 'used', 'avail', 'estimated-full-date',
'store',
'total',
'used',
'avail',
'estimated-full-date',
'error',
{
name: 'history',
convert: function(values) {
@ -60,6 +65,15 @@ Ext.define('PBS.DatastoreStatistics', {
text: gettext('Name'),
dataIndex: 'store',
sortable: true,
renderer: (value, metaData, record, rowIndex, colIndex, store) => {
let err = record.get('error');
if (err) {
metaData.tdAttr = `data-qtip="${Ext.htmlEncode(err)}"`;
metaData.tdCls = 'proxmox-invalid-row';
return `${value || ''} <i class="fa fa-fw critical fa-exclamation-circle"><i>`;
}
return value;
},
},
{
text: gettext('Size'),