mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-18 23:34:04 +02:00
fix formatting
This commit is contained in:
parent
919f42fcad
commit
8c97da4a3c
1 changed files with 29 additions and 20 deletions
|
@ -17,37 +17,46 @@ class LineNotify extends NotificationProvider {
|
||||||
let config = {
|
let config = {
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"Authorization": "Bearer " + notification.lineNotifyAccessToken
|
Authorization:
|
||||||
}
|
"Bearer " + notification.lineNotifyAccessToken,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
if (heartbeatJSON == null) {
|
if (heartbeatJSON == null) {
|
||||||
let testMessage = {
|
let testMessage = {
|
||||||
messages: [{
|
messages: [
|
||||||
|
{
|
||||||
type: "text",
|
type: "text",
|
||||||
text: msg
|
text: msg,
|
||||||
}]
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
await axios.post(url, testMessage, config);
|
await axios.post(url, testMessage, config);
|
||||||
} else if (heartbeatJSON["status"] === DOWN) {
|
} else if (heartbeatJSON["status"] === DOWN) {
|
||||||
let downMessage = {
|
let downMessage = {
|
||||||
messages: [{
|
messages: [
|
||||||
|
{
|
||||||
type: "text",
|
type: "text",
|
||||||
text: `🔴 [Down]\n` +
|
text:
|
||||||
|
`🔴 [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"]}`,
|
||||||
}]
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
await axios.post(url, downMessage, config);
|
await axios.post(url, downMessage, config);
|
||||||
} else if (heartbeatJSON["status"] === UP) {
|
} else if (heartbeatJSON["status"] === UP) {
|
||||||
let upMessage = {
|
let upMessage = {
|
||||||
messages: [{
|
messages: [
|
||||||
|
{
|
||||||
type: "text",
|
type: "text",
|
||||||
text: `✅ [Up]\n` +
|
text:
|
||||||
|
`✅ [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"]}`,
|
||||||
}]
|
},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
await axios.post(url, upMessage, config);
|
await axios.post(url, upMessage, config);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue