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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user