From b84b79b021eb3ba806e83559e1d33bd719c1b12f Mon Sep 17 00:00:00 2001 From: xx Date: Sat, 21 Dec 2024 15:11:59 +0800 Subject: [PATCH] lint: fix style --- server/notification-providers/dingding.js | 13 ++++++------- src/components/notifications/DingDing.vue | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/server/notification-providers/dingding.js b/server/notification-providers/dingding.js index 01cd26355..79b0605a6 100644 --- a/server/notification-providers/dingding.js +++ b/server/notification-providers/dingding.js @@ -11,18 +11,17 @@ 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 mentionStr = [...mobileList || [], ...userList || []].map(item => `@${item}`).join(" ") + const mentionAll = notification.mentioning === "everyone"; + const mobileList = notification.mentioning === "specify-mobiles" ? notification.mobileList.split(",") : []; + const userList = notification.mentioning === "specify-users" ? notification.userList.split(",") : []; + const mentionStr = [ ...mobileList || [], ...userList || [] ].map(item => `@${item}`).join(" "); try { if (heartbeatJSON != null) { - notification.mobileList let params = { msgtype: "markdown", markdown: { title: `[${this.statusToString(heartbeatJSON["status"])}] ${monitorJSON["name"]}`, - text: `## [${this.statusToString(heartbeatJSON["status"])}] ${monitorJSON["name"]} \n> ${heartbeatJSON["msg"]}\n> Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}${'\n\n' + mentionStr}`, + text: `## [${this.statusToString(heartbeatJSON["status"])}] ${monitorJSON["name"]} \n> ${heartbeatJSON["msg"]}\n> Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}${"\n\n" + mentionStr}`, }, at: { isAtAll: mentionAll, @@ -37,7 +36,7 @@ class DingDing extends NotificationProvider { let params = { msgtype: "text", text: { - content: `${msg}${'\n' + mentionStr}` + content: `${msg}${"\n" + mentionStr}` }, at: { isAtAll: mentionAll, diff --git a/src/components/notifications/DingDing.vue b/src/components/notifications/DingDing.vue index 3ed974d6e..f6012818b 100644 --- a/src/components/notifications/DingDing.vue +++ b/src/components/notifications/DingDing.vue @@ -23,11 +23,11 @@ -
+
-
+