Undo parm changes

This commit is contained in:
Domenic Horner
2021-09-04 20:08:18 +08:00
parent b0acda52f9
commit 41d32bb9dd
3 changed files with 12 additions and 15 deletions

View File

@@ -270,9 +270,18 @@ class Monitor extends BeanModel {
this.id,
])
let text;
if (bean.status === UP) {
text = "✅ Up"
} else {
text = "🔴 Down"
}
let msg = `[${this.name}] [${text}] ${bean.msg}`;
for (let notification of notificationList) {
try {
await Notification.send(JSON.parse(notification.config), this.name, await this.toJSON(), bean.toJSON())
await Notification.send(JSON.parse(notification.config), msg, await this.toJSON(), bean.toJSON())
} catch (e) {
console.error("Cannot send notification to " + notification.name);
console.log(e);