From 222b89e717865f3a42950fc0e09ff3686ef00ac0 Mon Sep 17 00:00:00 2001 From: AskaEth Date: Sun, 26 Jul 2026 18:33:11 +0800 Subject: [PATCH] feat: settings sub-sidebar for section navigation --- static/css/main.css | 8 ++++++++ static/js/pages/settings.js | 30 +++++++++++++++++++++--------- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/static/css/main.css b/static/css/main.css index 9a71b10..612e755 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -886,3 +886,11 @@ code { transition-duration: 0.01ms !important; } } + +/* ---- Settings Sub-Sidebar ---- */ +.settings-layout { display: flex; gap: 20px; height: 100%; } +.settings-nav { width: 130px; flex-shrink: 0; overflow-y: auto; position: sticky; top: 0; padding-top: 8px; border-right: 1px solid var(--border-subtle); } +.settings-nav-item { display: block; padding: 8px 12px; border-radius: var(--radius-md); color: var(--text-secondary); text-decoration: none; font-size: 13px; transition: all var(--transition-fast); margin-bottom: 2px; } +.settings-nav-item:hover { background: var(--bg-glass-hover); color: var(--text-primary); } +.settings-nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 500; } +.settings-main { flex: 1; overflow-y: auto; min-width: 0; } diff --git a/static/js/pages/settings.js b/static/js/pages/settings.js index 891f7b0..906b681 100644 --- a/static/js/pages/settings.js +++ b/static/js/pages/settings.js @@ -186,25 +186,37 @@ const PageSettings = { }, _template(cfg, games, forwards) { - return '

设置

' + + const sections = [ + { id: 'sec-forward', label: '数据转发' }, + { id: 'sec-connection', label: '连接设置' }, + { id: 'sec-dashboards', label: '仪表盘管理' }, + { id: 'sec-plugins', label: '游戏插件' }, + { id: 'sec-backup', label: '数据备份' }, + { id: 'sec-dev', label: '开发工具' }, + { id: 'sec-system', label: '系统' }, + ]; - '

数据转发

将收到的游戏原始 UDP 数据包完整转发到下游物理外设

' + this._forwardListHtml(forwards) + '
' + + return '
' + + sections.map(s => '' + s.label + '').join('') + + '

设置

' + - '

连接设置

遥测监听端口
全局统一端口
使用游戏独立端口
关闭后切游戏自动切换到各游戏的默认端口

各游戏独立端口

' + this._gamePortListHtml(games, cfg) + '
重启遥测监听
手动重启
' + + '

数据转发

将收到的游戏原始 UDP 数据包完整转发到下游物理外设

' + this._forwardListHtml(forwards) + '
' + - '

仪表盘管理

右键卡片导出
' + + '

连接设置

遥测监听端口
全局统一端口
使用游戏独立端口
关闭后切游戏自动切换到各游戏的默认端口

各游戏独立端口

' + this._gamePortListHtml(games, cfg) + '
重启遥测监听
手动重启
' + - '

游戏插件管理

' + this._gamePluginListHtml(games) + '
' + + '

仪表盘管理

右键卡片导出
' + - '

数据备份

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

游戏插件管理

' + this._gamePluginListHtml(games) + '
' + - '

系统

重启 TurboSu
重新加载所有代码和配置
' + + '

数据备份

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

开发工具

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

开发工具

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

系统

重启 TurboSu
重新加载所有代码和配置
' + '

关于

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