From da8e15a90b2c661bdb551a8115bb6f08f167ad95 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sat, 17 Jul 2021 00:39:36 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20WIP:=20Pushover=20integration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/notification.js | 14 ++++++++++++++ src/components/NotificationDialog.vue | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/server/notification.js b/server/notification.js index 8c25d3048..cce21e7ed 100644 --- a/server/notification.js +++ b/server/notification.js @@ -35,6 +35,20 @@ class Notification { return false; } + } else if (notification.type === "pushover") { + try { + await axios.post("https://api.pushover.net/1/messages.json", { + "message": msg, + "token": notification.pushoverAppToken, + "user": notification.pushoverUserKey, + "title": "Uptime-Kuma" + }) + return true; + } catch (error) { + console.log(error) + return false; + } + } else if (notification.type === "slack") { try { if (heartbeatJSON == null) { diff --git a/src/components/NotificationDialog.vue b/src/components/NotificationDialog.vue index 607805db1..8725c5987 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -20,6 +20,7 @@ + @@ -203,6 +204,24 @@

+ +