feat(hub): time-close countdown in monitor position table

Show timed-close badge with live countdown next to contract name in the grid holdings table.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-11 20:24:30 +08:00
parent 0d82cd2ad3
commit a9c40097b3
3 changed files with 14 additions and 5 deletions
+8 -2
View File
@@ -1024,7 +1024,8 @@ body.market-chart-fs-open {
} }
.hub-pos-card .pos-symbol-time-close, .hub-pos-card .pos-symbol-time-close,
.hub-mini-title .pos-symbol-time-close { .hub-mini-title .pos-symbol-time-close,
.td-symbol .pos-symbol-time-close {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
gap: 4px; gap: 4px;
@@ -1038,7 +1039,8 @@ body.market-chart-fs-open {
vertical-align: middle; vertical-align: middle;
} }
.hub-pos-card .pos-symbol-time-close .pos-time-close-cd, .hub-pos-card .pos-symbol-time-close .pos-time-close-cd,
.hub-mini-title .pos-symbol-time-close .pos-time-close-cd { .hub-mini-title .pos-symbol-time-close .pos-time-close-cd,
.td-symbol .pos-symbol-time-close .pos-time-close-cd {
font-variant-numeric: tabular-nums; font-variant-numeric: tabular-nums;
letter-spacing: 0.03em; letter-spacing: 0.03em;
} }
@@ -1166,6 +1168,10 @@ body.market-chart-fs-open {
.data-table .td-symbol { .data-table .td-symbol {
white-space: nowrap; white-space: nowrap;
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 4px 6px;
} }
.hub-pos-card .pos-grid { .hub-pos-card .pos-grid {
+4 -1
View File
@@ -2459,6 +2459,9 @@
const tpAttr = esc(String(tpsl.tp)).replace(/"/g, "&quot;"); const tpAttr = esc(String(tpsl.tp)).replace(/"/g, "&quot;");
const mktAttrs = marketOpenBtnAttrs(exchangeId, exchangeKey, x.symbol, x, monitorOrder, trendPlan); const mktAttrs = marketOpenBtnAttrs(exchangeId, exchangeKey, x.symbol, x, monitorOrder, trendPlan);
const symBeBadge = beSecured ? ` ${breakevenBadgeHtml()}` : ""; const symBeBadge = beSecured ? ` ${breakevenBadgeHtml()}` : "";
const mo = monitorOrder || {};
const tcBadge =
!isTrendContext(mo, trendPlan) && mo.time_close_enabled ? timeCloseSymbolBadgeHtml(mo) : "";
const actionCell = compact const actionCell = compact
? `<button type="button" class="btn-close-pos btn-sm danger" data-ex-id="${esc(exchangeId)}" data-symbol="${symAttr}" data-side="${sideAttr}">平仓</button>` ? `<button type="button" class="btn-close-pos btn-sm danger" data-ex-id="${esc(exchangeId)}" data-symbol="${symAttr}" data-side="${sideAttr}">平仓</button>`
: `<div class="pos-action-group"> : `<div class="pos-action-group">
@@ -2469,7 +2472,7 @@
? `<td class="${pnlCls(x.unrealized_pnl)}">${fmt(x.unrealized_pnl, 2)}</td>` ? `<td class="${pnlCls(x.unrealized_pnl)}">${fmt(x.unrealized_pnl, 2)}</td>`
: ""; : "";
return `<tr> return `<tr>
<td class="td-symbol"><button type="button" class="btn-open-market sym-link" ${mktAttrs} title="打开行情区(含入场/止盈止损)">${esc(x.symbol)}</button>${symBeBadge}</td> <td class="td-symbol"><button type="button" class="btn-open-market sym-link" ${mktAttrs} title="打开行情区(含入场/止盈止损)">${esc(x.symbol)}</button>${tcBadge}${symBeBadge}</td>
<td class="${sideDirCls(x.side)}">${renderDirectionHtml(x.side)}</td> <td class="${sideDirCls(x.side)}">${renderDirectionHtml(x.side)}</td>
<td class="td-entry">${fmtEntryPrice(x, tickMap)}</td> <td class="td-entry">${fmtEntryPrice(x, tickMap)}</td>
<td>${fmtMarkPrice(x, tickMap)}</td> <td>${fmtMarkPrice(x, tickMap)}</td>
+2 -2
View File
@@ -15,7 +15,7 @@
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" media="print" onload="this.media='all'" /> <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" media="print" onload="this.media='all'" />
<noscript><link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" /></noscript> <noscript><link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" /></noscript>
<link rel="stylesheet" href="/assets/app.css?v=20260612-time-close-symbol" /> <link rel="stylesheet" href="/assets/app.css?v=20260612-time-close-table" />
<link rel="stylesheet" href="/assets/dashboard.css?v=20260612-dash-monitor-count" /> <link rel="stylesheet" href="/assets/dashboard.css?v=20260612-dash-monitor-count" />
</head> </head>
<body> <body>
@@ -589,6 +589,6 @@
<script src="/assets/dashboard.js?v=20260612-dash-monitor-count"></script> <script src="/assets/dashboard.js?v=20260612-dash-monitor-count"></script>
<script src="/assets/ai_review_render.js?v=3"></script> <script src="/assets/ai_review_render.js?v=3"></script>
<script src="/assets/time_close_ui.js?v=2"></script> <script src="/assets/time_close_ui.js?v=2"></script>
<script src="/assets/app.js?v=20260612-time-close-symbol"></script> <script src="/assets/app.js?v=20260612-time-close-table"></script>
</body> </body>
</html> </html>