From a1d7b6e433f5e283383cce462d326d6c054e2d8e Mon Sep 17 00:00:00 2001 From: Micha Date: Fri, 12 Jun 2026 16:47:25 +0200 Subject: [PATCH] ops: glance layout verdichtet - internet kombiniert, container-tabs, mealie/commit-fixes - Home rechte Spalte: Internet+Speed in einem Widget, DNS-und-VPN-Monitor entfernt, Container-Listen als Tab-Gruppe - Infrastructure: Container-Listen als Tab-Gruppe, Mealie-Statistik auf /api/admin/about/statistics (404-Fix) - Commit-Widgets: toRelativeTime als span-Attribut, nur erste Commit-Zeile Co-Authored-By: Claude Fable 5 --- ops/glance/config/home.yml | 122 +++++++++------------------ ops/glance/config/infrastructure.yml | 50 +++++------ ops/glance/config/ops.yml | 4 +- 3 files changed, 68 insertions(+), 108 deletions(-) diff --git a/ops/glance/config/home.yml b/ops/glance/config/home.yml index 22bd57b..f0d7155 100644 --- a/ops/glance/config/home.yml +++ b/ops/glance/config/home.yml @@ -396,28 +396,6 @@ title-url: https://speedtest.kaleschke.info cache: 1h url: http://speedtest-tracker/api/v1/results/latest - headers: - Authorization: Bearer ${GLANCE_SPEEDTEST_API_KEY} - Accept: application/json - template: | - {{ $ip := .JSON.String "external_ip" }} - {{ if eq $ip "" }}{{ $ip = .JSON.String "data.interface.externalIp" }}{{ end }} - {{ if eq $ip "" }}{{ $ip = .JSON.String "data.data.interface.externalIp" }}{{ end }} - {{ $isp := .JSON.String "isp" }} - {{ if eq $isp "" }}{{ $isp = .JSON.String "data.isp" }}{{ end }} - {{ $server := .JSON.String "server_name" }} - {{ if eq $server "" }}{{ $server = .JSON.String "data.server_name" }}{{ end }} -
-
{{ if ne $ip "" }}{{ $ip }}{{ else }}WAN online{{ end }}
-
Speedtest Tracker
-
{{ if ne $isp "" }}{{ $isp }}{{ else }}{{ $server }}{{ end }}
-
- - - type: custom-api - title: Internet Speed - title-url: https://speedtest.kaleschke.info - cache: 1h - url: http://speedtest-tracker/api/v1/results/latest headers: Authorization: Bearer ${GLANCE_SPEEDTEST_API_KEY} Accept: application/json @@ -428,7 +406,12 @@ Authorization: Bearer ${GLANCE_SPEEDTEST_API_KEY} Accept: application/json template: | - {{ $stats := .Subrequest "stats" }} + {{ $ip := .JSON.String "external_ip" }} + {{ if eq $ip "" }}{{ $ip = .JSON.String "data.interface.externalIp" }}{{ end }} + {{ if eq $ip "" }}{{ $ip = .JSON.String "data.data.interface.externalIp" }}{{ end }} + {{ $isp := .JSON.String "isp" }} + {{ if eq $isp "" }}{{ $isp = .JSON.String "data.isp" }}{{ end }} + {{ if eq $isp "" }}{{ $isp = .JSON.String "data.data.isp" }}{{ end }} {{ $download := .JSON.Float "download" }} {{ if eq $download 0.0 }}{{ $download = .JSON.Float "data.download" }}{{ end }} {{ if eq $download 0.0 }}{{ $download = div (.JSON.Float "download_bits") 1000000.0 }}{{ end }} @@ -442,34 +425,24 @@ {{ $ping := .JSON.Float "ping" }} {{ if eq $ping 0.0 }}{{ $ping = .JSON.Float "data.ping" }}{{ end }} {{ if eq $ping 0.0 }}{{ $ping = .JSON.Float "data.data.ping.latency" }}{{ end }} +
+
{{ if ne $ip "" }}{{ $ip }}{{ else }}WAN online{{ end }}
+
{{ if ne $isp "" }}{{ $isp }}{{ else }}Speedtest Tracker{{ end }}
+
{{ if and (eq $download 0.0) (eq $upload 0.0) }} -
Keine aktuellen Messdaten.
API-Token oder Antwortformat pruefen.
+
Keine aktuellen Messdaten
{{ else }} - {{ $downloadAvg := $stats.JSON.Float "avg_download" }} - {{ if eq $downloadAvg 0.0 }}{{ $downloadAvg = $stats.JSON.Float "data.download.avg" }}{{ end }} - {{ if eq $downloadAvg 0.0 }}{{ $downloadAvg = div ($stats.JSON.Float "data.download.avg_bits") 1000000.0 }}{{ end }} - {{ $uploadAvg := $stats.JSON.Float "avg_upload" }} - {{ if eq $uploadAvg 0.0 }}{{ $uploadAvg = $stats.JSON.Float "data.upload.avg" }}{{ end }} - {{ if eq $uploadAvg 0.0 }}{{ $uploadAvg = div ($stats.JSON.Float "data.upload.avg_bits") 1000000.0 }}{{ end }} - {{ $pingAvg := $stats.JSON.Float "avg_ping" }} - {{ if eq $pingAvg 0.0 }}{{ $pingAvg = $stats.JSON.Float "data.ping.avg" }}{{ end }} - {{ $downloadChange := percentChange $downloadAvg $download }} - {{ $uploadChange := percentChange $uploadAvg $upload }} - {{ $pingChange := percentChange $pingAvg $ping }} -
+
-
{{ printf "%+.1f%%" $downloadChange }}
-
{{ printf "%.1f" $download }}
-
DOWNLOAD
+
{{ printf "%.0f" $download }}
+
DOWN
-
{{ printf "%+.1f%%" $uploadChange }}
-
{{ printf "%.1f" $upload }}
-
UPLOAD
+
{{ printf "%.0f" $upload }}
+
UP
-
{{ printf "%+.1f%%" $pingChange }}
-
{{ printf "%.0f ms" $ping }}
+
{{ printf "%.0f ms" $ping }}
PING
@@ -482,43 +455,28 @@ username: ${GLANCE_ADGUARD_USERNAME} password: ${GLANCE_ADGUARD_PASSWORD} - - type: monitor - title: DNS und VPN - cache: 1m - sites: - - title: AdGuard Home - url: http://192.168.178.58:8082 - check-url: http://adguard - icon: https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/adguard-home.svg - timeout: 5s - alt-status-codes: [200, 302, 401, 403] - - title: Traefik - url: https://traefik.kaleschke.info - check-url: http://traefik:8082/metrics - icon: https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/traefik.svg - timeout: 5s - alt-status-codes: [200, 302, 401, 403] + - type: group + widgets: + - type: docker-containers + title: Network + category: network + hide-by-default: true + sock-path: tcp://glance-docker-socket-proxy:2375 + containers: + $include: containers-map.yml - - type: docker-containers - title: Network Container - category: network - hide-by-default: true - sock-path: tcp://glance-docker-socket-proxy:2375 - containers: - $include: containers-map.yml + - type: docker-containers + title: Apps + category: apps + hide-by-default: true + sock-path: tcp://glance-docker-socket-proxy:2375 + containers: + $include: containers-map.yml - - type: docker-containers - title: App Container - category: apps - hide-by-default: true - sock-path: tcp://glance-docker-socket-proxy:2375 - containers: - $include: containers-map.yml - - - type: docker-containers - title: Ops Container - category: ops - hide-by-default: true - sock-path: tcp://glance-docker-socket-proxy:2375 - containers: - $include: containers-map.yml + - type: docker-containers + title: Ops + category: ops + hide-by-default: true + sock-path: tcp://glance-docker-socket-proxy:2375 + containers: + $include: containers-map.yml diff --git a/ops/glance/config/infrastructure.yml b/ops/glance/config/infrastructure.yml index 48bba6c..45dede0 100644 --- a/ops/glance/config/infrastructure.yml +++ b/ops/glance/config/infrastructure.yml @@ -104,10 +104,10 @@ {{ range .JSON.Array "@this" }}
  • -
    {{ .String "commit.message" }}
    +
    {{ .String "commit.message" | replaceMatches "(?s)\n.*" "" }}
    {{ slice (.String "sha") 0 7 }}
    -
    {{ .String "commit.author.name" }} · {{ .String "commit.author.date" | parseTime "rfc3339" | toRelativeTime }}
    +
    {{ .String "commit.author.name" }} ·
  • {{ end }} @@ -153,29 +153,31 @@ timeout: 5s alt-status-codes: [200, 302, 401, 403] - - type: docker-containers - title: Core Container - category: core - hide-by-default: true - sock-path: tcp://glance-docker-socket-proxy:2375 - containers: - $include: containers-map.yml + - type: group + widgets: + - type: docker-containers + title: Core + category: core + hide-by-default: true + sock-path: tcp://glance-docker-socket-proxy:2375 + containers: + $include: containers-map.yml - - type: docker-containers - title: App Container - category: apps - hide-by-default: true - sock-path: tcp://glance-docker-socket-proxy:2375 - containers: - $include: containers-map.yml + - type: docker-containers + title: Apps + category: apps + hide-by-default: true + sock-path: tcp://glance-docker-socket-proxy:2375 + containers: + $include: containers-map.yml - - type: docker-containers - title: Ops Container - category: ops - hide-by-default: true - sock-path: tcp://glance-docker-socket-proxy:2375 - containers: - $include: containers-map.yml + - type: docker-containers + title: Ops + category: ops + hide-by-default: true + sock-path: tcp://glance-docker-socket-proxy:2375 + containers: + $include: containers-map.yml - size: small widgets: @@ -205,7 +207,7 @@ title: Mealie title-url: https://mealie.kaleschke.info cache: 1h - url: http://mealie:9000/api/app/about/statistics + url: http://mealie:9000/api/admin/about/statistics headers: Authorization: Bearer ${GLANCE_MEALIE_TOKEN} Accept: application/json diff --git a/ops/glance/config/ops.yml b/ops/glance/config/ops.yml index df6cba7..54e8e73 100644 --- a/ops/glance/config/ops.yml +++ b/ops/glance/config/ops.yml @@ -57,8 +57,8 @@
      {{ range .JSON.Array "@this" }}
    • -
      {{ .String "commit.message" }}
      -
      {{ slice (.String "sha") 0 7 }} · {{ .String "commit.author.date" | parseTime "rfc3339" | toRelativeTime }}
      +
      {{ .String "commit.message" | replaceMatches "(?s)\n.*" "" }}
      +
      {{ slice (.String "sha") 0 7 }} ·
    • {{ end }}