From f27811c3946f400f91956351c05f3cff67cf4f6b Mon Sep 17 00:00:00 2001 From: Andrea Mastellone Date: Tue, 10 Jun 2025 19:41:09 -0400 Subject: [PATCH 1/8] ntfy.sh separate down priority (#5893) Co-authored-by: Frank Elsinga --- server/notification-providers/ntfy.js | 4 ++-- src/components/notifications/Ntfy.vue | 16 ++++++++++++++-- src/lang/en.json | 2 ++ 3 files changed, 18 insertions(+), 4 deletions(-) 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)", From 4d51aaa6f8b6b847ce8779e4659718faf5bd6f62 Mon Sep 17 00:00:00 2001 From: Ionys <9364594+Ionys320@users.noreply.github.com> Date: Thu, 12 Jun 2025 00:28:04 +0200 Subject: [PATCH 2/8] Fix invalid maintenance date (#5901) --- server/model/maintenance.js | 10 ++++++++++ src/pages/EditMaintenance.vue | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/server/model/maintenance.js b/server/model/maintenance.js index 7111a18cb..d3314d3f8 100644 --- a/server/model/maintenance.js +++ b/server/model/maintenance.js @@ -158,12 +158,22 @@ class Maintenance extends BeanModel { bean.active = obj.active; if (obj.dateRange[0]) { + const parsedDate = new Date(obj.dateRange[0]); + if (isNaN(parsedDate.getTime()) || parsedDate.getFullYear() > 9999) { + throw new Error("Invalid start date"); + } + bean.start_date = obj.dateRange[0]; } else { bean.start_date = null; } if (obj.dateRange[1]) { + const parsedDate = new Date(obj.dateRange[1]); + if (isNaN(parsedDate.getTime()) || parsedDate.getFullYear() > 9999) { + throw new Error("Invalid end date"); + } + bean.end_date = obj.dateRange[1]; } else { bean.end_date = null; diff --git a/src/pages/EditMaintenance.vue b/src/pages/EditMaintenance.vue index 953fe337c..6341c5bed 100644 --- a/src/pages/EditMaintenance.vue +++ b/src/pages/EditMaintenance.vue @@ -223,12 +223,12 @@
{{ $t("startDateTime") }}
- +
{{ $t("endDateTime") }}
- +
From c7bacbb7fe89ed14855c5237c10f497281432247 Mon Sep 17 00:00:00 2001 From: Ionys <9364594+Ionys320@users.noreply.github.com> Date: Thu, 12 Jun 2025 01:42:25 +0200 Subject: [PATCH 3/8] Ensure maintenance are always runned at the right moment (#5903) Co-authored-by: Frank Elsinga --- server/model/maintenance.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/model/maintenance.js b/server/model/maintenance.js index d3314d3f8..0a70063ff 100644 --- a/server/model/maintenance.js +++ b/server/model/maintenance.js @@ -243,7 +243,7 @@ class Maintenance extends BeanModel { try { this.beanMeta.status = "scheduled"; - let startEvent = (customDuration = 0) => { + let startEvent = async (customDuration = 0) => { log.info("maintenance", "Maintenance id: " + this.id + " is under maintenance now"); this.beanMeta.status = "under-maintenance"; From 8909cd008c87f7ba9c4a70f93f5f7a40e9504683 Mon Sep 17 00:00:00 2001 From: grvwy <147989282+grvwy@users.noreply.github.com> Date: Thu, 12 Jun 2025 03:52:35 +0200 Subject: [PATCH 4/8] feat: add multiple tags in bulk for a monitor (#5846) Co-authored-by: Frank Elsinga --- server/model/status_page.js | 4 +- src/components/TagsManager.vue | 353 +++++++++++++++++++++-------- src/lang/en.json | 10 +- test/e2e/specs/status-page.spec.js | 34 ++- 4 files changed, 296 insertions(+), 105 deletions(-) diff --git a/server/model/status_page.js b/server/model/status_page.js index 38f548ebb..2f3511ec5 100644 --- a/server/model/status_page.js +++ b/server/model/status_page.js @@ -120,8 +120,8 @@ class StatusPage extends BeanModel { const head = $("head"); - if (statusPage.googleAnalyticsTagId) { - let escapedGoogleAnalyticsScript = googleAnalytics.getGoogleAnalyticsScript(statusPage.googleAnalyticsTagId); + if (statusPage.google_analytics_tag_id) { + let escapedGoogleAnalyticsScript = googleAnalytics.getGoogleAnalyticsScript(statusPage.google_analytics_tag_id); head.append($(escapedGoogleAnalyticsScript)); } diff --git a/src/components/TagsManager.vue b/src/components/TagsManager.vue index aa8f93a83..e7e370a4c 100644 --- a/src/components/TagsManager.vue +++ b/src/components/TagsManager.vue @@ -4,7 +4,7 @@
@@ -20,10 +20,20 @@ {{ $t("Add") }}
-