From cd2106dbf87335844f02caee5a72a66d7950e701 Mon Sep 17 00:00:00 2001 From: AskaEth Date: Sun, 26 Jul 2026 18:26:29 +0800 Subject: [PATCH] fix: auto-start test mode on boot if config says on; Miuix toggle switch style --- app.py | 3 +++ static/css/main.css | 8 ++++++++ static/js/pages/settings.js | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 8b83b18..b8d5353 100644 --- a/app.py +++ b/app.py @@ -34,6 +34,9 @@ async def lifespan(app: FastAPI): logger.info("Server config: %s:%d", cfg.get("server_host", "0.0.0.0"), cfg.get("server_port", 9527)) await telemetry_listener.start() logger.info("Telemetry listener auto-started") + if cfg.get("ui_test_mode"): + telemetry_listener.start_test_mode() + logger.info("Test mode auto-started (config)") yield telemetry_listener.stop() logger.info("TurboSu shutdown complete") diff --git a/static/css/main.css b/static/css/main.css index a987970..9a71b10 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -519,6 +519,14 @@ .forward-toggle input { margin-right: 4px; } +/* HyperOS Toggle Switch */ +.switch-label { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; } +.switch-label input { display: none; } +.switch-track { position: relative; width: 44px; height: 26px; background: var(--bg-tertiary); border-radius: 13px; border: 1px solid var(--border-normal); transition: background .2s, border-color .2s; flex-shrink: 0; } +.switch-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.15); } +.switch-label input:checked + .switch-track { background: var(--accent); border-color: var(--accent); } +.switch-label input:checked + .switch-track::after { transform: translateX(18px); } + /* ===== Debug Page ===== */ .debug-container { display: flex; diff --git a/static/js/pages/settings.js b/static/js/pages/settings.js index 861b5e4..8a11292 100644 --- a/static/js/pages/settings.js +++ b/static/js/pages/settings.js @@ -175,7 +175,7 @@ const PageSettings = { '

数据备份

导出全量备份
打包仪表盘+场景+配置为 .tsb 文件
' + - '

开发工具

UI 测试模式
本地随机模拟遥测数据
' + + '

开发工具

UI 测试模式
本地随机模拟遥测数据
' + '

关于

TurboSu
赛车遥测仪表盘 · Yei.J. (AskaEth)
' +