From fce2365aeef3cc622837e2ae9b3c42dff87b9822 Mon Sep 17 00:00:00 2001 From: Alfred Date: Sun, 15 Feb 2026 05:00:33 +0800 Subject: [PATCH] fix(i18n): complete modal i18n and unify gray bar rounded corners - Import modals: Add custom file picker with t(common.selectFile/noFileSelected) for Config Pack, SSH Host, SSH Command, Data Source, Rule, Action Template - Import modals: Add data-i18n to titles, descriptions, buttons for translateDOM on language switch - Import modals: i18n preview tables (configId, type, signer, official, note, etc.) - Commands page: Add data-i18n for Select Host, Import Command, New Command - en-US: Add missing ssh keys (importSshCmdTitle/Desc, configPackContent, overwriteExisting, etc.) - UI: Data table border-radius to match section cards (border-collapse: separate) - UI: form-control/input border-radius from radius-sm to radius - UI: command-card and cmd-code border-radius --- components/ts_webui/web/css/style.css | 47 ++++- components/ts_webui/web/js/app.js | 223 ++++++++++++++++------- components/ts_webui/web/js/lang/en-US.js | 30 ++- components/ts_webui/web/js/lang/zh-CN.js | 11 +- 4 files changed, 231 insertions(+), 80 deletions(-) diff --git a/components/ts_webui/web/css/style.css b/components/ts_webui/web/css/style.css index 724024a..ffc3ad4 100644 --- a/components/ts_webui/web/css/style.css +++ b/components/ts_webui/web/css/style.css @@ -1190,13 +1190,13 @@ button.btn-gray:hover, box-shadow: 0 0 0 3px var(--blue-50); } -/* Base .input / .form-control class — consistent sizing for inputs outside .form-group */ +/* Base .input / .form-control class — consistent sizing for inputs outside .form-group,圆角与卡片匹配 */ .input, .form-control { width: 100%; padding: 9px 12px; border: 1px solid var(--border); - border-radius: var(--radius-sm); + border-radius: var(--radius); font-size: 0.875rem; font-family: inherit; background: var(--bg-card); @@ -1474,10 +1474,11 @@ button.btn-gray:hover, box-shadow: var(--shadow-lg); } -/* Data table (Tremor style) */ +/* Data table (Tremor style) - 圆角与外层 section 卡片一致,用 separate + border-spacing 以支持 border-radius */ .data-table { width: 100%; - border-collapse: collapse; + border-collapse: separate; + border-spacing: 0; } .data-table th, @@ -1495,6 +1496,22 @@ button.btn-gray:hover, text-transform: none; } +/* 表头首行圆角(与 section 卡片匹配) */ +.data-table thead tr:first-child th:first-child { + border-top-left-radius: var(--radius); +} +.data-table thead tr:first-child th:last-child { + border-top-right-radius: var(--radius); +} + +/* 末行单元格圆角 */ +.data-table tbody tr:last-child td:first-child { + border-bottom-left-radius: var(--radius); +} +.data-table tbody tr:last-child td:last-child { + border-bottom-right-radius: var(--radius); +} + .data-table td { font-size: 0.8125rem; } @@ -1510,7 +1527,7 @@ button.btn-gray:hover, .data-table code { background: var(--bg-muted); padding: 2px 6px; - border-radius: var(--radius-sm); + border-radius: var(--radius); font-size: 0.8em; font-family: var(--font-mono); } @@ -5561,10 +5578,11 @@ button.btn-gray:hover, white-space: nowrap; } -/* 数据表格优化 */ +/* 数据表格优化 - 圆角与 section 卡片一致 */ .page-automation .data-table { width: 100%; - border-collapse: collapse; + border-collapse: separate; + border-spacing: 0; font-size: 0.9rem; table-layout: auto; } @@ -5580,6 +5598,19 @@ button.btn-gray:hover, white-space: nowrap; } +.page-automation .data-table thead tr:first-child th:first-child { + border-top-left-radius: var(--radius); +} +.page-automation .data-table thead tr:first-child th:last-child { + border-top-right-radius: var(--radius); +} +.page-automation .data-table tbody tr:last-child td:first-child { + border-bottom-left-radius: var(--radius); +} +.page-automation .data-table tbody tr:last-child td:last-child { + border-bottom-right-radius: var(--radius); +} + .page-automation .data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); @@ -5593,7 +5624,7 @@ button.btn-gray:hover, .page-automation .data-table code { background: var(--bg-muted); padding: 2px 6px; - border-radius: var(--radius-sm); + border-radius: var(--radius); font-size: 0.85em; } diff --git a/components/ts_webui/web/js/app.js b/components/ts_webui/web/js/app.js index b012d56..5b9b1ed 100644 --- a/components/ts_webui/web/js/app.js +++ b/components/ts_webui/web/js/app.js @@ -773,7 +773,7 @@ async function loadSystemPage() { startDeviceStateMonitor(); } -// 单次刷新(初始加载) +// 单次刷新(初始加载);refreshSystemPage 为别名,供时区/服务操作等调用 async function refreshSystemPageOnce() { // 系统信息 try { @@ -857,6 +857,7 @@ async function refreshSystemPageOnce() { // LPMU 状态检测 await refreshLpmuState(); } +const refreshSystemPage = refreshSystemPageOnce; // ========================================================================= // USB Mux 状态和切换 (支持 ESP32 / AGX / LPMU 三设备循环) @@ -7096,7 +7097,7 @@ async function loadNetworkPage() {