ui: hide rrd chart for io delay if no io_ticks are returned

it makes no sense to show a completely empty graph

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2022-01-11 10:27:08 +01:00 committed by Dietmar Maurer
parent f27b6086b1
commit 64c075b6c2

View File

@ -234,6 +234,8 @@ Ext.define('PBS.DataStoreSummary', {
},
{
xtype: 'proxmoxRRDChart',
itemId: 'ioDelayChart',
hidden: true,
title: gettext('IO Delay (ms)'),
fields: ['io_delay'],
fieldTitles: [gettext('IO Delay')],
@ -288,6 +290,10 @@ Ext.define('PBS.DataStoreSummary', {
},
});
me.mon(me.rrdstore, 'load', function(store, records, success) {
me.down('#ioDelayChart').setVisible(!success || records[0]?.data?.io_ticks !== undefined);
}, undefined, { single: true });
me.query('proxmoxRRDChart').forEach((chart) => {
chart.setStore(me.rrdstore);
});