mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-24 02:15:59 +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,
|
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,7 +73,15 @@ class ZohoCliq extends NotificationProvider {
|
||||||
return this._sendNotification(webhookUrl, payload);
|
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;
|
let url;
|
||||||
switch(monitorJSON["type"]) {
|
switch(monitorJSON["type"]) {
|
||||||
case "http":
|
case "http":
|
||||||
|
@ -88,22 +95,11 @@ class ZohoCliq extends NotificationProvider {
|
||||||
url = monitorJSON["hostname"];
|
url = monitorJSON["hostname"];
|
||||||
break;
|
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({
|
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