Align instance dashboard with snapshot+SSE and options net PnL.
Only dashboard path changes: background snapshot, SSE refresh, smaller header type, options net PnL. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9050,14 +9050,17 @@ def _dashboard_fetch_options_positions():
|
||||
if not isinstance(cfg, dict) or not cfg.get("enabled"):
|
||||
return []
|
||||
try:
|
||||
from lib.options.options_hub_lib import build_options_hub_snapshot
|
||||
from lib.options.options_dashboard_lib import fetch_light_option_positions_for_dashboard
|
||||
|
||||
snap = build_options_hub_snapshot(cfg)
|
||||
return fetch_light_option_positions_for_dashboard(cfg)
|
||||
except Exception:
|
||||
return []
|
||||
if not snap.get("ok"):
|
||||
return []
|
||||
return list(snap.get("positions") or [])
|
||||
|
||||
|
||||
def _dashboard_enrich_orders(items):
|
||||
from lib.instance.instance_dashboard_lib import enrich_order_items_with_marks
|
||||
|
||||
return enrich_order_items_with_marks(items, get_price=get_price)
|
||||
|
||||
|
||||
from lib.instance.instance_dashboard_register import register_instance_dashboard_routes
|
||||
@@ -9067,6 +9070,7 @@ register_instance_dashboard_routes(
|
||||
login_required=login_required,
|
||||
get_db=get_db,
|
||||
fetch_options_positions=_dashboard_fetch_options_positions,
|
||||
enrich_orders=_dashboard_enrich_orders,
|
||||
hedge_enabled=os.getenv("HEDGE_PLAN_ENABLED", "false").lower() in ("1", "true", "yes", "on"),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user