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
+3 -3
View File
@@ -728,7 +728,7 @@ async def _run_dashboard_aggregate() -> dict:
try:
return await asyncio.to_thread(
build_dashboard_payload,
_all_exchanges_for_ai(),
enabled_exchanges(),
trading_day=default_trading_day(),
)
except Exception as exc:
@@ -746,7 +746,7 @@ def api_dashboard_daily(trading_day: str = ""):
return dashboard_store.snapshot_dict()
try:
payload = build_dashboard_payload(
_all_exchanges_for_ai(),
enabled_exchanges(),
trading_day=day,
)
except Exception as exc:
@@ -2598,7 +2598,7 @@ def api_hub_fund_overview():
settings = load_settings()
snap = board_store.snapshot_dict()
payload = build_fund_overview(
settings.get("exchanges") or [],
enabled_exchanges(settings),
board_rows=snap.get("rows") or [],
reset_hour=trading_day_reset_hour(),
updated_at=snap.get("updated_at"),
+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 {