Fix dashboard mobile load issues and simplify card layout.

Reduce poll pressure on phone/tablet, cache key prices, and handle live API errors gracefully. Rework mobile position and close cards with inline direction, compact P/L line, and detail modal.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-29 23:10:20 +08:00
parent d1ad0f9253
commit 2f5b5c4aae
6 changed files with 225 additions and 34 deletions
+12 -8
View File
@@ -1667,14 +1667,18 @@ def api_dashboard_live():
from dashboard_lib import build_dashboard_payload
_dashboard_sync_tick["n"] += 1
sync_trades = _dashboard_sync_tick["n"] % 5 == 0
payload = build_dashboard_payload(
get_db=get_db,
get_setting=get_setting,
fetch_price=fetch_price,
sync_ctp_trades=sync_trades,
)
return jsonify(payload)
sync_trades = _dashboard_sync_tick["n"] % 15 == 0
try:
payload = build_dashboard_payload(
get_db=get_db,
get_setting=get_setting,
fetch_price=fetch_price,
sync_ctp_trades=sync_trades,
)
return jsonify(payload)
except Exception as exc:
app.logger.exception("dashboard live: %s", exc)
return jsonify({"ok": False, "error": "看板数据暂时不可用"}), 503
@app.route("/market")