From 475ac7ab25cbb65b71ad486f53bc9933766dd1b8 Mon Sep 17 00:00:00 2001 From: Aizat Faiz Date: Tue, 27 Aug 2024 10:27:51 +0800 Subject: [PATCH 1/4] Add url to pushover notification --- server/notification-providers/pushover.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/notification-providers/pushover.js b/server/notification-providers/pushover.js index 304aa3519c..17c79bc79f 100644 --- a/server/notification-providers/pushover.js +++ b/server/notification-providers/pushover.js @@ -1,3 +1,6 @@ +const { getMonitorRelativeURL } = require("../../src/util"); +const { setting } = require("../util-server"); + const NotificationProvider = require("./notification-provider"); const axios = require("axios"); @@ -23,6 +26,11 @@ class Pushover extends NotificationProvider { "html": 1, }; + const baseURL = await setting("primaryBaseURL"); + if (baseURL && monitorJSON) { + data["url"] = baseURL + getMonitorRelativeURL(monitorJSON.id); + } + if (notification.pushoverdevice) { data.device = notification.pushoverdevice; } From 5c53c73156fb000cabc9c843cf8f0178538aa8df Mon Sep 17 00:00:00 2001 From: Aizat Faiz Date: Wed, 28 Aug 2024 09:08:13 +0800 Subject: [PATCH 2/4] add field url_title --- server/notification-providers/pushover.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server/notification-providers/pushover.js b/server/notification-providers/pushover.js index 17c79bc79f..8422b64c27 100644 --- a/server/notification-providers/pushover.js +++ b/server/notification-providers/pushover.js @@ -29,6 +29,7 @@ class Pushover extends NotificationProvider { const baseURL = await setting("primaryBaseURL"); if (baseURL && monitorJSON) { data["url"] = baseURL + getMonitorRelativeURL(monitorJSON.id); + data["url_title"] = "Link to Monitor"; } if (notification.pushoverdevice) { From 2607cbb8800f7bcd1301fdaadb137203acbc6123 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Wed, 28 Aug 2024 03:20:26 +0200 Subject: [PATCH 3/4] Update server/notification-providers/pushover.js Co-authored-by: Aizat Faiz --- server/notification-providers/pushover.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server/notification-providers/pushover.js b/server/notification-providers/pushover.js index 8422b64c27..bc2b2be2d3 100644 --- a/server/notification-providers/pushover.js +++ b/server/notification-providers/pushover.js @@ -30,6 +30,7 @@ class Pushover extends NotificationProvider { if (baseURL && monitorJSON) { data["url"] = baseURL + getMonitorRelativeURL(monitorJSON.id); data["url_title"] = "Link to Monitor"; + data["url_title"] = "Link to Monitor"; } if (notification.pushoverdevice) { From 4452f0ec7d6367d60b3744f1f0d3d32e6ddaf11c Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Wed, 28 Aug 2024 03:20:51 +0200 Subject: [PATCH 4/4] Update server/notification-providers/pushover.js --- server/notification-providers/pushover.js | 1 - 1 file changed, 1 deletion(-) diff --git a/server/notification-providers/pushover.js b/server/notification-providers/pushover.js index bc2b2be2d3..8422b64c27 100644 --- a/server/notification-providers/pushover.js +++ b/server/notification-providers/pushover.js @@ -30,7 +30,6 @@ class Pushover extends NotificationProvider { if (baseURL && monitorJSON) { data["url"] = baseURL + getMonitorRelativeURL(monitorJSON.id); data["url_title"] = "Link to Monitor"; - data["url_title"] = "Link to Monitor"; } if (notification.pushoverdevice) {