From da62c3d50afed5225b7ce40d422eb4f6b2309b98 Mon Sep 17 00:00:00 2001 From: xx Date: Mon, 23 Dec 2024 17:39:07 +0800 Subject: [PATCH] fix: change input to vue-multiselect 1. change input 2. verify input --- server/notification-providers/dingding.js | 4 +- src/components/notifications/DingDing.vue | 92 ++++++++++++++++++++++- src/lang/en.json | 10 ++- 3 files changed, 98 insertions(+), 8 deletions(-) diff --git a/server/notification-providers/dingding.js b/server/notification-providers/dingding.js index 79b0605a6..39f8b1711 100644 --- a/server/notification-providers/dingding.js +++ b/server/notification-providers/dingding.js @@ -12,8 +12,8 @@ class DingDing extends NotificationProvider { async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { const okMsg = "Sent Successfully."; const mentionAll = notification.mentioning === "everyone"; - const mobileList = notification.mentioning === "specify-mobiles" ? notification.mobileList.split(",") : []; - const userList = notification.mentioning === "specify-users" ? notification.userList.split(",") : []; + const mobileList = notification.mentioning === "specify-mobiles" ? notification.mobileList : []; + const userList = notification.mentioning === "specify-users" ? notification.userList : []; const mentionStr = [ ...mobileList || [], ...userList || [] ].map(item => `@${item}`).join(" "); try { if (heartbeatJSON != null) { diff --git a/src/components/notifications/DingDing.vue b/src/components/notifications/DingDing.vue index f6012818b..d5227bb39 100644 --- a/src/components/notifications/DingDing.vue +++ b/src/components/notifications/DingDing.vue @@ -25,23 +25,109 @@
- +
- +
diff --git a/src/lang/en.json b/src/lang/en.json index 641dae02e..3a80e37c7 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -688,9 +688,13 @@ "Don't mention people": "Don't mention people", "Mention group": "Mention {group}", "Mention Mobile List": "Mention mobile list", - "Mention User List": "Mention user ID List", - "Dingtalk Mobile List": "Mobile List (use comma separator)", - "Dingtalk User List": "User List (use comma separator)", + "Mention User List": "Mention user id list", + "Dingtalk Mobile List": "Mobile list", + "Dingtalk User List": "User ID list", + "Enter a list of userId": "Enter a list of userId", + "Enter a list of mobile": "Enter a list of mobile", + "Invalid mobile": "Invalid mobile [{mobile}]", + "Invalid userId": "Invalid userId [{userId}]", "Device Token": "Device Token", "Platform": "Platform", "Huawei": "Huawei",