made sure that the address extraction is extracted into its own method

This commit is contained in:
Frank Elsinga
2024-06-13 17:00:11 +02:00
committed by GitHub
parent bd95ccdc64
commit c9132adfc7
7 changed files with 36 additions and 102 deletions

View File

@@ -216,21 +216,6 @@ class Teams extends NotificationProvider {
return okMsg;
}
let monitorUrl;
switch (monitorJSON["type"]) {
case "http":
case "keywork":
monitorUrl = monitorJSON["url"];
break;
case "docker":
monitorUrl = monitorJSON["docker_host"];
break;
default:
monitorUrl = monitorJSON["hostname"];
break;
}
const baseURL = await setting("primaryBaseURL");
let dashboardUrl;
if (baseURL) {
@@ -240,7 +225,7 @@ class Teams extends NotificationProvider {
const payload = this._notificationPayloadFactory({
heartbeatJSON: heartbeatJSON,
monitorName: monitorJSON.name,
monitorUrl: monitorUrl,
monitorUrl: this.extractAdress(monitorJSON),
dashboardUrl: dashboardUrl,
});