run eslint for lunasea change

This commit is contained in:
LouisLam 2021-07-31 13:35:18 +08:00
parent 3f84e5e8ab
commit 2ebd79d037
2 changed files with 10 additions and 10 deletions

View File

@ -236,13 +236,13 @@ class Notification {
return Notification.apprise(notification, msg) return Notification.apprise(notification, msg)
} else if (notification.type === "lunasea") { } else if (notification.type === "lunasea") {
let lunaseadevice = "https://notify.lunasea.app/v1/custom/device/"+notification.lunaseaDevice let lunaseadevice = "https://notify.lunasea.app/v1/custom/device/" + notification.lunaseaDevice
try { try {
if (heartbeatJSON == null) { if (heartbeatJSON == null) {
let testdata = { let testdata = {
"title": "Uptime Kuma Alert", "title": "Uptime Kuma Alert",
"body": "Testing Successful." "body": "Testing Successful.",
} }
await axios.post(lunaseadevice, testdata) await axios.post(lunaseadevice, testdata)
return okMsg; return okMsg;
@ -250,8 +250,8 @@ class Notification {
if (heartbeatJSON["status"] == 0) { if (heartbeatJSON["status"] == 0) {
let downdata = { let downdata = {
"title": "UptimeKuma Alert:" +monitorJSON["name"], "title": "UptimeKuma Alert:" + monitorJSON["name"],
"body": "[🔴 Down]"+heartbeatJSON["msg"]+ "\nTime (UTC):" + heartbeatJSON["time"] "body": "[🔴 Down]" + heartbeatJSON["msg"] + "\nTime (UTC):" + heartbeatJSON["time"],
} }
await axios.post(lunaseadevice, downdata) await axios.post(lunaseadevice, downdata)
return okMsg; return okMsg;
@ -259,14 +259,14 @@ class Notification {
if (heartbeatJSON["status"] == 1) { if (heartbeatJSON["status"] == 1) {
let updata = { let updata = {
"title": "UptimeKuma Alert:" +monitorJSON["name"], "title": "UptimeKuma Alert:" + monitorJSON["name"],
"body": "[✅ Up]"+heartbeatJSON["msg"]+ "\nTime (UTC):" + heartbeatJSON["time"] "body": "[✅ Up]" + heartbeatJSON["msg"] + "\nTime (UTC):" + heartbeatJSON["time"],
} }
await axios.post(lunaseadevice, updata) await axios.post(lunaseadevice, updata)
return okMsg; return okMsg;
} }
} catch (error) { } catch (error) {
throwGeneralAxiosError(error) throwGeneralAxiosError(error)
} }

View File

@ -323,7 +323,7 @@
</p> </p>
</div> </div>
</template> </template>
<template v-if="notification.type === 'lunasea'"> <template v-if="notification.type === 'lunasea'">
<div class="mb-3"> <div class="mb-3">
<label for="lunasea-device" class="form-label">LunaSea Device ID<span style="color:red;"><sup>*</sup></span></label> <label for="lunasea-device" class="form-label">LunaSea Device ID<span style="color:red;"><sup>*</sup></span></label>
@ -333,7 +333,7 @@
</div> </div>
</div> </div>
</template> </template>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button v-if="id" type="button" class="btn btn-danger" :disabled="processing" @click="deleteConfirm"> <button v-if="id" type="button" class="btn btn-danger" :disabled="processing" @click="deleteConfirm">