diff --git a/lib/common/static/instance_dashboard.js b/lib/common/static/instance_dashboard.js index 4b603ef..b3e7e69 100644 --- a/lib/common/static/instance_dashboard.js +++ b/lib/common/static/instance_dashboard.js @@ -263,7 +263,7 @@ ); }) .join(""); - return tableWrap(["合约", "来源", "类型", "张数", "到期时间", "目标监控", "盈亏"], rows); + return tableWrap(["合约", "来源", "类型", "张数", "到期时间", "目标监控", "净盈亏"], rows); } function renderHedgeTable(items) { diff --git a/lib/common/static/instance_page.css b/lib/common/static/instance_page.css index 0b56f37..6c7c94e 100644 --- a/lib/common/static/instance_page.css +++ b/lib/common/static/instance_page.css @@ -270,10 +270,12 @@ #embed-page-root{min-height:120px;position:relative} .embed-tab-pane[hidden]{display:none!important} .inst-dash-card{grid-column:1/-1} -.inst-dash-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:8px} -.inst-dash-desc{margin:0;font-size:.82rem} -.inst-dash-head-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap} -.inst-dash-status{min-height:1.2em;margin:0 0 10px} +.inst-dash-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:6px} +.inst-dash-card > .inst-dash-head h2{font-size:.88rem;margin:0 0 2px;font-weight:600} +.inst-dash-desc{margin:0;font-size:.72rem;line-height:1.35} +.inst-dash-head-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap} +.inst-dash-updated{font-size:.72rem} +.inst-dash-status{min-height:1.1em;margin:0 0 8px;font-size:.72rem} .inst-dash-sections{display:flex;flex-direction:column;gap:14px} .inst-dash-section{padding:12px;background:#141923;border:1px solid #2a3150;border-radius:10px} .inst-dash-section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px} diff --git a/lib/instance/instance_dashboard_lib.py b/lib/instance/instance_dashboard_lib.py index 831260b..58bece7 100644 --- a/lib/instance/instance_dashboard_lib.py +++ b/lib/instance/instance_dashboard_lib.py @@ -136,15 +136,14 @@ def _format_options_item(p: dict[str, Any], *, conn=None) -> dict[str, Any]: inst = str(p.get("inst_id") or p.get("instId") or "-").strip() or "-" opt_type = str(p.get("opt_type") or p.get("optType") or "").upper() label = "Call" if opt_type == "C" else "Put" if opt_type == "P" else (opt_type or "OPT") - upl = _safe_float(p.get("upl")) - net = None + # 看板期权列固定用净盈亏(买一回收−权利金);残档买一则空. + pnl = None try: from lib.options.options_positions_lib import net_pnl_from_display_row - net = net_pnl_from_display_row(p) + pnl = net_pnl_from_display_row(p) except Exception: - net = None - pnl = net if net is not None else upl + pnl = None pos = _safe_float(p.get("pos")) exp_ms = p.get("exp_time_ms") if exp_ms is None: diff --git a/lib/instance/templates/embed_shell.html b/lib/instance/templates/embed_shell.html index 55c761b..2e36a8f 100644 --- a/lib/instance/templates/embed_shell.html +++ b/lib/instance/templates/embed_shell.html @@ -6,7 +6,7 @@ - + @@ -111,7 +111,7 @@ const ORDER_ENTRY_MODEL_CODE_TO_CATEGORY = {{ entry_model_code_to_category | toj {% include 'embed_boot_scripts.html' %} - + diff --git a/lib/instance/templates/index.html b/lib/instance/templates/index.html index 0d8e58f..77fe4b2 100644 --- a/lib/instance/templates/index.html +++ b/lib/instance/templates/index.html @@ -16,7 +16,7 @@