From 8b584a087019a68cc603ddd1a13c127a520570b7 Mon Sep 17 00:00:00 2001 From: dekun Date: Sun, 4 Oct 2026 10:17:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E6=8E=A7=E7=89=88=E6=9C=AC=E6=8E=A2?= =?UTF-8?q?=E6=B5=8B=E5=93=8D=E5=BA=94=E5=A2=9E=E5=8A=A0=20trading=20mode?= =?UTF-8?q?=EF=BC=8C=E4=BE=9B=E5=AE=9E=E4=BE=8B=E5=88=97=E8=A1=A8=E6=8C=89?= =?UTF-8?q?=20sim/live=20=E6=8E=92=E5=BA=8F=E5=B1=95=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- lib/hub/hub_bridge_register.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/hub/hub_bridge_register.py b/lib/hub/hub_bridge_register.py index 2cf2fcc..16dbd35 100644 --- a/lib/hub/hub_bridge_register.py +++ b/lib/hub/hub_bridge_register.py @@ -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"])