From 8c3ec93af1b0b2f8f9bf9506f72a6734c58e354a Mon Sep 17 00:00:00 2001
From: Philipp Dormann
Date: Sat, 17 Jul 2021 00:55:30 +0200
Subject: [PATCH] add Pushy notification service
---
server/notification.js | 19 +++++++++++++++++++
src/components/NotificationDialog.vue | 18 ++++++++++++++++++
2 files changed, 37 insertions(+)
diff --git a/server/notification.js b/server/notification.js
index cce21e7ed..db4aec1f6 100644
--- a/server/notification.js
+++ b/server/notification.js
@@ -49,6 +49,25 @@ class Notification {
return false;
}
+ } 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 5dc4b4c89..d6aed1f4b 100644
--- a/src/components/NotificationDialog.vue
+++ b/src/components/NotificationDialog.vue
@@ -21,6 +21,7 @@
+
@@ -221,6 +222,23 @@
More info on: https://pushover.net/api
+
+
+
+
+
+
+
+
+
+ More info on: https://pushy.me/docs/api/send-notifications
+
+