zoho cliq code style

This commit is contained in:
panos 2022-12-08 13:41:05 +02:00
parent 73bfdb9ef9
commit 68bc7ac421

View File

@ -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,
});