From 1240fbb6734ad10b91668635122089b21d9985be Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Wed, 13 May 2026 23:41:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=91=E9=81=93=E6=95=B0=E6=8D=AE=E6=94=B9?= =?UTF-8?q?=E7=94=A8=20tuple=20=E9=81=BF=E5=85=8D=20Jinja2=20dict=20unhash?= =?UTF-8?q?able=20=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/monitor_routes.py | 4 ++-- web/templates/monitor.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/monitor_routes.py b/web/monitor_routes.py index 4863f631..c8a56954 100644 --- a/web/monitor_routes.py +++ b/web/monitor_routes.py @@ -88,7 +88,7 @@ def _obs_age(obs_time_str: Optional[str]) -> Optional[int]: pass return None -def _runway_pairs(city_weather: Dict[str, Any]) -> List[Dict[str, Any]]: +def _runway_pairs(city_weather: Dict[str, Any]) -> list: """Extract runway pairs from AMOS data.""" amos = city_weather.get("amos") or {} rw_obs = (amos.get("runway_obs") or {}) if amos else {} @@ -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(float(t), 1)}) + result.append((f"{r1}/{r2}", 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 4bb84e1c..33f25741 100644 --- a/web/templates/monitor.html +++ b/web/templates/monitor.html @@ -117,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[0] }} + {{ "%.1f"|format(rw[1]) }}°C
{% endfor %}