mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 19:15:22 +00:00
dashboard: CPU graph selection consistency
This commit is contained in:
parent
2cd07c3273
commit
f8b0c49b9a
@ -665,7 +665,7 @@ class WidgetManager {
|
||||
buttons: [{
|
||||
label: this.gettext.ok,
|
||||
hotkey: 13,
|
||||
action: (dialog) => {
|
||||
action: async (dialog) => {
|
||||
let values = {};
|
||||
for (const [key, value] of Object.entries(options)) {
|
||||
switch (value.type) {
|
||||
@ -681,7 +681,7 @@ class WidgetManager {
|
||||
}
|
||||
|
||||
widget.setWidgetConfig(values);
|
||||
widget.onWidgetOptionsChanged(values);
|
||||
await widget.onWidgetOptionsChanged(values);
|
||||
$('#save-grid').show();
|
||||
dialog.close();
|
||||
}
|
||||
|
||||
@ -75,9 +75,10 @@ export default class Cpu extends BaseWidget {
|
||||
}
|
||||
}
|
||||
|
||||
onWidgetOptionsChanged(options) {
|
||||
async onWidgetOptionsChanged(options) {
|
||||
this.graphs.filter(x => !options.graphs.includes(x)).forEach(graph => $(`#cpu-${graph}`).hide());
|
||||
this.graphs = options.graphs;
|
||||
const config = await this.getWidgetConfig();
|
||||
this.graphs = config.graphs
|
||||
this.graphs.forEach(graph => $(`#cpu-${graph}`).show());
|
||||
}
|
||||
|
||||
|
||||
@ -235,7 +235,7 @@ export default class Traffic extends BaseWidget {
|
||||
};
|
||||
}
|
||||
|
||||
onWidgetOptionsChanged(options) {
|
||||
async onWidgetOptionsChanged(options) {
|
||||
this.configChanged = true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user