From dc4bbb396d0de1b4f9b8f6ca4e4d7ed156185767 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Mon, 12 Jan 2026 19:19:08 +0100 Subject: [PATCH] added versionchecker widget --- glance-system/glance-kisfenyo.yaml | 174 +++++++++++++++++++++++++++-- 1 file changed, 163 insertions(+), 11 deletions(-) diff --git a/glance-system/glance-kisfenyo.yaml b/glance-system/glance-kisfenyo.yaml index 1c8a7eb..8457b42 100644 --- a/glance-system/glance-kisfenyo.yaml +++ b/glance-system/glance-kisfenyo.yaml @@ -330,17 +330,157 @@ data: - - type: bookmarks - title: Useful Bookmarks - groups: - - title: "" - links: - - title: Kréta - url: https://klik100566001.e-kreta.hu/Intezmeny/Faliujsag - icon: https://web.dooplex.hu/static/white-icons/kreta.png - - title: Hardverapró - url: https://hardverapro.hu - icon: https://web.dooplex.hu/static/white-icons/hardverapro.png + # Glance Widget: Container Version Checker (Simplified) + # + # This is a more robust version that uses only Glance's documented template functions. + # Add this widget to your glance.yml under a column's widgets section. + # Place it right after the "DooPlex Server" widget. + # + # Prerequisites: + # - Deploy version-checker from version-checker.yaml + # - Wait ~5 minutes for initial version checks to complete + + - type: custom-api + title: Container Versions + cache: 5m + url: ${PROMETHEUS_URL}/api/v1/query + parameters: + # Get all images that have updates available (is_latest_version = 0) + query: version_checker_is_latest_version == 0 + subrequests: + # Count of up-to-date images + up_to_date: + url: ${PROMETHEUS_URL}/api/v1/query + parameters: + query: count(version_checker_is_latest_version == 1) or vector(0) + # Count of outdated images + outdated: + url: ${PROMETHEUS_URL}/api/v1/query + parameters: + query: count(version_checker_is_latest_version == 0) or vector(0) + # Total monitored images + total: + url: ${PROMETHEUS_URL}/api/v1/query + parameters: + query: count(version_checker_is_latest_version) or vector(0) + template: | + + + {{ $upToDate := (.Subrequest "up_to_date").JSON.Float "data.result.0.value.1" }} + {{ $outdated := (.Subrequest "outdated").JSON.Float "data.result.0.value.1" }} + {{ $total := (.Subrequest "total").JSON.Float "data.result.0.value.1" }} + {{ $updates := .JSON.Array "data.result" }} + +
+ {{ if gt $total 0.0 }} +
+
+
Current
+
{{ printf "%.0f" $upToDate }}
+
+
+
Updates
+
{{ printf "%.0f" $outdated }}
+
+
+
Total
+
{{ printf "%.0f" $total }}
+
+
+ + {{ if gt $outdated 0.0 }} +
+ {{ range $updates }} +
+ {{ trimPrefix "ghcr.io/" (trimPrefix "docker.io/" (trimPrefix "lscr.io/" (trimPrefix "quay.io/" (.String "metric.image")))) }} + {{ .String "metric.current_version" }} + + {{ .String "metric.latest_version" }} +
+ {{ end }} +
+ {{ else }} +
✓ All images up to date!
+ {{ end }} + {{ else }} +
Waiting for version-checker metrics...
Check back in a few minutes
+ {{ end }} +
# ---------- CENTER COLUMN ---------- - size: full @@ -424,6 +564,18 @@ data: url: https://zipline.dooplex.hu icon: https://web.dooplex.hu/static/white-icons/zipline.png + - type: bookmarks + title: Useful Bookmarks + groups: + - title: "" + links: + - title: Kréta + url: https://klik100566001.e-kreta.hu/Intezmeny/Faliujsag + icon: https://web.dooplex.hu/static/white-icons/kreta.png + - title: Hardverapró + url: https://hardverapro.hu + icon: https://web.dooplex.hu/static/white-icons/hardverapro.png + # ==================== ADMINISTRATION PAGE ==================== - name: Admin slug: admin