mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-05-20 06:02:33 +02:00
Update SpugPush notification payload (#5816)
This commit is contained in:
parent
6a5011ad34
commit
32d92eccfa
1 changed files with 11 additions and 11 deletions
|
@ -13,19 +13,19 @@ class SpugPush extends NotificationProvider {
|
|||
let okMsg = "Sent Successfully.";
|
||||
try {
|
||||
let formData = {
|
||||
msg
|
||||
title: "Uptime Kuma Message",
|
||||
content: msg
|
||||
};
|
||||
const apiUrl = `https://push.spug.cc/send/${notification.templateKey}`;
|
||||
if (heartbeatJSON == null) {
|
||||
formData.title = "Uptime Kuma Message";
|
||||
} else if (heartbeatJSON["status"] === UP) {
|
||||
formData.title = `UptimeKuma 「${monitorJSON["name"]}」 is Up`;
|
||||
formData.msg = `[✅ Up] ${heartbeatJSON["msg"]}`;
|
||||
} else if (heartbeatJSON["status"] === DOWN) {
|
||||
formData.title = `UptimeKuma 「${monitorJSON["name"]}」 is Down`;
|
||||
formData.msg = `[🔴 Down] ${heartbeatJSON["msg"]}`;
|
||||
if (heartbeatJSON) {
|
||||
if (heartbeatJSON["status"] === UP) {
|
||||
formData.title = `UptimeKuma 「${monitorJSON["name"]}」 is Up`;
|
||||
formData.content = `[✅ Up] ${heartbeatJSON["msg"]}`;
|
||||
} else if (heartbeatJSON["status"] === DOWN) {
|
||||
formData.title = `UptimeKuma 「${monitorJSON["name"]}」 is Down`;
|
||||
formData.content = `[🔴 Down] ${heartbeatJSON["msg"]}`;
|
||||
}
|
||||
}
|
||||
|
||||
const apiUrl = `https://push.spug.cc/send/${notification.templateKey}`;
|
||||
await axios.post(apiUrl, formData);
|
||||
return okMsg;
|
||||
} catch (error) {
|
||||
|
|
Loading…
Add table
Reference in a new issue