[pbs-devel] [PATCH proxmox-backup 2/2] ui: hide rrd chard for io delay if no io_ticks are returned

Dominik Csapak d.csapak at proxmox.com
Tue Jan 11 10:27:08 CET 2022


it makes no sense to show a completely empty graph

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 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);
 	});
-- 
2.30.2






More information about the pbs-devel mailing list