mirror of
https://github.com/glanceapp/glance.git
synced 2025-06-21 18:31:24 +02:00
Added error-url parameter to monitor sites
This commit is contained in:
parent
a7e235441b
commit
c8200f2972
@ -1220,6 +1220,7 @@ Properties for each site:
|
|||||||
| title | string | yes | |
|
| title | string | yes | |
|
||||||
| url | string | yes | |
|
| url | string | yes | |
|
||||||
| check-url | string | no | |
|
| check-url | string | no | |
|
||||||
|
| error-url | string | no | |
|
||||||
| icon | string | no | |
|
| icon | string | no | |
|
||||||
| allow-insecure | boolean | no | false |
|
| allow-insecure | boolean | no | false |
|
||||||
| same-tab | 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.
|
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`
|
`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:
|
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:
|
||||||
|
@ -25,7 +25,11 @@
|
|||||||
<img class="monitor-site-icon{{ if .Icon.IsFlatIcon }} flat-icon{{ end }}" src="{{ .Icon.URL }}" alt="" loading="lazy">
|
<img class="monitor-site-icon{{ if .Icon.IsFlatIcon }} flat-icon{{ end }}" src="{{ .Icon.URL }}" alt="" loading="lazy">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<div class="min-width-0">
|
<div class="min-width-0">
|
||||||
|
{{ if and .Status.Error ( ne "" .ErrorURL)}}
|
||||||
|
<a class="size-h3 color-highlight text-truncate block" href="{{ .ErrorURL | safeURL }}" {{ if not .SameTab }}target="_blank"{{ end }} rel="noreferrer">{{ .Title }}</a>
|
||||||
|
{{ else }}
|
||||||
<a class="size-h3 color-highlight text-truncate block" href="{{ .URL | safeURL }}" {{ if not .SameTab }}target="_blank"{{ end }} rel="noreferrer">{{ .Title }}</a>
|
<a class="size-h3 color-highlight text-truncate block" href="{{ .URL | safeURL }}" {{ if not .SameTab }}target="_blank"{{ end }} rel="noreferrer">{{ .Title }}</a>
|
||||||
|
{{ end }}
|
||||||
<ul class="list-horizontal-text">
|
<ul class="list-horizontal-text">
|
||||||
{{ if not .Status.Error }}
|
{{ if not .Status.Error }}
|
||||||
<li title="{{ .Status.Code }}">{{ .StatusText }}</li>
|
<li title="{{ .Status.Code }}">{{ .StatusText }}</li>
|
||||||
|
@ -20,6 +20,7 @@ type monitorWidget struct {
|
|||||||
Sites []struct {
|
Sites []struct {
|
||||||
*SiteStatusRequest `yaml:",inline"`
|
*SiteStatusRequest `yaml:",inline"`
|
||||||
Status *siteStatus `yaml:"-"`
|
Status *siteStatus `yaml:"-"`
|
||||||
|
ErrorURL string `yaml:"error-url"`
|
||||||
Title string `yaml:"title"`
|
Title string `yaml:"title"`
|
||||||
Icon customIconField `yaml:"icon"`
|
Icon customIconField `yaml:"icon"`
|
||||||
SameTab bool `yaml:"same-tab"`
|
SameTab bool `yaml:"same-tab"`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user