mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 23:04:04 +00:00
fixed formatting mistakes
This commit is contained in:
parent
c9132adfc7
commit
9f563adc1a
4 changed files with 6 additions and 9 deletions
|
@ -48,7 +48,7 @@ class Discord extends NotificationProvider {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL",
|
name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL",
|
||||||
value: monitorJSON["type"] === "push" ? "Heartbeat" : address,
|
value: this.extractAdress(monitorJSON),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: `Time (${heartbeatJSON["timezone"]})`,
|
name: `Time (${heartbeatJSON["timezone"]})`,
|
||||||
|
|
|
@ -21,13 +21,12 @@ class NotificationProvider {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extracts the address from a monitor JSON object based on its type.
|
* Extracts the address from a monitor JSON object based on its type.
|
||||||
*
|
|
||||||
* @param {?object} monitorJSON Monitor details (For Up/Down only)
|
* @param {?object} monitorJSON Monitor details (For Up/Down only)
|
||||||
* @returns {string} The extracted address based on the monitor type.
|
* @returns {string} The extracted address based on the monitor type.
|
||||||
*/
|
*/
|
||||||
extractAdress(monitorJSON){
|
extractAdress(monitorJSON) {
|
||||||
if (!monitorJSON) {
|
if (!monitorJSON) {
|
||||||
return ""
|
return "";
|
||||||
}
|
}
|
||||||
switch (monitorJSON["type"]) {
|
switch (monitorJSON["type"]) {
|
||||||
case "push":
|
case "push":
|
||||||
|
@ -41,7 +40,7 @@ class NotificationProvider {
|
||||||
if (monitorJSON["port"]) {
|
if (monitorJSON["port"]) {
|
||||||
return monitorJSON["hostname"] + ":" + monitorJSON["port"];
|
return monitorJSON["hostname"] + ":" + monitorJSON["port"];
|
||||||
}
|
}
|
||||||
return monitorJSON["hostname"]
|
return monitorJSON["hostname"];
|
||||||
default:
|
default:
|
||||||
if (![ "https://", "http://", "" ].includes(monitorJSON["url"])) {
|
if (![ "https://", "http://", "" ].includes(monitorJSON["url"])) {
|
||||||
return monitorJSON["url"];
|
return monitorJSON["url"];
|
||||||
|
|
|
@ -32,7 +32,7 @@ class SevenIO extends NotificationProvider {
|
||||||
return okMsg;
|
return okMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
let address = extractAdress(monitorJSON);
|
let address = this.extractAdress(monitorJSON);
|
||||||
if (address !== "") {
|
if (address !== "") {
|
||||||
address = `(${address}) `;
|
address = `(${address}) `;
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,12 +82,10 @@ class ZohoCliq extends NotificationProvider {
|
||||||
return okMsg;
|
return okMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const payload = this._notificationPayloadFactory({
|
const payload = this._notificationPayloadFactory({
|
||||||
monitorMessage: heartbeatJSON.msg,
|
monitorMessage: heartbeatJSON.msg,
|
||||||
monitorName: monitorJSON.name,
|
monitorName: monitorJSON.name,
|
||||||
monitorUrl: address,
|
monitorUrl: this.extractAdress(monitorJSON),
|
||||||
status: heartbeatJSON.status
|
status: heartbeatJSON.status
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue