From d56889c2e5ffd9d67ad2aab6990782ee8a4fb210 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Wed, 13 May 2026 23:38:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Jinja2=20=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=20dict=20=E8=AE=BF=E9=97=AE=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E5=92=8C=E6=9D=A1=E4=BB=B6=E8=A1=A8=E8=BE=BE=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/monitor_routes.py | 2 +- web/templates/monitor.html | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/web/monitor_routes.py b/web/monitor_routes.py index 2b296b5c..4863f631 100644 --- a/web/monitor_routes.py +++ b/web/monitor_routes.py @@ -97,7 +97,7 @@ def _runway_pairs(city_weather: Dict[str, Any]) -> List[Dict[str, Any]]: result = [] for (r1, r2), (t, _d) in zip(pairs, temps): if t is not None: - result.append({"label": f"{r1}/{r2}", "temp": round(t, 1)}) + result.append({"label": f"{r1}/{r2}", "temp": round(float(t), 1)}) return result def _build_city_card(city: str, city_weather: Dict[str, Any], cfg: Dict[str, Any]) -> Dict[str, Any]: diff --git a/web/templates/monitor.html b/web/templates/monitor.html index 68cc6f0c..4bb84e1c 100644 --- a/web/templates/monitor.html +++ b/web/templates/monitor.html @@ -67,10 +67,8 @@ body{background:#0f1117;color:#c8cdd4;font-family:-apple-system,BlinkMacSystemFo -{% if full_page or not full_page %}
-{% endif %} {{ generated_at }} {% for c in cities %}
@@ -119,8 +117,8 @@ body{background:#0f1117;color:#c8cdd4;font-family:-apple-system,BlinkMacSystemFo
{% for rw in c.runway_pairs %}
- {{ rw.label }} - {{ "%.1f"|format(rw.temp) }}°C + {{ rw["label"] }} + {{ "%.1f"|format(rw["temp"]) }}°C
{% endfor %}