diff --git a/docs/configuration.md b/docs/configuration.md index f8221b8..832d035 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1149,11 +1149,19 @@ You can hover over the "ERROR" text to view more information. | Name | Type | Required | Default | | ---- | ---- | -------- | ------- | | sites | array | yes | | +| style | string | no | | | show-failing-only | boolean | no | false | ##### `show-failing-only` Shows only a list of failing sites when set to `true`. +##### `style` +Used to change the appearance of the widget. Possible values are `compact`. + +Preview of `compact`: + + + ##### `sites` Properties for each site: diff --git a/docs/images/monitor-widget-compact-preview.png b/docs/images/monitor-widget-compact-preview.png new file mode 100644 index 0000000..3e81fce Binary files /dev/null and b/docs/images/monitor-widget-compact-preview.png differ diff --git a/internal/assets/static/main.css b/internal/assets/static/main.css index 3c342a0..3268a48 100644 --- a/internal/assets/static/main.css +++ b/internal/assets/static/main.css @@ -1830,6 +1830,7 @@ details[open] .summary::after { .list { --list-half-gap: 0rem; } .list-gap-2 { --list-half-gap: 0.1rem; } .list-gap-4 { --list-half-gap: 0.2rem; } +.list-gap-8 { --list-half-gap: 0.4rem; } .list-gap-10 { --list-half-gap: 0.5rem; } .list-gap-14 { --list-half-gap: 0.7rem; } .list-gap-20 { --list-half-gap: 1rem; } diff --git a/internal/assets/templates.go b/internal/assets/templates.go index 324f8ca..4834078 100644 --- a/internal/assets/templates.go +++ b/internal/assets/templates.go @@ -32,6 +32,7 @@ var ( RSSHorizontalCardsTemplate = compileTemplate("rss-horizontal-cards.html", "widget-base.html") RSSHorizontalCards2Template = compileTemplate("rss-horizontal-cards-2.html", "widget-base.html") MonitorTemplate = compileTemplate("monitor.html", "widget-base.html") + MonitorCompactTemplate = compileTemplate("monitor-compact.html", "widget-base.html") TwitchGamesListTemplate = compileTemplate("twitch-games-list.html", "widget-base.html") TwitchChannelsTemplate = compileTemplate("twitch-channels.html", "widget-base.html") RepositoryTemplate = compileTemplate("repository.html", "widget-base.html") diff --git a/internal/assets/templates/monitor-compact.html b/internal/assets/templates/monitor-compact.html new file mode 100644 index 0000000..327c978 --- /dev/null +++ b/internal/assets/templates/monitor-compact.html @@ -0,0 +1,39 @@ +{{ template "widget-base.html" . }} + +{{ define "widget-content" }} +{{ if not (and .ShowFailingOnly (not .HasFailing)) }} +
All sites are online
+ +