mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-05-20 14:02:34 +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.";
|
let okMsg = "Sent Successfully.";
|
||||||
try {
|
try {
|
||||||
let formData = {
|
let formData = {
|
||||||
msg
|
title: "Uptime Kuma Message",
|
||||||
|
content: msg
|
||||||
};
|
};
|
||||||
const apiUrl = `https://push.spug.cc/send/${notification.templateKey}`;
|
if (heartbeatJSON) {
|
||||||
if (heartbeatJSON == null) {
|
if (heartbeatJSON["status"] === UP) {
|
||||||
formData.title = "Uptime Kuma Message";
|
formData.title = `UptimeKuma 「${monitorJSON["name"]}」 is Up`;
|
||||||
} else if (heartbeatJSON["status"] === UP) {
|
formData.content = `[✅ Up] ${heartbeatJSON["msg"]}`;
|
||||||
formData.title = `UptimeKuma 「${monitorJSON["name"]}」 is Up`;
|
} else if (heartbeatJSON["status"] === DOWN) {
|
||||||
formData.msg = `[✅ Up] ${heartbeatJSON["msg"]}`;
|
formData.title = `UptimeKuma 「${monitorJSON["name"]}」 is Down`;
|
||||||
} else if (heartbeatJSON["status"] === DOWN) {
|
formData.content = `[🔴 Down] ${heartbeatJSON["msg"]}`;
|
||||||
formData.title = `UptimeKuma 「${monitorJSON["name"]}」 is Down`;
|
}
|
||||||
formData.msg = `[🔴 Down] ${heartbeatJSON["msg"]}`;
|
|
||||||
}
|
}
|
||||||
|
const apiUrl = `https://push.spug.cc/send/${notification.templateKey}`;
|
||||||
await axios.post(apiUrl, formData);
|
await axios.post(apiUrl, formData);
|
||||||
return okMsg;
|
return okMsg;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue