Skip to content

Commit

Permalink
fixed formatting mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm authored Jun 13, 2024
1 parent c9132ad commit 9f563ad
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion server/notification-providers/discord.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Discord extends NotificationProvider {
},
{
name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL",
value: monitorJSON["type"] === "push" ? "Heartbeat" : address,
value: this.extractAdress(monitorJSON),
},
{
name: `Time (${heartbeatJSON["timezone"]})`,
Expand Down
7 changes: 3 additions & 4 deletions server/notification-providers/notification-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ class NotificationProvider {

/**
* Extracts the address from a monitor JSON object based on its type.
*
* @param {?object} monitorJSON Monitor details (For Up/Down only)
* @returns {string} The extracted address based on the monitor type.
*/
extractAdress(monitorJSON){
extractAdress(monitorJSON) {
if (!monitorJSON) {
return ""
return "";
}
switch (monitorJSON["type"]) {
case "push":
Expand All @@ -41,7 +40,7 @@ class NotificationProvider {
if (monitorJSON["port"]) {
return monitorJSON["hostname"] + ":" + monitorJSON["port"];
}
return monitorJSON["hostname"]
return monitorJSON["hostname"];
default:
if (![ "https://", "http://", "" ].includes(monitorJSON["url"])) {
return monitorJSON["url"];
Expand Down
2 changes: 1 addition & 1 deletion server/notification-providers/sevenio.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SevenIO extends NotificationProvider {
return okMsg;
}

let address = extractAdress(monitorJSON);
let address = this.extractAdress(monitorJSON);
if (address !== "") {
address = `(${address}) `;
}
Expand Down
4 changes: 1 addition & 3 deletions server/notification-providers/zoho-cliq.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ class ZohoCliq extends NotificationProvider {
return okMsg;
}



const payload = this._notificationPayloadFactory({
monitorMessage: heartbeatJSON.msg,
monitorName: monitorJSON.name,
monitorUrl: address,
monitorUrl: this.extractAdress(monitorJSON),
status: heartbeatJSON.status
});

Expand Down

0 comments on commit 9f563ad

Please sign in to comment.