Conditionally add service url

This commit is contained in:
Dj Isaac 2024-10-09 20:35:26 -05:00
parent af230ba5fb
commit 8b82520d3d
No known key found for this signature in database

View file

@ -33,11 +33,17 @@ class Discord extends NotificationProvider {
return okMsg; return okMsg;
} }
const address = this.extractAddress(monitorJSON);
const embedFields = [ const embedFields = [
{ {
name: "Service Name", name: "Service Name",
value: monitorJSON["name"], value: monitorJSON["name"],
}, },
...((address !== "" && address !== monitorJSON["hostname"]) ? [{
name: "Service URL",
value: address
}] : []),
{ {
name: `Time (${heartbeatJSON["timezone"]})`, name: `Time (${heartbeatJSON["timezone"]})`,
value: heartbeatJSON["localDateTime"], value: heartbeatJSON["localDateTime"],