mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-24 15:25:36 -04:00
implement webhook
This commit is contained in:
parent
d24a15410e
commit
0ad04d1468
6 changed files with 126 additions and 47 deletions
|
@ -109,7 +109,7 @@ class Monitor extends BeanModel {
|
|||
if (! previousBeat || previousBeat.status !== bean.status) {
|
||||
bean.important = true;
|
||||
|
||||
let notificationList = await R.getAll(`SELECT notification.* FROM notification, monitor_notification WHERE monitor_id = ? `, [
|
||||
let notificationList = await R.getAll(`SELECT notification.* FROM notification, monitor_notification WHERE monitor_id = ? AND monitor_notification.notification_id = notification.id `, [
|
||||
this.id
|
||||
])
|
||||
|
||||
|
@ -125,7 +125,7 @@ class Monitor extends BeanModel {
|
|||
let msg = `[${this.name}] [${text}] ${bean.msg}`;
|
||||
|
||||
for(let notification of notificationList) {
|
||||
promiseList.push(Notification.send(JSON.parse(notification.config), msg));
|
||||
promiseList.push(Notification.send(JSON.parse(notification.config), msg, await this.toJSON(), bean.toJSON()));
|
||||
}
|
||||
|
||||
await Promise.all(promiseList);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue