From c8200f2972cb04734d855c080e2f717d860ce57d Mon Sep 17 00:00:00 2001 From: Jeck Date: Tue, 14 Jan 2025 21:32:04 -0800 Subject: [PATCH 1/2] Added error-url parameter to monitor sites --- docs/configuration.md | 5 +++++ internal/glance/templates/monitor.html | 4 ++++ internal/glance/widget-monitor.go | 1 + 3 files changed, 10 insertions(+) diff --git a/docs/configuration.md b/docs/configuration.md index 44f0b90..7bc11d8 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1220,6 +1220,7 @@ Properties for each site: | title | string | yes | | | url | string | yes | | | check-url | string | no | | +| error-url | string | no | | | icon | string | no | | | allow-insecure | boolean | no | false | | same-tab | boolean | no | false | @@ -1237,6 +1238,10 @@ The public facing URL of a monitored service, the user will be redirected here. The URL which will be requested and its response will determine the status of the site. If not specified, the `url` property is used. +`error-url` + +If the monitored service returns an error, the user will be redirected here. If not specified, the `url` property is used. + `icon` Optional URL to an image which will be used as the icon for the site. Can be an external URL or internal via [server configured assets](#assets-path). You can also directly use [Simple Icons](https://simpleicons.org/) via a `si:` prefix or [Dashboard Icons](https://github.com/walkxcode/dashboard-icons) via a `di:` prefix: diff --git a/internal/glance/templates/monitor.html b/internal/glance/templates/monitor.html index 7e95b99..291d638 100644 --- a/internal/glance/templates/monitor.html +++ b/internal/glance/templates/monitor.html @@ -25,7 +25,11 @@ {{ end }}
+ {{ if and .Status.Error ( ne "" .ErrorURL)}} + {{ .Title }} + {{ else }} {{ .Title }} + {{ end }}