Merge branch 'master' into copilot/create-database-migration-file

This commit is contained in:
Louis Lam 2026-01-02 13:59:02 +08:00 committed by GitHub
commit 1a6b4f4878
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -46,6 +46,7 @@ class Discord extends NotificationProvider {
}
// If heartbeatJSON is not null, we go into the normal alerting loop.
let addess = this.extractAddress(monitorJSON);
if (heartbeatJSON["status"] === DOWN) {
let discorddowndata = {
username: discordDisplayName,
@ -58,9 +59,9 @@ class Discord extends NotificationProvider {
name: "Service Name",
value: monitorJSON["name"],
},
...(!notification.disableUrl ? [{
...((!notification.disableUrl && addess) ? [{
name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL",
value: this.extractAddress(monitorJSON),
value: addess,
}] : []),
{
name: `Time (${heartbeatJSON["timezone"]})`,
@ -98,18 +99,18 @@ class Discord extends NotificationProvider {
name: "Service Name",
value: monitorJSON["name"],
},
...(!notification.disableUrl ? [{
...((!notification.disableUrl && addess) ? [{
name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL",
value: this.extractAddress(monitorJSON),
value: addess,
}] : []),
{
name: `Time (${heartbeatJSON["timezone"]})`,
value: heartbeatJSON["localDateTime"],
},
{
...(heartbeatJSON["ping"] != null ? [{
name: "Ping",
value: heartbeatJSON["ping"] == null ? "N/A" : heartbeatJSON["ping"] + " ms",
},
value: heartbeatJSON["ping"] + " ms",
}] : []),
],
}],
};