|
|
@ -19,26 +19,26 @@ class Pushbullet extends NotificationProvider {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
if (heartbeatJSON == null) {
|
|
|
|
if (heartbeatJSON == null) {
|
|
|
|
let testdata = {
|
|
|
|
let data = {
|
|
|
|
"type": "note",
|
|
|
|
"type": "note",
|
|
|
|
"title": "Uptime Kuma Alert",
|
|
|
|
"title": "Uptime Kuma Alert",
|
|
|
|
"body": "Testing Successful.",
|
|
|
|
"body": msg,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
await axios.post(pushbulletUrl, testdata, config);
|
|
|
|
await axios.post(pushbulletUrl, data, config);
|
|
|
|
} else if (heartbeatJSON["status"] === DOWN) {
|
|
|
|
} else if (heartbeatJSON["status"] === DOWN) {
|
|
|
|
let downdata = {
|
|
|
|
let downData = {
|
|
|
|
"type": "note",
|
|
|
|
"type": "note",
|
|
|
|
"title": "UptimeKuma Alert: " + monitorJSON["name"],
|
|
|
|
"title": "UptimeKuma Alert: " + monitorJSON["name"],
|
|
|
|
"body": "[🔴 Down] " + heartbeatJSON["msg"] + "\nTime (UTC): " + heartbeatJSON["time"],
|
|
|
|
"body": "[🔴 Down] " + heartbeatJSON["msg"] + "\nTime (UTC): " + heartbeatJSON["time"],
|
|
|
|
};
|
|
|
|
};
|
|
|
|
await axios.post(pushbulletUrl, downdata, config);
|
|
|
|
await axios.post(pushbulletUrl, downData, config);
|
|
|
|
} else if (heartbeatJSON["status"] === UP) {
|
|
|
|
} else if (heartbeatJSON["status"] === UP) {
|
|
|
|
let updata = {
|
|
|
|
let upData = {
|
|
|
|
"type": "note",
|
|
|
|
"type": "note",
|
|
|
|
"title": "UptimeKuma Alert: " + monitorJSON["name"],
|
|
|
|
"title": "UptimeKuma Alert: " + monitorJSON["name"],
|
|
|
|
"body": "[✅ Up] " + heartbeatJSON["msg"] + "\nTime (UTC): " + heartbeatJSON["time"],
|
|
|
|
"body": "[✅ Up] " + heartbeatJSON["msg"] + "\nTime (UTC): " + heartbeatJSON["time"],
|
|
|
|
};
|
|
|
|
};
|
|
|
|
await axios.post(pushbulletUrl, updata, config);
|
|
|
|
await axios.post(pushbulletUrl, upData, config);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return okMsg;
|
|
|
|
return okMsg;
|
|
|
|
} catch (error) {
|
|
|
|
} catch (error) {
|
|
|
|