dashboard statistics: prepare a more graceful error handling in datastore-usage

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-05-21 12:20:39 +02:00
parent 64e0786aa9
commit 5658504b90
1 changed files with 6 additions and 3 deletions

View File

@ -6,6 +6,9 @@ Ext.define('pbs-datastore-statistics', {
{
name: 'history',
convert: function(values) {
if (!values) {
return [];
}
let last = null;
return values.map(v => {
if (v !== undefined && v !== null) {
@ -63,21 +66,21 @@ Ext.define('PBS.DatastoreStatistics', {
dataIndex: 'total',
sortable: true,
width: 90,
renderer: Proxmox.Utils.format_size,
renderer: v => v === undefined || v < 0 ? '-' : Proxmox.Utils.format_size(v),
},
{
text: gettext('Used'),
dataIndex: 'used',
sortable: true,
width: 90,
renderer: Proxmox.Utils.format_size,
renderer: v => v === undefined || v < 0 ? '-' : Proxmox.Utils.format_size(v),
},
{
text: gettext('Available'),
dataIndex: 'avail',
sortable: true,
width: 90,
renderer: Proxmox.Utils.format_size,
renderer: v => v === undefined || v < 0 ? '-' : Proxmox.Utils.format_size(v),
},
{
text: gettext('Usage %'),