Hide disabled exchanges from dashboard and fund overview.

Only aggregate and display exchanges with enabled monitoring in system settings.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-23 18:41:52 +08:00
parent faa41eece1
commit d3d366d0ee
4 changed files with 21 additions and 14 deletions
+9 -2
View File
@@ -79,8 +79,15 @@ def build_dashboard_payload(
ctx = build_daily_context(exchanges, trading_day=trading_day)
day = ctx["trading_day"]
accounts_raw = ctx.get("accounts") or []
accounts = [_enrich_account_row(ac) for ac in accounts_raw]
closed_trades = collect_closed_trades_snapshot(accounts_raw, today=day)
accounts = [
_enrich_account_row(ac)
for ac in accounts_raw
if ac.get("status") != "未监控"
]
closed_trades = collect_closed_trades_snapshot(
[ac for ac in accounts_raw if ac.get("status") != "未监控"],
today=day,
)
loss_alert_count = sum(1 for ac in accounts if ac.get("loss_alert"))
now = datetime.now(timezone.utc).astimezone().strftime("%Y-%m-%d %H:%M:%S")
return {