dashboard: properly remove charts on widget close action

This commit is contained in:
Stephan de Wit 2024-05-15 13:23:02 +02:00
parent 83fc436065
commit f075d2d3db
4 changed files with 26 additions and 0 deletions

View File

@ -248,4 +248,14 @@ export default class Disk extends BaseWidget {
}
}
onWidgetClose() {
if (this.simple_chart !== null) {
this.simple_chart.destroy();
}
if (this.detailed_chart !== null) {
this.detailed_chart.destroy();
}
}
}

View File

@ -288,6 +288,10 @@ export default class Firewall extends BaseTableWidget {
if (this.eventSource !== null) {
this.eventSource.close();
}
if (this.chart !== null) {
this.chart.destroy();
}
}
onWidgetResize(elem, width, height) {

View File

@ -185,4 +185,10 @@ export default class InterfaceStatistics extends BaseWidget {
return true;
}
onWidgetClose() {
if (this.chart !== null) {
this.chart.destroy();
}
}
}

View File

@ -129,4 +129,10 @@ export default class Memory extends BaseWidget {
}
});
}
onWidgetClose() {
if (this.chart !== null) {
this.chart.destroy();
}
}
}