总览只保留实时汇总下的 sim/live 分表,在线绿离线红,模式不写台数。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+3
-55
@@ -363,50 +363,6 @@
|
||||
return Number(v).toFixed(2) + " U";
|
||||
}
|
||||
|
||||
function renderAggCards(bucket) {
|
||||
const items = [
|
||||
{
|
||||
label: "在线",
|
||||
value: String(bucket.online),
|
||||
cls: "status-on",
|
||||
},
|
||||
{
|
||||
label: "离线",
|
||||
value: String(bucket.offline),
|
||||
cls: bucket.offline > 0 ? "status-off" : "",
|
||||
},
|
||||
{ label: "仓位合计", value: String(bucket.positions) },
|
||||
{
|
||||
label: "浮盈合计",
|
||||
value: bucket.hasPnl ? fmtPnl(bucket.pnl) : "—",
|
||||
cls: bucket.hasPnl ? pnlClass(bucket.pnl) : "",
|
||||
},
|
||||
{
|
||||
label: "权利金合计",
|
||||
value: fmtMoneyPlain(bucket.premium, bucket.hasPremium),
|
||||
},
|
||||
{
|
||||
label: "余额合计",
|
||||
value: fmtMoneyPlain(bucket.cash, bucket.hasCash),
|
||||
},
|
||||
];
|
||||
return items
|
||||
.map(function (it) {
|
||||
return (
|
||||
'<div class="overview-kpi-card">' +
|
||||
'<div class="overview-kpi-label">' +
|
||||
escapeHtml(it.label) +
|
||||
"</div>" +
|
||||
'<div class="overview-kpi-value ' +
|
||||
escapeHtml(it.cls || "") +
|
||||
'">' +
|
||||
escapeHtml(it.value) +
|
||||
"</div></div>"
|
||||
);
|
||||
})
|
||||
.join("");
|
||||
}
|
||||
|
||||
function renderOverviewSummary(list) {
|
||||
const box = document.getElementById("overview-summary");
|
||||
if (!box) return;
|
||||
@@ -423,15 +379,11 @@
|
||||
tag +
|
||||
'">' +
|
||||
escapeHtml(label) +
|
||||
"</span> <span class=\"muted\">" +
|
||||
bucket.machines +
|
||||
" 台</span></td>" +
|
||||
"</span></td>" +
|
||||
'<td class="status-on">' +
|
||||
bucket.online +
|
||||
"</td>" +
|
||||
'<td class="' +
|
||||
(bucket.offline > 0 ? "status-off" : "") +
|
||||
'">' +
|
||||
'<td class="status-off">' +
|
||||
bucket.offline +
|
||||
"</td>" +
|
||||
"<td>" +
|
||||
@@ -453,12 +405,8 @@
|
||||
}
|
||||
box.hidden = false;
|
||||
box.innerHTML =
|
||||
'<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-mode-wrap">' +
|
||||
'<div class="overview-mode-head"><strong>实时汇总</strong><span class="muted">仅统计在线机资金与仓位</span></div>' +
|
||||
'<table class="overview-mode-table">' +
|
||||
"<thead><tr>" +
|
||||
"<th>模式</th><th>在线</th><th>离线</th><th>仓位</th><th>浮盈</th><th>权利金</th><th>余额</th>" +
|
||||
|
||||
Reference in New Issue
Block a user