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 }} -