mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-18 23:34:04 +02:00
fix linting issues
This commit is contained in:
parent
8c97da4a3c
commit
f557045fb1
1 changed files with 8 additions and 8 deletions
|
@ -1,6 +1,5 @@
|
||||||
const NotificationProvider = require("./notification-provider");
|
const NotificationProvider = require("./notification-provider");
|
||||||
const axios = require("axios");
|
const axios = require("axios");
|
||||||
const qs = require("qs");
|
|
||||||
const { DOWN, UP } = require("../../src/util");
|
const { DOWN, UP } = require("../../src/util");
|
||||||
|
|
||||||
class LineNotify extends NotificationProvider {
|
class LineNotify extends NotificationProvider {
|
||||||
|
@ -14,15 +13,16 @@ class LineNotify extends NotificationProvider {
|
||||||
const url = "https://api.line.me/v2/bot/message/broadcast";
|
const url = "https://api.line.me/v2/bot/message/broadcast";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let config = {
|
const config = {
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
Authorization:
|
Authorization:
|
||||||
"Bearer " + notification.lineNotifyAccessToken,
|
"Bearer " + notification.lineNotifyAccessToken,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
if (heartbeatJSON == null) {
|
|
||||||
let testMessage = {
|
if (!heartbeatJSON) {
|
||||||
|
const testMessage = {
|
||||||
messages: [
|
messages: [
|
||||||
{
|
{
|
||||||
type: "text",
|
type: "text",
|
||||||
|
@ -32,12 +32,12 @@ class LineNotify extends NotificationProvider {
|
||||||
};
|
};
|
||||||
await axios.post(url, testMessage, config);
|
await axios.post(url, testMessage, config);
|
||||||
} else if (heartbeatJSON["status"] === DOWN) {
|
} else if (heartbeatJSON["status"] === DOWN) {
|
||||||
let downMessage = {
|
const downMessage = {
|
||||||
messages: [
|
messages: [
|
||||||
{
|
{
|
||||||
type: "text",
|
type: "text",
|
||||||
text:
|
text:
|
||||||
`🔴 [Down]\n` +
|
"🔴 [Down]\n" +
|
||||||
`Name: ${monitorJSON["name"]}\n` +
|
`Name: ${monitorJSON["name"]}\n` +
|
||||||
`${heartbeatJSON["msg"]}\n` +
|
`${heartbeatJSON["msg"]}\n` +
|
||||||
`Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,
|
`Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,
|
||||||
|
@ -46,12 +46,12 @@ class LineNotify extends NotificationProvider {
|
||||||
};
|
};
|
||||||
await axios.post(url, downMessage, config);
|
await axios.post(url, downMessage, config);
|
||||||
} else if (heartbeatJSON["status"] === UP) {
|
} else if (heartbeatJSON["status"] === UP) {
|
||||||
let upMessage = {
|
const upMessage = {
|
||||||
messages: [
|
messages: [
|
||||||
{
|
{
|
||||||
type: "text",
|
type: "text",
|
||||||
text:
|
text:
|
||||||
`✅ [Up]\n` +
|
"✅ [Up]\n" +
|
||||||
`Name: ${monitorJSON["name"]}\n` +
|
`Name: ${monitorJSON["name"]}\n` +
|
||||||
`${heartbeatJSON["msg"]}\n` +
|
`${heartbeatJSON["msg"]}\n` +
|
||||||
`Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,
|
`Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,
|
||||||
|
|
Loading…
Add table
Reference in a new issue