mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-27 12:00:35 +03:00
zoho cliq code style
This commit is contained in:
parent
73bfdb9ef9
commit
68bc7ac421
1 changed files with 16 additions and 20 deletions
|
@ -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,
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue