diff --git a/static/hub.css b/static/hub.css index 769ca15..c112391 100644 --- a/static/hub.css +++ b/static/hub.css @@ -403,6 +403,14 @@ button, .btn { .pos-brief li { margin: 2px 0; } +.exit-brief .exit-set { + color: var(--ok); + font-weight: 600; +} +.exit-brief .exit-unset { + color: var(--bad); + font-weight: 600; +} .pos-exit { margin-top: 2px; font-size: 0.76rem; diff --git a/static/hub.js b/static/hub.js index f482020..690a736 100644 --- a/static/hub.js +++ b/static/hub.js @@ -52,8 +52,6 @@ const items = list.slice(0, 8).map(function (p) { const id = p.inst_id || ""; const sheets = escapeHtml(String(p.sheets != null ? p.sheets : "—")); - const exitText = formatExitBrief(p); - const exitCls = exitText === "未设出场" ? "muted" : ""; return ( "
  • " + escapeHtml(id) + @@ -61,11 +59,7 @@ sheets + "张 · " + fmtPnlHtml(p.pnl_usdt) + - '
    出场: ' + - escapeHtml(exitText) + - "
  • " + "" ); }); const more = @@ -75,6 +69,21 @@ return ""; } + function exitSummary(brief) { + const list = brief || []; + if (!list.length) return '—'; + const items = list.slice(0, 8).map(function (p) { + const exitText = formatExitBrief(p); + const exitCls = exitText === "未设出场" ? "exit-unset" : "exit-set"; + return '
  • ' + escapeHtml(exitText) + "
  • "; + }); + const more = + list.length > 8 + ? '
  • …共 ' + list.length + " 笔
  • " + : ""; + return '"; + } + function closeActionButtons(brief, instanceId, online) { if (!online) return ""; const list = (brief || []).filter(function (p) { @@ -253,6 +262,9 @@ positionSummary(brief) + "" + "" + + exitSummary(brief) + + "" + + "" + bidLiquiditySummary(brief) + "" + '' + @@ -463,7 +475,7 @@ grid.innerHTML = '
    ' + "" + - "" + + "" + "" + list.map(renderRow).join("") + "
    名称状态模式浮盈权利金资金占比持仓买一/流动性拉取时间操作名称状态模式浮盈权利金资金占比持仓出场买一/流动性拉取时间操作
    "; diff --git a/templates/dashboard.html b/templates/dashboard.html index 922c471..9150f54 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -14,6 +14,6 @@
    {% endblock %} {% block scripts %} - + {% endblock %}