From 1c65a3a73a211988692bd037f1464da241adbee0 Mon Sep 17 00:00:00 2001 From: Pigbibi <20649888+Pigbibi@users.noreply.github.com> Date: Tue, 30 Jun 2026 01:57:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20sync=20functions=20now=20show=20actu?= =?UTF-8?q?al=20current=20values=20instead=20of=20=E6=B2=BF=E7=94=A8?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - syncCashOnlyExecutionForAccount: reads entry.cash_only_execution, shows 是/否 - syncOptionOverlayForAccount: reads entry.option_overlay_enabled, shows 开启/关闭 - syncIncomeLayerForAccount: reads entry config, shows enabled/disabled Previously all three defaulted to 'current' dropdown option without showing the actual configured value. Co-Authored-By: Claude --- web/strategy-switch-console/index.html | 25 +++++++++++++++-------- web/strategy-switch-console/page_asset.js | 2 +- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/web/strategy-switch-console/index.html b/web/strategy-switch-console/index.html index 5894534..e855de5 100644 --- a/web/strategy-switch-console/index.html +++ b/web/strategy-switch-console/index.html @@ -2937,7 +2937,12 @@

切换摘要

if (!form || form.incomeLayerTouched) return; const defaults = incomeLayerDefaultForStrategy(form.strategy); const current = currentIncomeLayerForAccount(platform, selectedAccount(platform)); - form.incomeLayerMode = "current"; + const entry = currentEntryForAccount(platform, selectedAccount(platform)); + if (entry && incomeLayerFieldsConfigured(entry)) { + form.incomeLayerMode = current.enabled === false ? "disabled" : "enabled"; + } else { + form.incomeLayerMode = "current"; + } form.incomeLayerStartUsd = current.startUsd || String(defaults?.startUsd || ""); form.incomeLayerMaxRatio = current.maxRatio || defaults?.maxRatio || ""; } @@ -2945,10 +2950,10 @@

切换摘要

function syncOptionOverlayForAccount(platform) { const form = state.forms[platform]; if (!form || form.optionOverlayTouched) return; - const account = selectedAccount(platform); - const configured = normalizeOptionOverlayMode(account?.option_overlay_mode); - if (configured !== "current") { - form.optionOverlayMode = configured; + const entry = currentEntryForAccount(platform, selectedAccount(platform)); + const rawValue = cleanOptionalBoolean(entry?.option_overlay_enabled); + if (rawValue !== null) { + form.optionOverlayMode = rawValue ? "enabled" : "disabled"; return; } form.optionOverlayMode = optionOverlaySupported(form.strategy) ? "current" : "disabled"; @@ -2957,9 +2962,13 @@

切换摘要

function syncCashOnlyExecutionForAccount(platform) { const form = state.forms[platform]; if (!form || form.cashOnlyExecutionTouched) return; - const account = selectedAccount(platform); - const configured = normalizeCashOnlyExecutionMode(account?.cash_only_execution_mode); - form.cashOnlyExecutionMode = configured !== "current" ? configured : "current"; + const entry = currentEntryForAccount(platform, selectedAccount(platform)); + const rawValue = cleanOptionalBoolean(entry?.cash_only_execution); + if (rawValue !== null) { + form.cashOnlyExecutionMode = rawValue ? "enabled" : "disabled"; + return; + } + form.cashOnlyExecutionMode = "current"; } function syncDcaForAccount(platform) { diff --git a/web/strategy-switch-console/page_asset.js b/web/strategy-switch-console/page_asset.js index d6f1c45..c7214ab 100644 --- a/web/strategy-switch-console/page_asset.js +++ b/web/strategy-switch-console/page_asset.js @@ -1,2 +1,2 @@ // Generated by scripts/sync_strategy_switch_page_asset.py; do not edit by hand. -export const PAGE_HTML = "\n\n\n \n \n \n QuantRuntimeSettings Strategy Switch\n \n \n\n\n
\n
\n

策略切换

\n

选平台、目标账号和策略,一次执行完成切换。

\n
\n
\n \n \n \n \n
\n
\n\n
\n
\n 初始化控制台\n

读取策略配置

\n

正在读取登录状态、账号配置和当前状态。

\n
\n
\n
\n\n
\n \n\n
\n
\n
\n 当前平台\n

LongBridge

\n
\n\n \n\n \n\n
\n \n\n \n\n
\n 模式\n
\n \n \n
\n \n
\n\n
\n \n\n \n\n \n
\n\n
\n \n\n \n\n \n
\n\n
\n \n
\n\n
\n

现金与融资

\n

允许融资与预留现金覆盖不能同时生效。

\n \n
\n \n\n \n\n \n\n \n
\n
\n\n
\n \n\n \n
\n
\n\n
\n \n

登录后才可执行切换。

\n

\n
\n
\n\n \n
\n
\n\n \n\n\n"; +export const PAGE_HTML = "\n\n\n \n \n \n QuantRuntimeSettings Strategy Switch\n \n \n\n\n
\n
\n

策略切换

\n

选平台、目标账号和策略,一次执行完成切换。

\n
\n
\n \n \n \n \n
\n
\n\n
\n
\n 初始化控制台\n

读取策略配置

\n

正在读取登录状态、账号配置和当前状态。

\n
\n
\n
\n\n
\n \n\n
\n
\n
\n 当前平台\n

LongBridge

\n
\n\n \n\n \n\n
\n \n\n \n\n
\n 模式\n
\n \n \n
\n \n
\n\n
\n \n\n \n\n \n
\n\n
\n \n\n \n\n \n
\n\n
\n \n
\n\n
\n

现金与融资

\n

允许融资与预留现金覆盖不能同时生效。

\n \n
\n \n\n \n\n \n\n \n
\n
\n\n
\n \n\n \n
\n
\n\n
\n \n

登录后才可执行切换。

\n

\n
\n
\n\n \n
\n
\n\n \n\n\n";