中控版本探测响应增加 trading mode,供实例列表按 sim/live 排序展示。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-04 10:17:04 +08:00
parent 4bea770f5c
commit 8b584a0870
+12
View File
@@ -397,6 +397,18 @@ def register_hub_bridge_routes(app: Flask, app_module: Any) -> None:
ver = read_git_version()
ver["online"] = True
mode = "live"
try:
from lib.sim.mode_lib import exchange_mode_label, is_sim_mode
get_db = getattr(app_module, "get_db", None)
if callable(get_db) and is_sim_mode(get_db):
mode = "sim"
ver["mode"] = mode
if callable(get_db):
ver["mode_label"] = exchange_mode_label(get_db=get_db, exchange_key="okx") or ""
except Exception:
ver["mode"] = mode
return jsonify(ver)
@app.route("/api/hub/update", methods=["POST"])