From e34a8e2e4aa2e2b0879e53a7e467d761d470d5d1 Mon Sep 17 00:00:00 2001 From: Philipp Dormann <17651032+philippdormann@users.noreply.github.com> Date: Tue, 3 Aug 2021 17:14:27 +0200 Subject: [PATCH] FEAT: PUSHY Notifier (#154) FEAT: PUSHY Notifier (#154) --- server/notification.js | 18 ++++++++++++++++++ src/components/NotificationDialog.vue | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/server/notification.js b/server/notification.js index 0e963a12..f53b681a 100644 --- a/server/notification.js +++ b/server/notification.js @@ -137,6 +137,24 @@ class Notification { throwGeneralAxiosError(error) } + } else if (notification.type === "pushy") { + try { + await axios.post(`https://api.pushy.me/push?api_key=${notification.pushyAPIKey}`, { + "to": notification.pushyToken, + "data": { + "message": "Uptime-Kuma" + }, + "notification": { + "body": msg, + "badge": 1, + "sound": "ping.aiff" + } + }) + 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 4af1ffa5..4eea85d6 100644 --- a/src/components/NotificationDialog.vue +++ b/src/components/NotificationDialog.vue @@ -21,6 +21,7 @@ + @@ -229,6 +230,23 @@ + +