From 76f1d76edaac8f75cd3f773fe4ae3ecae73698a6 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 15 Jan 2026 10:57:41 +0100 Subject: [PATCH] updated tandoor widget to use helper-pod data --- glance-system/glance-kisfenyo.yaml | 128 +++++++++-------------------- 1 file changed, 39 insertions(+), 89 deletions(-) diff --git a/glance-system/glance-kisfenyo.yaml b/glance-system/glance-kisfenyo.yaml index 7c9c6b0..0c8b61e 100644 --- a/glance-system/glance-kisfenyo.yaml +++ b/glance-system/glance-kisfenyo.yaml @@ -629,24 +629,15 @@ data: - type: custom-api title: Meal for the Day - cache: 1d + cache: 5m - # Use the endpoint that definitely exists in your Tandoor - url: ${TANDOOR_URL}/api/recipe/ - headers: - Accept: application/json - Authorization: Bearer ${TANDOOR_TOKEN} + # Served by glance-helper: stable picks for the day + "cooked" support + url: http://glance-helper.glance-system.svc.cluster.local:8000/tandoor/daily + parameters: + count: 3 - # Pass base url into template (NO env() needed) options: - base_url: ${TANDOOR_URL} - - # Use Prometheus time() to make the pick stable for the day - subrequests: - epoch: - url: ${PROMETHEUS_URL}/api/v1/query - parameters: - query: time() + tandoor_url: https://tandoor.dooplex.hu template: | - {{ $base := .Options.StringOr "base_url" "https://tandoor.dooplex.hu" }} - {{ $recipes := .JSON.Array "results" }} - {{ $n := len $recipes }} + {{ $tandoor := .Options.StringOr "tandoor_url" "https://tandoor.dooplex.hu" }} + {{ $items := .JSON.Array "items" }} + {{ $total := .JSON.Int "total_recipes" }} + {{ $date := .JSON.String "date" }} - {{ if lt $n 1 }} -
-
No recipes returned from Tandoor.
-
- Check token / permissions - Open Tandoor -
+
+
+ Today’s picks ({{ $total }} total) + Open Tandoor
- {{ else }} - - {{ $epoch := (.Subrequest "epoch").JSON.Float "data.result.0.value.1" }} - {{ $day := div $epoch 86400.0 | toInt }} - - {{ $i0 := mod $day $n }} - {{ $i1 := mod (add $i0 1) $n }} - {{ $i2 := mod (add $i0 2) $n }} - - {{ $p0 := print "results." $i0 }} - {{ $p1 := print "results." $i1 }} - {{ $p2 := print "results." $i2 }} - - {{ $id0 := .JSON.Int (print $p0 ".id") }} - {{ $nm0 := .JSON.String (print $p0 ".name") }} - {{ $im0 := .JSON.String (print $p0 ".image") }} - - {{ $id1 := .JSON.Int (print $p1 ".id") }} - {{ $nm1 := .JSON.String (print $p1 ".name") }} - {{ $im1 := .JSON.String (print $p1 ".image") }} - - {{ $id2 := .JSON.Int (print $p2 ".id") }} - {{ $nm2 := .JSON.String (print $p2 ".name") }} - {{ $im2 := .JSON.String (print $p2 ".image") }} - -
-
- Today’s picks ({{ printf "%d" $n }} total) - Open Tandoor -
+ {{ if lt (len $items) 1 }} +
No recipes returned.
+ {{ else }}
- + {{ range $i, $r := $items }} + {{ $name := $r.String "name" }} + {{ $img := $r.String "image" }} + {{ $url := $r.String "url" }} + {{ $cook := $r.String "cook_url" }} - -
- - {{ end }} - - + {{ end }} +
# ---------- CENTER COLUMN ---------- - size: full @@ -2180,10 +2134,6 @@ spec: value: "http://uptimekuma.uptimekuma-system.svc.cluster.local:3001" - name: UPTIME_KUMA_STATUS_SLUG value: "homepage" - - name: TANDOOR_URL - value: "https://tandoor.dooplex.hu" - - name: TANDOOR_TOKEN - value: "tda_8a8b169c_5d1f_4962_83a2_0f2719c7d61a" ports: - name: http containerPort: 8080