From 126f00e739728056af00d3dab53cbb56499397ae Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Wed, 14 Jul 2021 11:25:10 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20added=20Gotify=20Support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/notification.js | 16 ++++++++++++++++ src/components/NotificationDialog.vue | 15 +++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/server/notification.js b/server/notification.js index 8e3419527..ffd030cb0 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 44454d688..d08cb5019 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -18,6 +18,7 @@ + @@ -169,6 +170,20 @@ + +