精修 WebUI 第十八轮:后端 /api/version + 预约卡 hover accent

- 后端 gui/web_gui.py 新增 GET /api/version:返回 {name, version, build},前端 footer 自动从 cache-bust fallback 切换为真实版本号
- 预约卡 .reservationItem hover 时左侧浮现 2px primary accent 条;isImminent / isDue 状态下不显示(避免与 warning/danger 边框冲突)
- 高价值直播间共用 reservationItem 视觉,自动获得相同 hover accent
- cache-bust v20 → v21
This commit is contained in:
Codex committed 2026-05-21 09:29:38 +08:00
1 parent 632951d004
commit f16eadbd75
3 files changed
+35 -2

No files matched your search

+10
View File
@@ -1738,6 +1738,16 @@ class Handler(BaseHTTPRequestHandler):
# 提供 CSRF token 给前端
if u.path == "/api/csrf-token":
return self._send_json({"token": _CSRF_TOKEN})
if u.path == "/api/version":
try:
from version import APP_VERSION, APP_BUILD_DATE, APP_NAME
except Exception:
APP_VERSION, APP_BUILD_DATE, APP_NAME = "?", "?", "douyin_guaji"
return self._send_json({
"name": APP_NAME,
"version": str(APP_VERSION).lstrip("Vv"),
"build": APP_BUILD_DATE,
})
if u.path == "/api/devices":
adb = find_adb_executable()
return self._send_json({"adb": adb, "devices": list_adb_devices(adb)})
+2 -2
View File
@@ -15,7 +15,7 @@
} catch (e) {}
})();
</script>
<link rel="stylesheet" href="styles.css?v=console-20260520-theme-v20" />
<link rel="stylesheet" href="styles.css?v=console-20260520-theme-v21" />
</head>
<body>
<div class="app">
@@ -1259,6 +1259,6 @@
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m18 15-6-6-6 6"/></svg>
</button>
<script src="app.js?v=console-20260520-theme-v20"></script>
<script src="app.js?v=console-20260520-theme-v21"></script>
</body>
</html>
+23
View File
@@ -2077,6 +2077,7 @@ input[type="number"]::-webkit-outer-spin-button {
}
.reservationItem {
position: relative;
min-width: 0;
overflow: hidden;
border: 1px solid var(--border);
@@ -2085,11 +2086,33 @@ input[type="number"]::-webkit-outer-spin-button {
transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}
.reservationItem::before {
position: absolute;
left: 0;
top: 10px;
bottom: 10px;
width: 2px;
content: "";
border-radius: 0 2px 2px 0;
background: var(--primary);
opacity: 0;
transition: opacity var(--motion-fast);
}
.reservationItem:hover {
border-color: var(--hover-border);
box-shadow: var(--shadow-soft);
}
.reservationItem:hover::before {
opacity: 0.65;
}
.reservationItem.isImminent::before,
.reservationItem.isDue::before {
display: none;
}
.reservationItem.isImminent {
border-color: var(--warning);
background: color-mix(in oklab, var(--warning-soft) 60%, var(--surface));