diff --git a/server/notification-providers/techulus-push.js b/server/notification-providers/techulus-push.js index 230897f3ca..bf688b194d 100644 --- a/server/notification-providers/techulus-push.js +++ b/server/notification-providers/techulus-push.js @@ -10,11 +10,22 @@ class TechulusPush extends NotificationProvider { async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { const okMsg = "Sent Successfully."; + let data = { + "title": notification?.pushTitle?.length ? notification.pushTitle : "Uptime-Kuma", + "body": msg, + "timeSensitive": notification.pushTimeSensitive ?? true, + }; + + if (notification.pushChannel) { + data.channel = notification.pushChannel; + } + + if (notification.pushSound) { + data.sound = notification.pushSound; + } + try { - await axios.post(`https://push.techulus.com/api/v1/notify/${notification.pushAPIKey}`, { - "title": "Uptime-Kuma", - "body": msg, - }); + await axios.post(`https://push.techulus.com/api/v1/notify/${notification.pushAPIKey}`, data); return okMsg; } catch (error) { this.throwGeneralAxiosError(error); diff --git a/src/components/notifications/TechulusPush.vue b/src/components/notifications/TechulusPush.vue index bece17e273..bb2c27ad85 100644 --- a/src/components/notifications/TechulusPush.vue +++ b/src/components/notifications/TechulusPush.vue @@ -4,6 +4,53 @@ +
+ + +
+ +
+ + +
+ {{ $t("Alphanumerical string and hyphens only") }} +
+
+ +
+ + +
+ {{ $t("Custom sound to override default notification sound") }} +
+
+ +
+
+ + +
+
+ {{ $t("Time sensitive notifications will be delivered immediately, even if the device is in do not disturb mode.") }} +
+
+ https://docs.push.techulus.com @@ -16,5 +63,19 @@ export default { components: { HiddenInput, }, + mounted() { + if (typeof this.$parent.notification.pushTitle === "undefined") { + this.$parent.notification.pushTitle = "Uptime-Kuma"; + } + if (typeof this.$parent.notification.pushChannel === "undefined") { + this.$parent.notification.pushChannel = "uptime-kuma"; + } + if (typeof this.$parent.notification.pushSound === "undefined") { + this.$parent.notification.pushSound = "default"; + } + if (typeof this.$parent.notification.pushTimeSensitive === "undefined") { + this.$parent.notification.pushTimeSensitive = true; + } + }, }; diff --git a/src/lang/en.json b/src/lang/en.json index 968a3d9f89..cf0836d985 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -1027,5 +1027,25 @@ "greater than": "greater than", "less than or equal to": "less than or equal to", "greater than or equal to": "greater than or equal to", - "record": "record" + "record": "record", + "Notification Channel": "Notification Channel", + "Sound": "Sound", + "Alphanumerical string and hyphens only": "Alphanumerical string and hyphens only", + "Arcade": "Arcade", + "Correct": "Correct", + "Fail":"Fail", + "Harp":"Harp", + "Reveal":"Reveal", + "Bubble":"Bubble", + "Doorbell":"Doorbell", + "Flute":"Flute", + "Money":"Money", + "Scifi":"Scifi", + "Clear":"Clear", + "Elevator":"Elevator", + "Guitar":"Guitar", + "Pop":"Pop", + "Custom sound to override default notification sound": "Custom sound to override default notification sound", + "Time Sensitive (iOS Only)": "Time Sensitive (iOS Only)", + "Time sensitive notifications will be delivered immediately, even if the device is in do not disturb mode.": "Time sensitive notifications will be delivered immediately, even if the device is in do not disturb mode." }