更新html

This commit is contained in:
2569718930@qq.com
2026-05-13 21:26:26 +08:00
parent d97bb76480
commit 7555da8e6a
+7 -4
View File
@@ -1,6 +1,7 @@
{% if full_page %} {% if full_page %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh"> <html lang="zh">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
@@ -8,6 +9,7 @@
<link rel="stylesheet" href="/static/style.css"> <link rel="stylesheet" href="/static/style.css">
<meta http-equiv="refresh" content="120"> <meta http-equiv="refresh" content="120">
</head> </head>
<body> <body>
<div class="page"> <div class="page">
<header class="header"> <header class="header">
@@ -16,13 +18,12 @@
<button id="notify-toggle" class="notify-btn" onclick="toggleNotify()" title="新高提醒"> <button id="notify-toggle" class="notify-btn" onclick="toggleNotify()" title="新高提醒">
<span id="notify-icon">🔔</span> <span id="notify-icon">🔔</span>
</button> </button>
<span class="updated" id="update-time">更新中…</span>
</div> </div>
</header> </header>
{% endif %} {% endif %}
<div id="card-grid" class="card-grid" <div id="card-grid" class="card-grid" hx-get="/api/data" hx-trigger="every 30s" hx-swap="outerHTML"
hx-get="/api/data" hx-trigger="every 30s" hx-swap="outerHTML" hx-indicator="#spinner"> hx-indicator="#spinner">
<span class="updated" style="display:block;grid-column:1/-1;text-align:right;margin-bottom:2px"> <span class="updated" style="display:block;grid-column:1/-1;text-align:right;margin-bottom:2px">
{{ generated_at }}</span> {{ generated_at }}</span>
{% for c in cities %} {% for c in cities %}
@@ -36,7 +37,8 @@
<div class="card-temp"> <div class="card-temp">
{% match c.current_temp %} {% match c.current_temp %}
{% when Some with (t) %} {% when Some with (t) %}
<span class="temp-value{% if c.temp_warm %} warm{% endif %}{% if c.new_high %} new-high-val{% endif %}">{{ "{:.1}"|format(t) }}</span><span class="temp-unit">°C</span> <span class="temp-value{% if c.temp_warm %} warm{% endif %}{% if c.new_high %} new-high-val{% endif %}">{{
"{:.1}"|format(t) }}</span><span class="temp-unit">°C</span>
{% when None %} {% when None %}
<span class="temp-value na">--</span> <span class="temp-value na">--</span>
{% endmatch %} {% endmatch %}
@@ -160,5 +162,6 @@ updateNotifyIcon();
</script> </script>
</div> </div>
</body> </body>
</html> </html>
{% endif %} {% endif %}