diff --git a/lib/common/static/options_data_stats.js b/lib/common/static/options_data_stats.js
index 1675c51..36e9af2 100644
--- a/lib/common/static/options_data_stats.js
+++ b/lib/common/static/options_data_stats.js
@@ -179,7 +179,7 @@
svg.innerHTML =
'暂无采样数据,请稍后再看';
+ '" font-size="13">暂无已实现盈亏数据';
return;
}
diff --git a/lib/hub/hub_bridge_register.py b/lib/hub/hub_bridge_register.py
index 3feaa6d..7a4234a 100644
--- a/lib/hub/hub_bridge_register.py
+++ b/lib/hub/hub_bridge_register.py
@@ -275,6 +275,30 @@ def register_hub_bridge_routes(app: Flask, app_module: Any) -> None:
return jsonify({"ok": False, "msg": str(e), "version": 1, "enabled": True}), 500
return jsonify(_enrich_hub_protocol(snap, app_module=app_module))
+ @app.route("/api/hub/options/pnl_curve")
+ def api_hub_options_pnl_curve():
+ """中控汇总用:累计已实现盈亏曲线(划转/提现不影响)."""
+ if not hub_bridge_token_ok(request.headers):
+ return jsonify({"ok": False, "msg": "未授权", "version": 1}), 401
+ hub_ctx = app.config.get("HUB_CTX") or {}
+ cfg = hub_ctx.get("options_cfg")
+ if not isinstance(cfg, dict) or not callable(cfg.get("get_db")):
+ return jsonify({"ok": False, "msg": "期权未就绪", "version": 1}), 503
+ range_key = (request.args.get("range") or request.args.get("window") or "7d").strip()
+ conn = cfg["get_db"]()
+ try:
+ from lib.instance.instance_cash_sample_lib import (
+ query_realized_pnl_series_with_db,
+ )
+
+ out = query_realized_pnl_series_with_db(conn, range_key=range_key)
+ out["version"] = 1
+ return jsonify(out)
+ except Exception as e:
+ return jsonify({"ok": False, "msg": str(e) or "曲线失败", "version": 1}), 500
+ finally:
+ conn.close()
+
@app.route("/api/hub/options/stats")
def api_hub_options_stats():
"""中控汇总用:窗口化已实现盈亏统计(不含浮盈进净盈亏主指标以外的展示字段仍附带)."""
diff --git a/lib/instance/templates/options_data_stats_panel.html b/lib/instance/templates/options_data_stats_panel.html
index 935491a..5f03d64 100644
--- a/lib/instance/templates/options_data_stats_panel.html
+++ b/lib/instance/templates/options_data_stats_panel.html
@@ -82,4 +82,4 @@
-
+