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
+7 -5
View File
@@ -289,12 +289,14 @@ def build_fund_overview(
live_known = 0
for ex in exchanges or []:
if not _exchange_monitored(ex):
continue
key = str(ex.get("key") or "").strip()
monitored = _exchange_monitored(ex)
row = _live_row_for_exchange(ex, rows_by_key) if monitored else None
monitored = True
row = _live_row_for_exchange(ex, rows_by_key)
fu = tu = total = None
data_ok = False
if monitored and row and row.get("account_ok"):
if row and row.get("account_ok"):
fu = _safe_float(row.get("funding_usdt"))
tu = _safe_float(row.get("trading_usdt"))
total = account_total_usdt(fu, tu)
@@ -303,7 +305,7 @@ def build_fund_overview(
live_total += total
live_known += 1
series = _account_series(history, key) if monitored and key else []
series = _account_series(history, key) if key else []
dd = compute_drawdown([p["total_usdt"] for p in series]) if series else {
"peak_usdt": None,
"max_drawdown_u": None,
@@ -331,7 +333,7 @@ def build_fund_overview(
"day_delta_usdt": day_delta,
}
)
if monitored and key:
if key:
monitored_keys.append(key)
total_series = _series_from_history(history, monitored_keys)