|
|
@ -7,15 +7,18 @@ class Ntfy extends NotificationProvider {
|
|
|
|
|
|
|
|
|
|
|
|
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
|
|
|
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
|
|
|
let okMsg = "Sent Successfully.";
|
|
|
|
let okMsg = "Sent Successfully.";
|
|
|
|
try {
|
|
|
|
var ntfyparams = {
|
|
|
|
await axios.post(`${notification.ntfyserverurl}`, {
|
|
|
|
|
|
|
|
"topic": notification.ntfytopic,
|
|
|
|
"topic": notification.ntfytopic,
|
|
|
|
"message": msg,
|
|
|
|
"message": msg,
|
|
|
|
"priority": notification.ntfyPriority || 4,
|
|
|
|
"priority": notification.ntfyPriority || 4,
|
|
|
|
"title": "Uptime-Kuma",
|
|
|
|
"title": "Uptime-Kuma",
|
|
|
|
"icon": notification.ntfyIcon || "",
|
|
|
|
};
|
|
|
|
});
|
|
|
|
if (notification.ntfyIcon) {
|
|
|
|
|
|
|
|
ntfyparams.icon = notification.ntfyIcon;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
await axios.post(`${notification.ntfyserverurl}`, ntfyparams);
|
|
|
|
return okMsg;
|
|
|
|
return okMsg;
|
|
|
|
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
} catch (error) {
|
|
|
|