From 64c075b6c2cbd5df58a8c2b08985627e703d9f39 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Tue, 11 Jan 2022 10:27:08 +0100 Subject: [PATCH] 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 --- www/datastore/Summary.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/www/datastore/Summary.js b/www/datastore/Summary.js index 1616bd57..c3769257 100644 --- a/www/datastore/Summary.js +++ b/www/datastore/Summary.js @@ -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); });