中控版本探测响应增加 trading mode,供实例列表按 sim/live 排序展示。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -397,6 +397,18 @@ def register_hub_bridge_routes(app: Flask, app_module: Any) -> None:
|
|||||||
|
|
||||||
ver = read_git_version()
|
ver = read_git_version()
|
||||||
ver["online"] = True
|
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)
|
return jsonify(ver)
|
||||||
|
|
||||||
@app.route("/api/hub/update", methods=["POST"])
|
@app.route("/api/hub/update", methods=["POST"])
|
||||||
|
|||||||
Reference in New Issue
Block a user