mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
dashboard: disk widget: be more consistent with labels
This commit is contained in:
parent
189fb51496
commit
fc13a9b34e
@ -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);
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user