mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 18:06:14 +03:00
zoho cliq code style
This commit is contained in:
parent
73bfdb9ef9
commit
68bc7ac421
1 changed files with 16 additions and 20 deletions
|
@ -43,8 +43,7 @@ class ZohoCliq extends NotificationProvider {
|
||||||
monitorMessage,
|
monitorMessage,
|
||||||
monitorName,
|
monitorName,
|
||||||
monitorUrl,
|
monitorUrl,
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
const payload = ["### Uptime Kuma\n"];
|
const payload = ["### Uptime Kuma\n"];
|
||||||
payload.push(this._statusMessageFactory(status, monitorName));
|
payload.push(this._statusMessageFactory(status, monitorName));
|
||||||
payload.push(`*Description:* ${monitorMessage}`);
|
payload.push(`*Description:* ${monitorMessage}`);
|
||||||
|
@ -74,23 +73,6 @@ class ZohoCliq extends NotificationProvider {
|
||||||
return this._sendNotification(webhookUrl, payload);
|
return this._sendNotification(webhookUrl, payload);
|
||||||
};
|
};
|
||||||
|
|
||||||
_monitorUrlFactory = (monitorJSON) => {
|
|
||||||
let url;
|
|
||||||
switch(monitorJSON["type"]) {
|
|
||||||
case "http":
|
|
||||||
case "keywork":
|
|
||||||
url = monitorJSON["url"];
|
|
||||||
break;
|
|
||||||
case "docker":
|
|
||||||
url = monitorJSON["docker_host"];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
url = monitorJSON["hostname"];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return url;
|
|
||||||
};
|
|
||||||
|
|
||||||
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
||||||
let okMsg = "Sent Successfully.";
|
let okMsg = "Sent Successfully.";
|
||||||
|
|
||||||
|
@ -100,10 +82,24 @@ class ZohoCliq extends NotificationProvider {
|
||||||
return okMsg;
|
return okMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let url;
|
||||||
|
switch(monitorJSON["type"]) {
|
||||||
|
case "http":
|
||||||
|
case "keywork":
|
||||||
|
url = monitorJSON["url"];
|
||||||
|
break;
|
||||||
|
case "docker":
|
||||||
|
url = monitorJSON["docker_host"];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
url = monitorJSON["hostname"];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
const payload = this._notificationPayloadFactory({
|
const payload = this._notificationPayloadFactory({
|
||||||
monitorMessage: heartbeatJSON.msg,
|
monitorMessage: heartbeatJSON.msg,
|
||||||
monitorName: monitorJSON.name,
|
monitorName: monitorJSON.name,
|
||||||
monitorUrl: this._monitorUrlFactory(monitorJSON),
|
monitorUrl: url,
|
||||||
status: heartbeatJSON.status,
|
status: heartbeatJSON.status,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue