diff --git a/manual_trading_hub/static/app.css b/manual_trading_hub/static/app.css
index 5d633e4..d4cfd81 100644
--- a/manual_trading_hub/static/app.css
+++ b/manual_trading_hub/static/app.css
@@ -1023,6 +1023,25 @@ body.market-chart-fs-open {
min-width: 0;
}
+.hub-pos-card .pos-symbol-time-close,
+.hub-mini-title .pos-symbol-time-close {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ font-size: 0.72rem;
+ font-weight: 500;
+ color: #8fc8ff;
+ padding: 1px 6px;
+ border-radius: 4px;
+ background: rgba(143, 200, 255, 0.1);
+ white-space: nowrap;
+ vertical-align: middle;
+}
+.hub-pos-card .pos-symbol-time-close .pos-time-close-cd,
+.hub-mini-title .pos-symbol-time-close .pos-time-close-cd {
+ font-variant-numeric: tabular-nums;
+ letter-spacing: 0.03em;
+}
.hub-pos-card .pos-card-symbol strong {
font-size: 14px;
color: var(--text);
diff --git a/manual_trading_hub/static/app.js b/manual_trading_hub/static/app.js
index 98431b0..744696d 100644
--- a/manual_trading_hub/static/app.js
+++ b/manual_trading_hub/static/app.js
@@ -1495,6 +1495,9 @@
}
syncMonitorGridColumns(box, displayRows.length);
bindMonitorInteractions(box);
+ if (window.TimeCloseUI && TimeCloseUI.tickLocalCountdowns) {
+ TimeCloseUI.tickLocalCountdowns();
+ }
if (expandedExchangeId && fs && fsInner) {
const row = rows.find((r) => String(r.id) === String(expandedExchangeId));
@@ -1505,6 +1508,9 @@
fs.setAttribute("aria-hidden", "false");
document.body.classList.add("hub-fullscreen-open");
bindMonitorInteractions(fsInner);
+ if (window.TimeCloseUI && TimeCloseUI.tickLocalCountdowns) {
+ TimeCloseUI.tickLocalCountdowns();
+ }
fsInner.querySelectorAll(".btn-expand-back").forEach((btn) => {
btn.onclick = (ev) => {
ev.stopPropagation();
@@ -2073,6 +2079,17 @@
return html;
}
+ function timeCloseSymbolBadgeHtml(item) {
+ if (!item || !item.time_close_enabled) return "";
+ const tcLabel = item.time_close_label || `时间平仓 ${item.time_close_hours || ""}h`;
+ const tcCd = item.time_close_countdown || "--:--:--";
+ const tcAt = item.time_close_at_ms != null ? String(item.time_close_at_ms) : "";
+ return (
+ `
` +
+ `${esc(tcLabel)} · ${esc(tcCd)}`
+ );
+ }
+
function renderTrendDcaTable(t, tickMap) {
const levels = resolveTrendDcaLevels(t);
if (!levels.length) return "";
@@ -2304,26 +2321,18 @@
meta.push(
`
移动保本:${beOn ? "开" : "关"}`
);
- if (mo.time_close_enabled) {
- const tcLabel = mo.time_close_label || `时间平仓 ${mo.time_close_hours || ""}h`;
- const tcCd = mo.time_close_countdown || "--:--:--";
- const tcAt = mo.time_close_at_ms != null ? String(mo.time_close_at_ms) : "";
- meta.push(
- `
` +
- `${esc(tcLabel)} · 倒计时 ${esc(tcCd)}`
- );
- }
} else {
meta.push("来源: 交易所持仓");
meta.push("风格: —");
meta.push(`
移动保本:关`);
}
const symBeBadge = beSecured ? ` ${breakevenBadgeHtml()}` : "";
+ const tcSymBadge = !isTrend && mo.time_close_enabled ? timeCloseSymbolBadgeHtml(mo) : "";
const mktAttrs = marketOpenBtnAttrs(exchangeId, exchangeKey, symbol, pos, monitorOrder, trendPlan);
return `
- ${symBeBadge}
+ ${tcSymBadge}${symBeBadge}
${sideCn}
@@ -2382,8 +2391,14 @@
const amtLine = amtTxt
? `
挂单数量 ${esc(amtTxt)}
`
: "";
+ const keyTc =
+ k.time_close_enabled && k.time_close_at_ms
+ ? timeCloseSymbolBadgeHtml(k)
+ : k.time_close_enabled && k.time_close_hours
+ ? `
时间平仓 ${esc(k.time_close_hours)}h`
+ : "";
return `
-
${esc(k.symbol)} · ${esc(mt)}${dir} ${pendingTag}
+
${esc(k.symbol)} ${keyTc} · ${esc(mt)}${dir} ${pendingTag}
上沿 ${esc(k.upper)} / 下沿 ${esc(k.lower)}
${amtLine}
${esc(kp.gate_summary || kp.price_display || kp.price || "—")}${kp.gate_metrics ? ` · ${esc(kp.gate_metrics)}` : ""}
@@ -2398,8 +2413,9 @@
return orders
.map((o) => {
const sym = o.exchange_symbol || o.symbol || "";
+ const tcBadge = o.time_close_enabled ? timeCloseSymbolBadgeHtml(o) : "";
return `
-
#${esc(o.id)} · ${esc(o.symbol || o.exchange_symbol)} · ${renderDirectionHtml(o.direction)}
+
#${esc(o.id)} · ${esc(o.symbol || o.exchange_symbol)} ${tcBadge} · ${renderDirectionHtml(o.direction)}
触发 ${fmtSymbolPrice(o.trigger_price, sym, tickMap)} · SL ${fmtSymbolPrice(o.stop_loss, sym, tickMap)} · TP ${fmtSymbolPrice(o.take_profit, sym, tickMap)} · ${esc(o.trade_style || o.monitor_type || "下单监控")}
`;
})
diff --git a/manual_trading_hub/static/index.html b/manual_trading_hub/static/index.html
index 371b71d..3b74464 100644
--- a/manual_trading_hub/static/index.html
+++ b/manual_trading_hub/static/index.html
@@ -15,7 +15,7 @@
-
+
@@ -589,6 +589,6 @@
-
+