mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-25 13:44:09 -08:00
lint: fix style
This commit is contained in:
parent
b0910138f3
commit
b84b79b021
|
@ -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,
|
||||
|
|
|
@ -23,11 +23,11 @@
|
|||
<option value="specify-users">{{ $t("Mention User List") }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3" v-if="$parent.notification.mentioning === 'specify-mobiles'">
|
||||
<div v-if="$parent.notification.mentioning === 'specify-mobiles'" class="mb-3">
|
||||
<label for="mobileList" class="form-label">{{ $t("Dingtalk Mobile List") }}<span style="color: red;"><sup>*</sup></span></label>
|
||||
<input id="mobileList" v-model="$parent.notification.mobileList" type="list" class="form-control" required>
|
||||
</div>
|
||||
<div class="mb-3" v-if="$parent.notification.mentioning === 'specify-users'">
|
||||
<div v-if="$parent.notification.mentioning === 'specify-users'" class="mb-3">
|
||||
<label for="userList" class="form-label">{{ $t("Dingtalk User List") }}<span style="color: red;"><sup>*</sup></span></label>
|
||||
<input id="userList" v-model="$parent.notification.userList" type="list" class="form-control" required>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue