Show hub fullscreen options positions as cards matching instance data.

Enrich hub options snapshot with close preview and render read-only option position cards in exchange fullscreen view.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-11 09:40:35 +08:00
parent baf94b4feb
commit 843d87422d
8 changed files with 292 additions and 23 deletions
+11
View File
@@ -773,6 +773,7 @@ _TRADE_STATS_CALENDAR_JS = _REPO_STATIC / "trade_stats_calendar.js"
_ACCOUNT_RISK_BADGE_CSS = _REPO_STATIC / "account_risk_badge.css"
_ACCOUNT_RISK_BADGE_JS = _REPO_STATIC / "account_risk_badge.js"
_OPTIONS_EXPIRY_COUNTDOWN_JS = _REPO_STATIC / "options_expiry_countdown.js"
_OPTIONS_POSITION_CARDS_JS = _REPO_STATIC / "options_position_cards.js"
@app.get("/assets/account_risk_badge.css")
@@ -807,6 +808,16 @@ def hub_options_expiry_countdown_js():
)
@app.get("/assets/options_position_cards.js")
def hub_options_position_cards_js():
if not _OPTIONS_POSITION_CARDS_JS.is_file():
raise HTTPException(status_code=404, detail="options_position_cards.js not found")
return FileResponse(
str(_OPTIONS_POSITION_CARDS_JS),
media_type="application/javascript; charset=utf-8",
)
@app.get("/assets/ai_review_render.js")
def hub_ai_review_render_js():
"""与三所实例共用仓库根 static/ai_review_render.js(须在 /assets mount 之前注册)."""