From 76c382f229119adf100e28b1d137e203dedfa38d Mon Sep 17 00:00:00 2001 From: Cyril59310 <70776486+cyril59310@users.noreply.github.com> Date: Tue, 6 May 2025 01:33:49 +0200 Subject: [PATCH] Add disable url option in notification Discord (#5817) Co-authored-by: Frank Elsinga --- server/notification-providers/discord.js | 8 ++++---- src/components/notifications/Discord.vue | 10 ++++++++++ src/lang/en.json | 3 ++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/server/notification-providers/discord.js b/server/notification-providers/discord.js index 6a52f8f3e..9ea260410 100644 --- a/server/notification-providers/discord.js +++ b/server/notification-providers/discord.js @@ -46,10 +46,10 @@ class Discord extends NotificationProvider { name: "Service Name", value: monitorJSON["name"], }, - { + ...(!notification.disableUrl ? [{ name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL", value: this.extractAddress(monitorJSON), - }, + }] : []), { name: `Time (${heartbeatJSON["timezone"]})`, value: heartbeatJSON["localDateTime"], @@ -83,10 +83,10 @@ class Discord extends NotificationProvider { name: "Service Name", value: monitorJSON["name"], }, - { + ...(!notification.disableUrl ? [{ name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL", value: this.extractAddress(monitorJSON), - }, + }] : []), { name: `Time (${heartbeatJSON["timezone"]})`, value: heartbeatJSON["localDateTime"], diff --git a/src/components/notifications/Discord.vue b/src/components/notifications/Discord.vue index 5d8334f5f..40d2f204e 100644 --- a/src/components/notifications/Discord.vue +++ b/src/components/notifications/Discord.vue @@ -53,6 +53,13 @@ + +
+
+ + +
+
diff --git a/src/lang/en.json b/src/lang/en.json index 37c023ee4..009d24ee6 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -1093,5 +1093,6 @@ "the smsplanet documentation": "the smsplanet documentation", "Phone numbers": "Phone numbers", "Sender name": "Sender name", - "smsplanetNeedToApproveName": "Needs to be approved in the client panel" + "smsplanetNeedToApproveName": "Needs to be approved in the client panel", + "Disable URL in Notification": "Disable URL in Notification" }