From fc13a9b34ebee05476cc76bf33f8f4805496e714 Mon Sep 17 00:00:00 2001 From: Stephan de Wit Date: Mon, 13 May 2024 15:06:17 +0200 Subject: [PATCH] dashboard: disk widget: be more consistent with labels --- src/opnsense/www/js/widgets/Disk.js | 8 +++++++- src/opnsense/www/js/widgets/Firewall.js | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/opnsense/www/js/widgets/Disk.js b/src/opnsense/www/js/widgets/Disk.js index 9f1b6214f..28bcf61a1 100644 --- a/src/opnsense/www/js/widgets/Disk.js +++ b/src/opnsense/www/js/widgets/Disk.js @@ -145,6 +145,7 @@ export default class Disk extends BaseWidget { type: 'bar', data: { labels: [], + types: [], datasets: [ { // used @@ -189,6 +190,10 @@ export default class Disk extends BaseWidget { }, tooltip: { callbacks: { + title: (tooltipItem) => { + let type = this.detailed_chart.config.data.types[tooltipItem[0].dataIndex]; + return `${tooltipItem[0].label} [${type}]`; + }, label: (tooltipItem) => { return `${tooltipItem.dataset.descr}: ${this._formatBytes(tooltipItem.raw)}`; } @@ -221,7 +226,8 @@ export default class Disk extends BaseWidget { totals.push(total); if (init) { - this.detailed_chart.config.data.labels.push(device.device); + this.detailed_chart.config.data.types.push(device.type); + this.detailed_chart.config.data.labels.push(device.mountpoint); } this.detailed_chart.config.data.datasets[0].data.push(used); this.detailed_chart.config.data.datasets[1].data.push(free); diff --git a/src/opnsense/www/js/widgets/Firewall.js b/src/opnsense/www/js/widgets/Firewall.js index f34b4573c..f2ac19e75 100644 --- a/src/opnsense/www/js/widgets/Firewall.js +++ b/src/opnsense/www/js/widgets/Firewall.js @@ -154,7 +154,6 @@ export default class Firewall extends BaseTableWidget { this._updateChart(data.rid, this.counters[data.rid].label, this.counters[data.rid].count); if (Object.keys(this.counters).length < this.rotation) { - console.log('updating grid'); this.config.callbacks.updateGrid(); } }