fix formatting

This commit is contained in:
Nayem Siddique 2025-07-13 18:11:06 +06:00 committed by GitHub
parent 919f42fcad
commit 8c97da4a3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,37 +17,46 @@ class LineNotify extends NotificationProvider {
let config = {
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer " + notification.lineNotifyAccessToken
}
Authorization:
"Bearer " + notification.lineNotifyAccessToken,
},
};
if (heartbeatJSON == null) {
let testMessage = {
messages: [{
type: "text",
text: msg
}]
messages: [
{
type: "text",
text: msg,
},
],
};
await axios.post(url, testMessage, config);
} else if (heartbeatJSON["status"] === DOWN) {
let downMessage = {
messages: [{
type: "text",
text: `🔴 [Down]\n` +
`Name: ${monitorJSON["name"]}\n` +
`${heartbeatJSON["msg"]}\n` +
`Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`
}]
messages: [
{
type: "text",
text:
`🔴 [Down]\n` +
`Name: ${monitorJSON["name"]}\n` +
`${heartbeatJSON["msg"]}\n` +
`Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,
},
],
};
await axios.post(url, downMessage, config);
} else if (heartbeatJSON["status"] === UP) {
let upMessage = {
messages: [{
type: "text",
text: `✅ [Up]\n` +
`Name: ${monitorJSON["name"]}\n` +
`${heartbeatJSON["msg"]}\n` +
`Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`
}]
messages: [
{
type: "text",
text:
`✅ [Up]\n` +
`Name: ${monitorJSON["name"]}\n` +
`${heartbeatJSON["msg"]}\n` +
`Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,
},
],
};
await axios.post(url, upMessage, config);
}