更新中控
This commit is contained in:
@@ -62,7 +62,7 @@ _allow_pub_raw = (os.getenv("HUB_ALLOW_PUBLIC") or "").strip().lower()
|
||||
# 云服务器 + 域名反代时设为 true:不做 IP 限制,仅靠 HUB_PASSWORD / 登录页保护
|
||||
HUB_ALLOW_PUBLIC = _allow_pub_raw in ("1", "true", "yes", "on")
|
||||
DIR = Path(__file__).resolve().parent
|
||||
HUB_BUILD = "20260525-ui-dir"
|
||||
HUB_BUILD = "20260526-hub-qty"
|
||||
HUB_AGENT_TIMEOUT = float(os.getenv("HUB_AGENT_TIMEOUT", "8"))
|
||||
HUB_FLASK_TIMEOUT = float(os.getenv("HUB_FLASK_TIMEOUT", "10"))
|
||||
_board_key_prices_raw = (os.getenv("HUB_BOARD_KEY_PRICES", "true") or "").strip().lower()
|
||||
|
||||
@@ -116,6 +116,14 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
function fmtKeyOrderAmount(keyRow) {
|
||||
const raw = keyRow.fib_order_amount;
|
||||
if (raw == null || raw === "") return "";
|
||||
const n = Number(raw);
|
||||
if (!Number.isFinite(n) || n <= 0) return "";
|
||||
return `${fmt(n, 4)} 张`;
|
||||
}
|
||||
|
||||
/** 全屏持仓区:按仓位数量附加布局 class(1~6 固定列数,7+ 自动填充) */
|
||||
function hubPosListCountClass(n) {
|
||||
const c = Math.max(0, parseInt(n, 10) || 0);
|
||||
@@ -629,9 +637,14 @@
|
||||
const pendingTag = pending
|
||||
? `<span class="hub-key-pending-tag">挂单中</span>`
|
||||
: "";
|
||||
const amtTxt = fmtKeyOrderAmount(k);
|
||||
const amtLine = amtTxt
|
||||
? `<div class="hub-mini-line">挂单数量 ${esc(amtTxt)}</div>`
|
||||
: "";
|
||||
return `<div class="${cardCls}">
|
||||
<div class="hub-mini-title">${esc(k.symbol)} · ${esc(mt)}${dir} ${pendingTag}</div>
|
||||
<div class="hub-mini-line">上沿 ${esc(k.upper)} / 下沿 ${esc(k.lower)}</div>
|
||||
${amtLine}
|
||||
<div class="hub-mini-line hub-key-status-line">${esc(kp.gate_summary || kp.price_display || kp.price || "—")}${kp.gate_metrics ? ` · ${esc(kp.gate_metrics)}` : ""}</div>
|
||||
</div>`;
|
||||
})
|
||||
@@ -709,7 +722,7 @@
|
||||
<div class="stat-box"><div class="stat-label">余额</div><div class="stat-value">${fmt(ag.balance_usdt, 2)} <small style="font-size:12px;color:var(--muted)">U</small></div></div>
|
||||
<div class="stat-box"><div class="stat-label">浮盈合计</div><div class="stat-value ${pnlCls(ag.total_unrealized_pnl)}">${fmt(ag.total_unrealized_pnl, 4)}</div></div>
|
||||
</div>`;
|
||||
inner += `<div class="section-title">交易所持仓</div>`;
|
||||
inner += `<div class="section-title">交易所持仓 · ${pos.length} 仓</div>`;
|
||||
if (pos.length) {
|
||||
inner += pos.map((p) => renderPositionBlock(row.id, p)).join("");
|
||||
} else {
|
||||
@@ -722,7 +735,7 @@
|
||||
});
|
||||
}
|
||||
if ((row.capabilities || []).includes("key")) {
|
||||
inner += `<div class="section-title">关键位</div>`;
|
||||
inner += `<div class="section-title">关键位 · ${keys.length}</div>`;
|
||||
if (!flaskOk) {
|
||||
const fe = row.flask_error || hm.msg || hm.error || "策略 Flask 未连通";
|
||||
inner += `<div class="err">${esc(fe)}</div>`;
|
||||
@@ -737,6 +750,8 @@
|
||||
let line = `${esc(k.symbol)} · ${esc(mt)}`;
|
||||
if (k.direction) line += ` · ${renderDirectionHtml(k.direction)}`;
|
||||
if (pending) line += ` · <span class="hub-key-pending-tag">挂单</span>`;
|
||||
const amtTxt = fmtKeyOrderAmount(k);
|
||||
if (amtTxt) line += ` · 数量 ${esc(amtTxt)}`;
|
||||
line += ` · ${esc(k.upper)} / ${esc(k.lower)}`;
|
||||
if (kp.price_display != null || kp.price != null) {
|
||||
line += ` · ${esc(kp.price_display != null ? kp.price_display : kp.price)}`;
|
||||
@@ -812,7 +827,11 @@
|
||||
if (!flaskOk) {
|
||||
html += renderHubSectionCard("关键位", `<div class="err">${esc(row.flask_error || hm.error || "Flask 未连通")}</div>`, "");
|
||||
} else {
|
||||
html += renderHubSectionCard("关键位", renderKeySection(keys, kmap), "当前无关键位记录");
|
||||
html += renderHubSectionCard(
|
||||
`关键位 · ${keys.length}`,
|
||||
renderKeySection(keys, kmap),
|
||||
"当前无关键位记录"
|
||||
);
|
||||
}
|
||||
}
|
||||
html += renderHubSectionCard("下单监控", renderOrderMonitorSection(orders), "暂无运行中的下单监控");
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<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'" />
|
||||
<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=20260525-ui-dir" />
|
||||
<link rel="stylesheet" href="/assets/app.css?v=20260526-hub-qty" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="app-bg" aria-hidden="true"></div>
|
||||
@@ -109,6 +109,6 @@
|
||||
</div>
|
||||
|
||||
<div id="toast"></div>
|
||||
<script src="/assets/app.js?v=20260525-ui-dir"></script>
|
||||
<script src="/assets/app.js?v=20260526-hub-qty"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<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'" />
|
||||
<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=20260525-ui-dir" />
|
||||
<link rel="stylesheet" href="/assets/app.css?v=20260526-hub-qty" />
|
||||
</head>
|
||||
<body class="login-page">
|
||||
<div class="login-bg" aria-hidden="true"></div>
|
||||
|
||||
Reference in New Issue
Block a user