From b29c54f12671a7a9413e68db4f76885cf22b7bb9 Mon Sep 17 00:00:00 2001 From: dekun Date: Tue, 7 Jul 2026 12:14:46 +0800 Subject: [PATCH] fix(settings): restore theme toggle on OKX settings page Co-authored-by: Cursor --- lib/common/static/instance_embed.js | 25 +++++++++++++++++++ lib/common/static/instance_theme.css | 22 +++++++++++++--- lib/instance/templates/embed_shell.html | 4 +-- lib/instance/templates/index.html | 2 +- .../templates/instance_header_panel.html | 13 +--------- .../templates/instance_theme_toggle.html | 12 +++++++++ lib/instance/templates/settings_panel.html | 5 +++- 7 files changed, 64 insertions(+), 19 deletions(-) create mode 100644 lib/instance/templates/instance_theme_toggle.html diff --git a/lib/common/static/instance_embed.js b/lib/common/static/instance_embed.js index 8cbfe78..0963b12 100644 --- a/lib/common/static/instance_embed.js +++ b/lib/common/static/instance_embed.js @@ -238,16 +238,37 @@ tabBooted.clear(); } + function syncShellChrome(tab) { + const onSettings = tab === "settings"; + document.querySelectorAll(".instance-header-panel, .instance-top-bar").forEach((el) => { + el.hidden = onSettings; + }); + } + + function initPaneThemeToggle(tab) { + if (tab !== "settings") return; + const pane = tabPanes.get(tab); + if (!pane || !global.InstanceTheme) return; + if (typeof global.InstanceTheme.initToggleUI === "function") { + global.InstanceTheme.initToggleUI(pane); + } + if (typeof global.InstanceTheme.syncToggleUI === "function") { + global.InstanceTheme.syncToggleUI(pane); + } + } + function activateTab(tab, opts) { const options = opts || {}; const revisit = !!options.revisit; const firstBoot = !tabBooted.has(tab); + syncShellChrome(tab); showPane(tab); setNavActive(tab); if (!options.skipUrl) syncUrl(tab, !!options.replace); notifyParentTabSwitch(tab); if (firstBoot) { bootPaneScripts(tab); + initPaneThemeToggle(tab); runPageInit(tab, { revisit: false }); return; } @@ -409,7 +430,11 @@ patchApplyListWindow(); patchHardNavigations(); initBootPane(); + if (getTab() === "settings") { + initPaneThemeToggle("settings"); + } bindNav(); + syncShellChrome(getTab()); runPageInit(getTab()); preloadAllTabs(); try { diff --git a/lib/common/static/instance_theme.css b/lib/common/static/instance_theme.css index 7c01a7f..1670998 100644 --- a/lib/common/static/instance_theme.css +++ b/lib/common/static/instance_theme.css @@ -2182,6 +2182,13 @@ html[data-theme="light"] .journal-detail-img-thumb { flex-wrap: wrap; } +.settings-account-summary-actions { + display: flex; + align-items: center; + gap: 8px; + flex-shrink: 0; +} + .settings-cards-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); @@ -2464,12 +2471,21 @@ html[data-theme="light"] .settings-kv-value { color: #142232; } -html[data-theme="light"] .settings-export-link { - background: #fff; - border-color: #b8c8d8; +html[data-theme="light"] .settings-export-link, +html[data-theme="light"] .settings-export-links-inline a { + background: transparent; + border-color: transparent; color: #1d4f8c; } +html[data-theme="light"] .settings-side-export { + border-top-color: #d0dae4; +} + +html[data-theme="light"] .settings-side-export-label { + color: #142232; +} + /* OKX 期权页 */ .options-page-wrap { font-size: 0.8rem; diff --git a/lib/instance/templates/embed_shell.html b/lib/instance/templates/embed_shell.html index ee131c0..c7cad0f 100644 --- a/lib/instance/templates/embed_shell.html +++ b/lib/instance/templates/embed_shell.html @@ -7,7 +7,7 @@ - + {{ exchange_display }} · 加密货币 | 交易监控复盘系统 @@ -91,6 +91,6 @@ const ORDER_ENTRY_MODEL_CODE_TO_CATEGORY = {{ entry_model_code_to_category | toj {% include 'embed_boot_scripts.html' %} - + diff --git a/lib/instance/templates/index.html b/lib/instance/templates/index.html index 825cbf8..9b654f4 100644 --- a/lib/instance/templates/index.html +++ b/lib/instance/templates/index.html @@ -17,7 +17,7 @@ {{ exchange_display }} · 加密货币 | 交易监控复盘系统 - + {{ risk_status.status_label|default('正常') }} -
- - -
+ {% include 'instance_theme_toggle.html' %}
diff --git a/lib/instance/templates/instance_theme_toggle.html b/lib/instance/templates/instance_theme_toggle.html new file mode 100644 index 0000000..5ed8615 --- /dev/null +++ b/lib/instance/templates/instance_theme_toggle.html @@ -0,0 +1,12 @@ +
+ + +
diff --git a/lib/instance/templates/settings_panel.html b/lib/instance/templates/settings_panel.html index 30f7c96..57a01f6 100644 --- a/lib/instance/templates/settings_panel.html +++ b/lib/instance/templates/settings_panel.html @@ -6,7 +6,10 @@
{{ exchange_display }}
{{ risk_status.status_label|default('正常') }}
- + {% include 'instance_header_stats.html' %}