Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1963,6 +1963,7 @@ Properties for each site:
| check-url | string | no | |
| error-url | string | no | |
| icon | string | no | |
| description | string | no | |
| timeout | string | no | 3s |
| allow-insecure | boolean | no | false |
| same-tab | boolean | no | false |
Expand All @@ -1989,6 +1990,10 @@ If the monitored service returns an error, the user will be redirected here. If

See [Icons](#icons) for more information on how to specify icons.

`description`

A short description displayed below the title. Unset by default.

`timeout`

How long to wait for a response from the server before considering it unreachable. The value is a string and must be a number followed by one of s, m, h, d. Example: `5s` for 5 seconds, `1m` for 1 minute, etc.
Expand Down
8 changes: 8 additions & 0 deletions internal/glance/static/css/utils.css
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,14 @@ details[open] .summary::after {
text-align: left;
}

.stretch-to-content {
min-width: 0;
display: flex;
flex-grow: 1;
flex-basis: 0%;
max-width: max-content;
}

.visited-indicator:not(:visited)::before, .visited-indicator:not(:visited)::after {
color: var(--color-primary);
}
Expand Down
5 changes: 5 additions & 0 deletions internal/glance/templates/monitor.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
<div class="grow min-width-0">
<a class="size-h3 color-highlight text-truncate block" href="{{ .URL | safeURL }}" {{ if not .SameTab }}target="_blank"{{ end }} rel="noreferrer">{{ .Title }}</a>
<ul class="list-horizontal-text">
{{ if .Description }}
<div class="stretch-to-content">
<li class="text-truncate">{{ .Description }}</li>
</div>
{{ end }}
{{ if not .Status.Error }}
<li title="{{ .Status.Code }}">{{ .StatusText }}</li>
<li>{{ .Status.ResponseTime.Milliseconds | formatNumber }}ms</li>
Expand Down
1 change: 1 addition & 0 deletions internal/glance/widget-monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type monitorWidget struct {
URL string `yaml:"-"`
ErrorURL string `yaml:"error-url"`
Title string `yaml:"title"`
Description string `yaml:"description"`
Icon customIconField `yaml:"icon"`
SameTab bool `yaml:"same-tab"`
StatusText string `yaml:"-"`
Expand Down