Align instance dashboard with hub snapshot+SSE pattern.

Background poll builds a memory snapshot; the page reads snapshot and refreshes on SSE instead of hitting heavy exchange APIs on each load.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-17 22:00:30 +08:00
parent aabbbef0a9
commit 173f09300b
13 changed files with 492 additions and 86 deletions
+7
View File
@@ -9520,12 +9520,19 @@ register_trade_records_api(
app_tz=APP_TZ,
)
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
register_instance_dashboard_routes(
app,
login_required=login_required,
get_db=get_db,
enrich_orders=_dashboard_enrich_orders,
hedge_enabled=False,
)