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 "" + items.join("") + more + "
";
}
+ 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 '' + items.join("") + more + "
";
+ }
+
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 %}
|