diff --git a/server/notification-providers/ntfy.js b/server/notification-providers/ntfy.js index ad1d39f8f..e44e7e868 100644 --- a/server/notification-providers/ntfy.js +++ b/server/notification-providers/ntfy.js @@ -41,8 +41,8 @@ class Ntfy extends NotificationProvider { if (heartbeatJSON.status === DOWN) { tags = [ "red_circle" ]; status = "Down"; - // if priority is not 5, increase priority for down alerts - priority = priority === 5 ? priority : priority + 1; + // defaults to max(priority + 1, 5) + priority = notification.ntfyPriorityDown || (priority === 5 ? priority : priority + 1); } else if (heartbeatJSON["status"] === UP) { tags = [ "green_circle" ]; status = "Up"; diff --git a/src/components/notifications/Ntfy.vue b/src/components/notifications/Ntfy.vue index ba94451a2..3de807d1e 100644 --- a/src/components/notifications/Ntfy.vue +++ b/src/components/notifications/Ntfy.vue @@ -13,13 +13,20 @@
+ +
-

+

{{ $t("ntfyPriorityHelptextAllEvents") }}

+ + DOWN + {{ $parent.notification.ntfyPriority }} + {{ $parent.notification.ntfyPriorityDown }} + DOWN - {{ $parent.notification.ntfyPriority + 1 }} + {{ $parent.notification.ntfyPriorityDown }}
@@ -69,6 +76,11 @@ export default { this.$parent.notification.ntfyPriority = 5; } + // Setting down priority if it's undefined + if (typeof this.$parent.notification.ntfyPriorityDown === "undefined") { + this.$parent.notification.ntfyPriorityDown = 5; + } + // Handling notifications that added before 1.22.0 if (typeof this.$parent.notification.ntfyAuthenticationMethod === "undefined") { if (!this.$parent.notification.ntfyusername) { diff --git a/src/lang/en.json b/src/lang/en.json index ef4d92fcb..1ca6ef105 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -841,6 +841,8 @@ "ntfyAuthenticationMethod": "Authentication Method", "ntfyPriorityHelptextAllEvents": "All events are sent with the maximum priority", "ntfyPriorityHelptextAllExceptDown": "All events are sent with this priority, except {0}-events, which have a priority of {1}", + "ntfyPriorityHelptextPriorityHigherThanDown": "Regular priority should be higher than {0} priority. Priority {1} is higher than {0} priority {2}", + "ntfyPriorityDown": "Priority for DOWN-events", "ntfyUsernameAndPassword": "Username and Password", "twilioAccountSID": "Account SID", "twilioApiKey": "Api Key (optional)",