总览汇总改为单行 KPI + sim/live 对比表,去掉重复卡片。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+51
-20
@@ -427,31 +427,62 @@
|
||||
return;
|
||||
}
|
||||
const s = summarizeOverview(list);
|
||||
function modeRow(label, tag, bucket) {
|
||||
return (
|
||||
"<tr>" +
|
||||
'<td><span class="overview-mode-tag overview-mode-tag--' +
|
||||
tag +
|
||||
'">' +
|
||||
escapeHtml(label) +
|
||||
"</span> <span class=\"muted\">" +
|
||||
bucket.machines +
|
||||
" 台</span></td>" +
|
||||
'<td class="status-on">' +
|
||||
bucket.online +
|
||||
"</td>" +
|
||||
'<td class="' +
|
||||
(bucket.offline > 0 ? "status-off" : "") +
|
||||
'">' +
|
||||
bucket.offline +
|
||||
"</td>" +
|
||||
"<td>" +
|
||||
escapeHtml(
|
||||
bucket.positions > 0
|
||||
? bucket.positions +
|
||||
" 笔" +
|
||||
(bucket.sheets > 0 ? " / " + Math.round(bucket.sheets) + " 张" : "")
|
||||
: "0"
|
||||
) +
|
||||
"</td>" +
|
||||
'<td class="' +
|
||||
(bucket.hasPnl ? pnlClass(bucket.pnl) : "") +
|
||||
'">' +
|
||||
escapeHtml(bucket.hasPnl ? fmtPnl(bucket.pnl) : "—") +
|
||||
"</td>" +
|
||||
"<td>" +
|
||||
escapeHtml(fmtMoneyPlain(bucket.premium, bucket.hasPremium)) +
|
||||
"</td>" +
|
||||
"<td>" +
|
||||
escapeHtml(fmtMoneyPlain(bucket.cash, bucket.hasCash)) +
|
||||
"</td>" +
|
||||
"</tr>"
|
||||
);
|
||||
}
|
||||
box.hidden = false;
|
||||
box.innerHTML =
|
||||
'<div class="overview-kpi-block">' +
|
||||
'<div class="overview-kpi-head"><strong>全部</strong><span class="muted">' +
|
||||
s.all.machines +
|
||||
" 台</span></div>" +
|
||||
'<div class="overview-kpi-block overview-kpi-block--main">' +
|
||||
'<div class="overview-kpi-head"><strong>实时汇总</strong><span class="muted">仅统计在线机资金与仓位</span></div>' +
|
||||
'<div class="overview-kpi-grid">' +
|
||||
renderAggCards(s.all) +
|
||||
"</div></div>" +
|
||||
'<div class="overview-kpi-split">' +
|
||||
'<div class="overview-kpi-block overview-kpi-block--sim">' +
|
||||
'<div class="overview-kpi-head"><strong>模拟 sim</strong><span class="muted">' +
|
||||
s.sim.machines +
|
||||
" 台</span></div>" +
|
||||
'<div class="overview-kpi-grid">' +
|
||||
renderAggCards(s.sim) +
|
||||
"</div></div>" +
|
||||
'<div class="overview-kpi-block overview-kpi-block--live">' +
|
||||
'<div class="overview-kpi-head"><strong>实盘 live</strong><span class="muted">' +
|
||||
s.live.machines +
|
||||
" 台</span></div>" +
|
||||
'<div class="overview-kpi-grid">' +
|
||||
renderAggCards(s.live) +
|
||||
"</div></div>" +
|
||||
"</div>";
|
||||
'<div class="overview-mode-wrap">' +
|
||||
'<table class="overview-mode-table">' +
|
||||
"<thead><tr>" +
|
||||
"<th>模式</th><th>在线</th><th>离线</th><th>仓位</th><th>浮盈</th><th>权利金</th><th>余额</th>" +
|
||||
"</tr></thead><tbody>" +
|
||||
modeRow("模拟", "sim", s.sim) +
|
||||
modeRow("实盘", "live", s.live) +
|
||||
"</tbody></table></div>";
|
||||
}
|
||||
|
||||
async function refresh() {
|
||||
|
||||
Reference in New Issue
Block a user