diff --git a/manual_trading_hub/hub.py b/manual_trading_hub/hub.py index d694bf2..5389992 100644 --- a/manual_trading_hub/hub.py +++ b/manual_trading_hub/hub.py @@ -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() diff --git a/manual_trading_hub/static/app.js b/manual_trading_hub/static/app.js index 2f0fe0e..7aaac7e 100644 --- a/manual_trading_hub/static/app.js +++ b/manual_trading_hub/static/app.js @@ -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 ? `挂单中` : ""; + const amtTxt = fmtKeyOrderAmount(k); + const amtLine = amtTxt + ? `
挂单数量 ${esc(amtTxt)}
` + : ""; return `
${esc(k.symbol)} · ${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)}` : ""}
`; }) @@ -709,7 +722,7 @@
余额
${fmt(ag.balance_usdt, 2)} U
浮盈合计
${fmt(ag.total_unrealized_pnl, 4)}
`; - inner += `
交易所持仓
`; + inner += `
交易所持仓 · ${pos.length} 仓
`; if (pos.length) { inner += pos.map((p) => renderPositionBlock(row.id, p)).join(""); } else { @@ -722,7 +735,7 @@ }); } if ((row.capabilities || []).includes("key")) { - inner += `
关键位
`; + inner += `
关键位 · ${keys.length}
`; if (!flaskOk) { const fe = row.flask_error || hm.msg || hm.error || "策略 Flask 未连通"; inner += `
${esc(fe)}
`; @@ -737,6 +750,8 @@ let line = `${esc(k.symbol)} · ${esc(mt)}`; if (k.direction) line += ` · ${renderDirectionHtml(k.direction)}`; if (pending) line += ` · 挂单`; + 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("关键位", `
${esc(row.flask_error || hm.error || "Flask 未连通")}
`, ""); } else { - html += renderHubSectionCard("关键位", renderKeySection(keys, kmap), "当前无关键位记录"); + html += renderHubSectionCard( + `关键位 · ${keys.length}`, + renderKeySection(keys, kmap), + "当前无关键位记录" + ); } } html += renderHubSectionCard("下单监控", renderOrderMonitorSection(orders), "暂无运行中的下单监控"); diff --git a/manual_trading_hub/static/index.html b/manual_trading_hub/static/index.html index d315fc6..7983ab0 100644 --- a/manual_trading_hub/static/index.html +++ b/manual_trading_hub/static/index.html @@ -8,7 +8,7 @@ - + @@ -109,6 +109,6 @@
- + diff --git a/manual_trading_hub/static/login.html b/manual_trading_hub/static/login.html index 3b1d58a..247705f 100644 --- a/manual_trading_hub/static/login.html +++ b/manual_trading_hub/static/login.html @@ -8,7 +8,7 @@ - +