|
|
|
@ -44,7 +44,6 @@ class ZohoCliq extends NotificationProvider {
|
|
|
|
|
monitorName,
|
|
|
|
|
monitorUrl,
|
|
|
|
|
}) => {
|
|
|
|
|
|
|
|
|
|
const payload = ["### Uptime Kuma\n"];
|
|
|
|
|
payload.push(this._statusMessageFactory(status, monitorName));
|
|
|
|
|
payload.push(`*Description:* ${monitorMessage}`);
|
|
|
|
@ -74,7 +73,15 @@ class ZohoCliq extends NotificationProvider {
|
|
|
|
|
return this._sendNotification(webhookUrl, payload);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_monitorUrlFactory = (monitorJSON) => {
|
|
|
|
|
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
|
|
|
|
let okMsg = "Sent Successfully.";
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if (heartbeatJSON == null) {
|
|
|
|
|
await this._handleGeneralNotification(notification.webhookUrl, msg);
|
|
|
|
|
return okMsg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let url;
|
|
|
|
|
switch(monitorJSON["type"]) {
|
|
|
|
|
case "http":
|
|
|
|
@ -88,22 +95,11 @@ class ZohoCliq extends NotificationProvider {
|
|
|
|
|
url = monitorJSON["hostname"];
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return url;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
|
|
|
|
let okMsg = "Sent Successfully.";
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if (heartbeatJSON == null) {
|
|
|
|
|
await this._handleGeneralNotification(notification.webhookUrl, msg);
|
|
|
|
|
return okMsg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const payload = this._notificationPayloadFactory({
|
|
|
|
|
monitorMessage: heartbeatJSON.msg,
|
|
|
|
|
monitorName: monitorJSON.name,
|
|
|
|
|
monitorUrl: this._monitorUrlFactory(monitorJSON),
|
|
|
|
|
monitorUrl: url,
|
|
|
|
|
status: heartbeatJSON.status,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|