Fix: Clear metrics also on stop and edit

pull/1136/head
Nelson Chan 2 years ago
parent f6ef390c76
commit edd2534a1b

@ -466,11 +466,16 @@ class Monitor extends BeanModel {
stop() {
clearTimeout(this.heartbeatInterval);
this.isStop = true;
this.prometheus().remove();
}
onDelete() {
let prometheus = new Prometheus(this);
prometheus.remove();
this.prometheus().remove();
}
prometheus() {
return new Prometheus(this);
}
/**

@ -567,6 +567,11 @@ exports.entryPage = "dashboard";
throw new Error("Permission denied.");
}
// Reset Prometheus labels
if (monitorList[monitor.id] && monitorList[monitor.id].prometheus) {
monitorList[monitor.id].prometheus().remove();
}
bean.name = monitor.name;
bean.type = monitor.type;
bean.url = monitor.url;

Loading…
Cancel
Save