mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-27 03:50:12 +03:00
do not assume missing heartbeat is a test
This commit is contained in:
parent
09d249ca36
commit
71dd5e2369
1 changed files with 6 additions and 6 deletions
|
@ -16,18 +16,18 @@ class HeiiOnCall extends NotificationProvider {
|
|||
// Payload to Heii On-Call is the entire heartbat JSON
|
||||
const payload = heartbeatJSON ? heartbeatJSON : {};
|
||||
|
||||
if (!heartbeatJSON) {
|
||||
// Test button was clicked on Notification Setup, trigger the alert as a test
|
||||
payload["message"] = "Testing UptimeKuma Trigger";
|
||||
return this.postNotification(notification, "alert", payload);
|
||||
}
|
||||
|
||||
// If we can, add url back to mintor to payload
|
||||
const baseURL = await setting("primaryBaseURL");
|
||||
if (baseURL && monitorJSON) {
|
||||
payload["url"] = baseURL + getMonitorRelativeURL(monitorJSON.id);
|
||||
}
|
||||
|
||||
if (!heartbeatJSON) {
|
||||
// No heartbeatJSON. Could be test button, but not necessarily. Just pull msg into payload.
|
||||
payload["msg"] = msg;
|
||||
return this.postNotification(notification, "alert", payload);
|
||||
}
|
||||
|
||||
if (heartbeatJSON.status === DOWN) {
|
||||
// Monitor is DOWN, alert on Heii On-Call
|
||||
return this.postNotification(notification, "alert", payload);
|
||||
|
|
Loading…
Reference in a new issue