From 20b69acde21a44c202215963a49912f395e84429 Mon Sep 17 00:00:00 2001 From: Philip Klostermann Date: Tue, 23 Jan 2024 10:10:31 -0500 Subject: [PATCH 1/2] [Ntfy] Only include action link if monitor url is defined #3274 --- server/notification-providers/ntfy.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/server/notification-providers/ntfy.js b/server/notification-providers/ntfy.js index 86fc0e08..b51b0f23 100644 --- a/server/notification-providers/ntfy.js +++ b/server/notification-providers/ntfy.js @@ -54,14 +54,17 @@ class Ntfy extends NotificationProvider { "priority": priority, "title": monitorJSON.name + " " + status + " [Uptime-Kuma]", "tags": tags, - "actions": [ + }; + + if (monitorJSON.url) { + data.actions = [ { "action": "view", "label": "Open " + monitorJSON.name, "url": monitorJSON.url, - } - ] - }; + }, + ]; + } if (notification.ntfyIcon) { data.icon = notification.ntfyIcon; From 95125cc4172c2d196f99748fc3dac06a9285bc75 Mon Sep 17 00:00:00 2001 From: Philip Klostermann Date: Tue, 23 Jan 2024 11:16:10 -0500 Subject: [PATCH 2/2] [Ntfy] don't include url action with defaut URL value --- server/notification-providers/ntfy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/notification-providers/ntfy.js b/server/notification-providers/ntfy.js index b51b0f23..12c9258b 100644 --- a/server/notification-providers/ntfy.js +++ b/server/notification-providers/ntfy.js @@ -56,7 +56,7 @@ class Ntfy extends NotificationProvider { "tags": tags, }; - if (monitorJSON.url) { + if (monitorJSON.url && monitorJSON.url !== "https://") { data.actions = [ { "action": "view",