diff --git a/server/notification-providers/pushover.js b/server/notification-providers/pushover.js index 8422b64c2..fdceeaa44 100644 --- a/server/notification-providers/pushover.js +++ b/server/notification-providers/pushover.js @@ -1,5 +1,6 @@ const { getMonitorRelativeURL } = require("../../src/util"); const { setting } = require("../util-server"); +const { UP } = require("../../src/util"); const NotificationProvider = require("./notification-provider"); const axios = require("axios"); @@ -43,15 +44,20 @@ class Pushover extends NotificationProvider { if (heartbeatJSON == null) { await axios.post(url, data); return okMsg; - } else { - data.message += `\nTime (${heartbeatJSON["timezone"]}):${heartbeatJSON["localDateTime"]}`; - await axios.post(url, data); - return okMsg; } + + if (heartbeatJSON.status === UP && notification.pushoversounds_up) { + // default = DOWN => DOWN-sound is also played for non-UP/DOWN notiifcations + data.sound = notification.pushoversounds_up; + } + + data.message += `\nTime (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`; + await axios.post(url, data); + return okMsg; + } catch (error) { this.throwGeneralAxiosError(error); } - } } diff --git a/src/components/notifications/Pushover.vue b/src/components/notifications/Pushover.vue index 7ee0eafb6..e2fecd29f 100644 --- a/src/components/notifications/Pushover.vue +++ b/src/components/notifications/Pushover.vue @@ -16,34 +16,24 @@ - - + + + + + +
*{{ $t("Required") }} @@ -66,5 +56,34 @@ export default { components: { HiddenInput, }, + data() { + return { + soundOptions: [ + "pushover", + "bike", + "bugle", + "cashregister", + "classical", + "cosmic", + "falling", + "gamelan", + "incoming", + "intermission", + "magic", + "mechanical", + "pianobar", + "siren", + "spacealarm", + "tugboat", + "alien", + "climb", + "persistent", + "echo", + "updown", + "vibrate", + "none", + ], + }; + }, };