fix: resolve Glance template parsing conflict with Go template syntax
- Wrap Go template syntax in Jinja2 raw blocks to prevent parsing conflicts - Fix custom-api air quality widget template rendering - Update Glance dashboard layout with search widget and head-widgets 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -1,48 +1,8 @@
|
||||
pages:
|
||||
- name: Home
|
||||
columns:
|
||||
- size: small
|
||||
widgets:
|
||||
- type: calendar
|
||||
|
||||
- type: server-stats
|
||||
servers:
|
||||
- type: local
|
||||
name: Services
|
||||
|
||||
- size: full
|
||||
widgets:
|
||||
- type: group
|
||||
widgets:
|
||||
- type: hacker-news
|
||||
- type: rss
|
||||
limit: 10
|
||||
collapse-after: 3
|
||||
cache: 3h
|
||||
feeds:
|
||||
- url: https://kill-the-newsletter.com/feeds/ij4twrnzhrwvyic13qcm.xml
|
||||
- url: https://mrmoneymustache.ck.page/68f9e9826c
|
||||
- type: rss
|
||||
title: Gear
|
||||
limit: 10
|
||||
collapse-after: 3
|
||||
cache: 3h
|
||||
feeds:
|
||||
- url: https://9to5toys.com/steals/feed
|
||||
- url: https://hiro.report/rss/
|
||||
- type: change-detection
|
||||
instance-url: https://watcher.thesatelliteoflove.com
|
||||
token: ac69ae11570548549d6706eac6dbb6a9
|
||||
- type: docker-containers
|
||||
hide-by-default: false
|
||||
|
||||
- size: small
|
||||
widgets:
|
||||
- type: weather
|
||||
location: Nederland, Colorado, United States
|
||||
units: imperial
|
||||
|
||||
head-widgets:
|
||||
- type: markets
|
||||
hide-header: true
|
||||
markets:
|
||||
- symbol: SPY
|
||||
name: S&P 500
|
||||
@ -54,12 +14,77 @@ pages:
|
||||
name: VanEck Uranium+Nuclear Energy
|
||||
- symbol: BITO
|
||||
name: Bitcoin ETF
|
||||
- symbol: GOOGL
|
||||
name: Google
|
||||
- symbol: AMD
|
||||
name: AMD
|
||||
- symbol: DJT
|
||||
name: Trump Media
|
||||
|
||||
columns:
|
||||
|
||||
- size: full
|
||||
widgets:
|
||||
- type: search
|
||||
search-engine: kagi
|
||||
new-tab: true
|
||||
|
||||
- size: small
|
||||
widgets:
|
||||
- type: weather
|
||||
location: Nederland, Colorado, United States
|
||||
units: imperial
|
||||
|
||||
- type: custom-api
|
||||
title: Air Quality
|
||||
cache: 10m
|
||||
url: https://api.waqi.info/feed/geo:39.9676367;-105.4037992/?token={{ vault_glance.air_quality_key }}
|
||||
template: |
|
||||
{% raw %}{{ $aqi := printf "%03s" (.JSON.String "data.aqi") }}
|
||||
{{ $aqiraw := .JSON.String "data.aqi" }}
|
||||
{{ $updated := .JSON.String "data.time.iso" }}
|
||||
{{ $humidity := .JSON.String "data.iaqi.h.v" }}
|
||||
{{ $ozone := .JSON.String "data.iaqi.o3.v" }}
|
||||
{{ $pm25 := .JSON.String "data.iaqi.pm25.v" }}
|
||||
{{ $pressure := .JSON.String "data.iaqi.p.v" }}
|
||||
|
||||
<div class="flex justify-between">
|
||||
<div class="size-h5">
|
||||
{{ if le $aqi "050" }}
|
||||
<div class="color-positive">Good air quality</div>
|
||||
{{ else if le $aqi "100" }}
|
||||
<div class="color-primary">Moderate air quality</div>
|
||||
{{ else }}
|
||||
<div class="color-negative">Bad air quality</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="color-highlight size-h2">AQI: {{ $aqiraw }}</div>
|
||||
<div style="border-bottom: 1px solid; margin-block: 10px;"></div>
|
||||
|
||||
<div class="margin-block-2">
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px;">
|
||||
|
||||
<div>
|
||||
<div class="size-h3 color-highlight">{{ $humidity }}%</div>
|
||||
<div class="size-h6">HUMIDITY</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="size-h3 color-highlight">{{ $ozone }} μg/m³</div>
|
||||
<div class="size-h6">OZONE</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="size-h3 color-highlight">{{ $pm25 }} μg/m³</div>
|
||||
<div class="size-h6">PM2.5</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="size-h3 color-highlight">{{ $pressure }} hPa</div>
|
||||
<div class="size-h6">PRESSURE</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="size-h6" style="margin-top: 10px;">Last Updated at {{ slice $updated 11 16 }}</div>
|
||||
</div>{% endraw %}
|
||||
|
||||
- name: Mini Painting
|
||||
columns:
|
||||
- size: small
|
||||
|
Reference in New Issue
Block a user