mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-10-30 03:00:40 +00:00
fix discord notification appended port unexpectedly
This commit is contained in:
parent
527e0c3444
commit
697fa6bdfd
1 changed files with 11 additions and 4 deletions
|
@ -96,9 +96,16 @@ class Notification {
|
||||||
return okMsg;
|
return okMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
let url = monitorJSON["url"] === "https://" ? monitorJSON["hostname"] : monitorJSON["url"]
|
let url;
|
||||||
if (monitorJSON["port"]) {
|
|
||||||
url += ":" + monitorJSON[port];
|
if (monitorJSON["type"] === "port") {
|
||||||
|
url = monitorJSON["hostname"];
|
||||||
|
if (monitorJSON["port"]) {
|
||||||
|
url += ":" + monitorJSON["port"];
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
url = monitorJSON["url"];
|
||||||
}
|
}
|
||||||
|
|
||||||
// If heartbeatJSON is not null, we go into the normal alerting loop.
|
// If heartbeatJSON is not null, we go into the normal alerting loop.
|
||||||
|
@ -331,7 +338,7 @@ class Notification {
|
||||||
await axios.post(notification.mattermostWebhookUrl, mattermostTestData)
|
await axios.post(notification.mattermostWebhookUrl, mattermostTestData)
|
||||||
return okMsg;
|
return okMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
const mattermostChannel = notification.mattermostchannel;
|
const mattermostChannel = notification.mattermostchannel;
|
||||||
const mattermostIconEmoji = notification.mattermosticonemo;
|
const mattermostIconEmoji = notification.mattermosticonemo;
|
||||||
const mattermostIconUrl = notification.mattermosticonurl;
|
const mattermostIconUrl = notification.mattermosticonurl;
|
||||||
|
|
Loading…
Reference in a new issue