37 lines
1.2 KiB
Django/Jinja
37 lines
1.2 KiB
Django/Jinja
<div hx-get="/?htmx" hx-trigger="every 2s" hx-target="main"></div>
|
|
|
|
<h1>Overview</h1>
|
|
|
|
<article class="card">
|
|
<div class="contents">
|
|
<div>
|
|
<b>Count {{ stats.count }}</b> <br>
|
|
<b>TVOC min {{ stats.tvoc_min.tvoc }}</b> @ {{ stats.tvoc_min.timestamp|format_datetime }} <b>max {{ stats.tvoc_max.tvoc }}</b> @ {{ stats.tvoc_max.timestamp|format_datetime }} <br>
|
|
<b>CO2 min {{ stats.co2_min.co2 }}</b> @ {{ stats.co2_min.timestamp|format_datetime }} <b>max {{ stats.co2_max.co2 }}</b> @ {{ stats.co2_max.timestamp|format_datetime }}
|
|
</div>
|
|
</div>
|
|
</article>
|
|
|
|
<h2>Recent measurements</h2>
|
|
|
|
{% for row in list %}
|
|
<article class="card">
|
|
<div class="contents">
|
|
<header>@ {{row['timestamp']|format_datetime}}</header>
|
|
<div>
|
|
CO2: <b>{{row['co2']}}</b>
|
|
TVOC: <b>{{row['tvoc']}}</b>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
{% else %}
|
|
<article class="card">
|
|
<div class="contents">
|
|
<header>No measurements yet.</header>
|
|
</div>
|
|
</article>
|
|
{% endfor %}
|
|
|
|
<div>
|
|
<a href="/measurements" class="btn btn-link">View measurements</a>
|
|
</div>
|