From 4b3ffe22e3e65af91fe7a3ce27edf9aeb82c3ccf Mon Sep 17 00:00:00 2001 From: Pigbibi <20649888+Pigbibi@users.noreply.github.com> Date: Tue, 30 Jun 2026 02:09:38 +0800 Subject: [PATCH] fix(ui): fallback to account defaults when currentStrategies is empty - currentStrategyForAccount: fallback to default_strategy_profile from account option - currentCashOnlyExecutionForAccount: fallback to platform default - pendingCashOnlyExecution: skip false change for empty accounts Co-Authored-By: Claude --- web/strategy-switch-console/index.html | 14 +++++++++++--- web/strategy-switch-console/page_asset.js | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/web/strategy-switch-console/index.html b/web/strategy-switch-console/index.html index e855de5..203caf0 100644 --- a/web/strategy-switch-console/index.html +++ b/web/strategy-switch-console/index.html @@ -2653,7 +2653,12 @@

切换摘要

} function currentCashOnlyExecutionForAccount(platform, account) { - return cleanOptionalBoolean(currentEntryForAccount(platform, account)?.cash_only_execution); + const entry = currentEntryForAccount(platform, account); + if (entry) { + const val = cleanOptionalBoolean(entry.cash_only_execution); + if (val !== null) return val; + } + return platformCashOnlyExecutionDefault(); } function currentCashOnlyExecutionText(platform = state.selected, account = selectedAccount(platform)) { @@ -2789,7 +2794,9 @@

切换摘要

function currentStrategyForAccount(platform, account) { const entry = currentEntryForAccount(platform, account); const profile = cleanStrategyProfile(entry?.strategy_profile); - return profile || ""; + if (profile) return profile; + const fallback = account?.default_strategy_profile || account?.strategy_profile || ""; + return cleanStrategyProfile(fallback); } function currentReservePolicyForAccount(platform, account) { @@ -3526,8 +3533,9 @@

切换摘要

}; } const nextEnabled = mode === "enabled"; + const entry = currentEntryForAccount(platform, account); return { - changed: current !== null && current !== nextEnabled, + changed: Boolean(entry && current !== null && current !== nextEnabled), inputs: { cash_only_execution: nextEnabled }, }; } diff --git a/web/strategy-switch-console/page_asset.js b/web/strategy-switch-console/page_asset.js index c7214ab..aaa9413 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";