From 126d6cd912cbae2602d643916773e1fd064c4567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=AF=E8=A7=82=E7=94=9F=E6=B4=BB?= Date: Sat, 27 Apr 2024 23:16:39 +0800 Subject: [PATCH] Add the ability to notify `@everyone` in DingTalk notifications (#4718) Co-authored-by: Frank Elsinga --- server/notification-providers/dingding.js | 3 +++ src/components/notifications/DingDing.vue | 25 +++++++++++++++++++++-- src/lang/en.json | 3 +++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/server/notification-providers/dingding.js b/server/notification-providers/dingding.js index 3ad36d547..5d8cb8948 100644 --- a/server/notification-providers/dingding.js +++ b/server/notification-providers/dingding.js @@ -19,6 +19,9 @@ class DingDing extends NotificationProvider { markdown: { title: `[${this.statusToString(heartbeatJSON["status"])}] ${monitorJSON["name"]}`, text: `## [${this.statusToString(heartbeatJSON["status"])}] ${monitorJSON["name"]} \n> ${heartbeatJSON["msg"]}\n> Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`, + }, + "at": { + "isAtAll": notification.mentioning === "everyone" } }; if (await this.sendToDingDing(notification, params)) { diff --git a/src/components/notifications/DingDing.vue b/src/components/notifications/DingDing.vue index 79d8d837d..710677fd7 100644 --- a/src/components/notifications/DingDing.vue +++ b/src/components/notifications/DingDing.vue @@ -2,9 +2,10 @@
- +
+
- +

{{ $t("For safety, must use secret key") }}

@@ -13,4 +14,24 @@
+
+ + +
+ + diff --git a/src/lang/en.json b/src/lang/en.json index 726186f55..696b0ca67 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -667,6 +667,9 @@ "WebHookUrl": "WebHookUrl", "SecretKey": "SecretKey", "For safety, must use secret key": "For safety, must use secret key", + "Mentioning": "Mentioning", + "Don't mention people": "Don't mention people", + "Mention group": "Mention {group}", "Device Token": "Device Token", "Platform": "Platform", "Huawei": "Huawei",