mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-24 07:14:04 +00:00
Fix: Clear metrics also on stop and edit
This commit is contained in:
parent
f6ef390c76
commit
edd2534a1b
2 changed files with 12 additions and 2 deletions
|
@ -466,11 +466,16 @@ class Monitor extends BeanModel {
|
||||||
stop() {
|
stop() {
|
||||||
clearTimeout(this.heartbeatInterval);
|
clearTimeout(this.heartbeatInterval);
|
||||||
this.isStop = true;
|
this.isStop = true;
|
||||||
|
|
||||||
|
this.prometheus().remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
onDelete() {
|
onDelete() {
|
||||||
let prometheus = new Prometheus(this);
|
this.prometheus().remove();
|
||||||
prometheus.remove();
|
}
|
||||||
|
|
||||||
|
prometheus() {
|
||||||
|
return new Prometheus(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -567,6 +567,11 @@ exports.entryPage = "dashboard";
|
||||||
throw new Error("Permission denied.");
|
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.name = monitor.name;
|
||||||
bean.type = monitor.type;
|
bean.type = monitor.type;
|
||||||
bean.url = monitor.url;
|
bean.url = monitor.url;
|
||||||
|
|
Loading…
Reference in a new issue