added versionchecker widget

This commit is contained in:
2026-01-12 19:19:08 +01:00
parent fe5528b184
commit dc4bbb396d
+163 -11
View File
@@ -330,17 +330,157 @@ data:
</div>
</div>
- 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: |
<style>
.ver-widget { font-size: 0.9em; }
.ver-summary {
display: flex;
gap: 12px;
margin-bottom: 12px;
padding: 8px;
background: rgba(255,255,255,0.03);
border-radius: 8px;
}
.ver-stat {
flex: 1;
text-align: center;
padding: 4px;
}
.ver-label {
font-size: 0.7em;
opacity: 0.6;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.ver-value {
font-size: 1.4em;
font-weight: 600;
margin-top: 2px;
}
.ver-ok { color: #4ade80; }
.ver-warn { color: #fbbf24; }
.ver-info { color: #5ac8d8; }
.ver-list {
max-height: 220px;
overflow-y: auto;
}
.ver-row {
display: grid;
grid-template-columns: 1fr auto auto auto;
align-items: center;
gap: 4px;
padding: 5px 0;
border-bottom: 1px solid rgba(255,255,255,0.08);
font-size: 0.82em;
}
.ver-row:last-child { border-bottom: none; }
.ver-img {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
opacity: 0.9;
}
.ver-cur {
color: #f87171;
font-family: monospace;
font-size: 0.95em;
}
.ver-arr {
color: rgba(255,255,255,0.3);
padding: 0 2px;
}
.ver-lat {
color: #4ade80;
font-family: monospace;
font-size: 0.95em;
}
.ver-allok {
text-align: center;
padding: 16px;
color: #4ade80;
opacity: 0.85;
}
.ver-nodata {
text-align: center;
padding: 16px;
opacity: 0.5;
font-size: 0.9em;
}
</style>
{{ $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" }}
<div class="ver-widget">
{{ if gt $total 0.0 }}
<div class="ver-summary">
<div class="ver-stat">
<div class="ver-label">Current</div>
<div class="ver-value ver-ok">{{ printf "%.0f" $upToDate }}</div>
</div>
<div class="ver-stat">
<div class="ver-label">Updates</div>
<div class="ver-value ver-warn">{{ printf "%.0f" $outdated }}</div>
</div>
<div class="ver-stat">
<div class="ver-label">Total</div>
<div class="ver-value ver-info">{{ printf "%.0f" $total }}</div>
</div>
</div>
{{ if gt $outdated 0.0 }}
<div class="ver-list">
{{ range $updates }}
<div class="ver-row" title="{{ .String "metric.image" }}">
<span class="ver-img">{{ trimPrefix "ghcr.io/" (trimPrefix "docker.io/" (trimPrefix "lscr.io/" (trimPrefix "quay.io/" (.String "metric.image")))) }}</span>
<span class="ver-cur">{{ .String "metric.current_version" }}</span>
<span class="ver-arr">→</span>
<span class="ver-lat">{{ .String "metric.latest_version" }}</span>
</div>
{{ end }}
</div>
{{ else }}
<div class="ver-allok">✓ All images up to date!</div>
{{ end }}
{{ else }}
<div class="ver-nodata">Waiting for version-checker metrics...<br><small>Check back in a few minutes</small></div>
{{ end }}
</div>
# ---------- 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