diff --git a/server/notification.js b/server/notification.js index 8e341952..ffd030cb 100644 --- a/server/notification.js +++ b/server/notification.js @@ -19,6 +19,22 @@ class Notification { return false; } + } else if (notification.type === "gotify") { + try { + if (notification.gotifyserverurl.endsWith("/")) { + notification.gotifyserverurl = notification.gotifyserverurl.slice(0, -1); + } + await axios.post(`${notification.gotifyserverurl}/message?token=${notification.gotifyapplicationToken}`, { + "message": msg, + "priority": 8, + "title": "Uptime-Kuma" + }) + return true; + } catch (error) { + console.log(error) + return false; + } + } else if (notification.type === "webhook") { try { diff --git a/src/components/NotificationDialog.vue b/src/components/NotificationDialog.vue index 44454d68..d08cb501 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -18,6 +18,7 @@ + @@ -169,6 +170,20 @@ + +