mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-28 01:04:05 +00:00
[Discord] Fix ping type should no port, update better naming
This commit is contained in:
parent
66971deaf4
commit
cec0521834
1 changed files with 10 additions and 8 deletions
|
@ -22,20 +22,22 @@ class Discord extends NotificationProvider {
|
||||||
return okMsg;
|
return okMsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
let url;
|
let address;
|
||||||
|
|
||||||
switch (monitorJSON["type"]) {
|
switch (monitorJSON["type"]) {
|
||||||
case "dns":
|
|
||||||
case "ping":
|
case "ping":
|
||||||
|
address = monitorJSON["hostname"];
|
||||||
|
break;
|
||||||
case "port":
|
case "port":
|
||||||
|
case "dns":
|
||||||
case "steam":
|
case "steam":
|
||||||
url = monitorJSON["hostname"];
|
address = monitorJSON["hostname"];
|
||||||
if (monitorJSON["port"]) {
|
if (monitorJSON["port"]) {
|
||||||
url += ":" + monitorJSON["port"];
|
address += ":" + monitorJSON["port"];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
url = monitorJSON["url"];
|
address = monitorJSON["url"];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,8 +55,8 @@ class Discord extends NotificationProvider {
|
||||||
value: monitorJSON["name"],
|
value: monitorJSON["name"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Service URL",
|
name: "Service URL / Address",
|
||||||
value: url,
|
value: address,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Time (UTC)",
|
name: "Time (UTC)",
|
||||||
|
@ -89,7 +91,7 @@ class Discord extends NotificationProvider {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Service URL",
|
name: "Service URL",
|
||||||
value: url.startsWith("http") ? "[Visit Service](" + url + ")" : url,
|
value: address.startsWith("http") ? "[Visit Service](" + address + ")" : address,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Time (UTC)",
|
name: "Time (UTC)",
|
||||||
|
|
Loading…
Reference in a new issue