diff --git a/static/hub.js b/static/hub.js
index a5ece38..54ede94 100644
--- a/static/hub.js
+++ b/static/hub.js
@@ -132,6 +132,57 @@
return '
' + items.join("") + more + "
";
}
+ function fmtMoneyU(v) {
+ if (v == null || v === "") return "—";
+ const n = Number(v);
+ if (!Number.isFinite(n)) return "—";
+ return n.toFixed(2) + " U";
+ }
+
+ function fmtRatioPct(v) {
+ if (v == null || v === "") return "—";
+ const n = Number(v);
+ if (!Number.isFinite(n)) return "—";
+ return n.toFixed(2) + "%";
+ }
+
+ function premiumCell(snap) {
+ const prem = snap.premium || {};
+ const paid = prem.paid_usdt;
+ const equity = prem.equity_usdt;
+ const ratio = prem.ratio_pct;
+ const tip =
+ equity != null
+ ? "账户资金(资+交) " + fmtMoneyU(equity)
+ : "账户资金暂无";
+ return (
+ '' +
+ escapeHtml(fmtMoneyU(paid)) +
+ ""
+ );
+ }
+
+ function premiumRatioCell(snap) {
+ const prem = snap.premium || {};
+ const ratio = prem.ratio_pct;
+ const tip =
+ prem.paid_usdt != null && prem.equity_usdt != null
+ ? "权利金 " +
+ fmtMoneyU(prem.paid_usdt) +
+ " / 账户 " +
+ fmtMoneyU(prem.equity_usdt)
+ : "";
+ return (
+ '' +
+ escapeHtml(fmtRatioPct(ratio)) +
+ ""
+ );
+ }
+
function renderRow(row) {
const snap = row.snapshot || {};
const inst = snap.instance || {};
@@ -164,6 +215,12 @@
fmtPnlHtml(pnl) +
"" +
"" +
+ premiumCell(snap) +
+ " | " +
+ "" +
+ premiumRatioCell(snap) +
+ " | " +
+ "" +
positionSummary(brief) +
" | " +
"" +
@@ -248,7 +305,7 @@
grid.innerHTML =
'' +
"" +
- "| 名称 | 状态 | 模式 | 浮盈 | 持仓 | 买一/流动性 | 拉取时间 | 操作 | " +
+ "名称 | 状态 | 模式 | 浮盈 | 权利金 | 资金占比 | 持仓 | 买一/流动性 | 拉取时间 | 操作 | " +
" " +
list.map(renderRow).join("") +
" ";
|