slight tweak to uptime kumanotifier

This commit is contained in:
Paul Wilde 2024-08-25 22:18:07 +01:00
parent d043f12784
commit 1265871c33

View file

@ -8,13 +8,13 @@ type
UptimeKuma* = object of Notifier UptimeKuma* = object of Notifier
proc send_notify*(uk: UptimeKuma, state: State, runtime: int = 0, msg: string = ""): int {.discardable.} = proc send_notify*(uk: UptimeKuma, state: State, runtime: int = 0, msg: string = ""): int {.discardable.} =
var status: string var status: string = "down"
case state case state
of Success, Running: of Success, Running:
status = "up" status = "up"
else: else:
status = "down" status = "down"
let message = fmt"{status}\r\n{msg}" let message = fmt"{status}:{msg}"
let url = fmt"{uk.base_url}?status={status}&msg={message}&ping={runtime}" let url = fmt"{uk.base_url}?status={status}&msg={message}&ping={runtime}"
echo "Sending notification to " & url echo "Sending notification to " & url