修复持仓监控页长时间空白:品种推荐改为异步加载。
页面先渲染三卡片,推荐表并行拉行情,持仓与推荐分别通过 API 加载。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -289,7 +289,6 @@ def install_trading(app, *, login_required, get_db, get_setting, set_setting, fe
|
||||
capital = _capital(conn)
|
||||
risk = get_risk_status(conn)
|
||||
ctp_acc = _ctp_account(mode) if ctp_st.get("connected") else {}
|
||||
recommend_rows = list_product_recommendations(capital, _main_price)
|
||||
active_trend = conn.execute(
|
||||
"SELECT * FROM trend_pullback_plans WHERE status='active' ORDER BY id DESC LIMIT 1"
|
||||
).fetchone()
|
||||
@@ -309,7 +308,6 @@ def install_trading(app, *, login_required, get_db, get_setting, set_setting, fe
|
||||
risk_status=risk,
|
||||
ctp_status=ctp_st,
|
||||
ctp_account=ctp_acc,
|
||||
recommend_rows=recommend_rows,
|
||||
active_trend=dict(active_trend) if active_trend else None,
|
||||
monitor_count=monitor_count,
|
||||
roll_count=roll_count,
|
||||
|
||||
Reference in New Issue
Block a user