总览只保留实时汇总下的 sim/live 分表,在线绿离线红,模式不写台数。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-03 03:49:39 +08:00
parent 5e73093b11
commit 68357fc9c1
3 changed files with 17 additions and 109 deletions
+13 -53
View File
@@ -333,53 +333,6 @@ button, .btn {
gap: 10px;
margin: 0 0 14px;
}
.overview-kpi-block {
padding: 12px 14px;
border-radius: var(--radius);
border: 1px solid var(--line);
background: var(--panel);
box-shadow: var(--shadow);
backdrop-filter: blur(10px);
}
.overview-kpi-block--main {
border-color: rgba(56, 189, 248, 0.28);
}
.overview-kpi-head {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 8px;
margin-bottom: 10px;
}
.overview-kpi-head strong {
font-size: 0.92rem;
letter-spacing: 0.02em;
}
.overview-kpi-grid {
display: grid;
grid-template-columns: repeat(6, minmax(0, 1fr));
gap: 8px;
}
.overview-kpi-card {
padding: 8px 10px;
border-radius: 10px;
border: 1px solid rgba(56, 189, 248, 0.12);
background: rgba(5, 12, 22, 0.5);
min-width: 0;
}
.overview-kpi-label {
font-size: 0.72rem;
color: var(--muted);
margin-bottom: 4px;
}
.overview-kpi-value {
font-size: 0.95rem;
font-weight: 700;
font-variant-numeric: tabular-nums;
word-break: break-word;
}
.overview-kpi-value.status-on { color: var(--ok); }
.overview-kpi-value.status-off { color: var(--bad); }
.overview-mode-wrap {
overflow-x: auto;
border-radius: var(--radius);
@@ -387,6 +340,17 @@ button, .btn {
background: var(--panel);
box-shadow: var(--shadow);
}
.overview-mode-head {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 8px;
padding: 12px 14px 0;
}
.overview-mode-head strong {
font-size: 0.92rem;
letter-spacing: 0.02em;
}
.overview-mode-table {
width: 100%;
border-collapse: collapse;
@@ -411,6 +375,8 @@ button, .btn {
text-align: left;
white-space: nowrap;
}
.overview-mode-table .status-on { color: var(--ok); font-weight: 700; }
.overview-mode-table .status-off { color: var(--bad); font-weight: 700; }
.overview-mode-tag {
display: inline-block;
padding: 2px 8px;
@@ -427,12 +393,6 @@ button, .btn {
color: #6ee7b7;
background: rgba(52, 211, 153, 0.14);
}
@media (max-width: 1100px) {
.overview-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
.overview-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.pos-brief {
margin: 0;
padding-left: 0;
+3 -55
View File
@@ -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>" +
+1 -1
View File
@@ -14,6 +14,6 @@
<div id="overview-grid"></div>
{% endblock %}
{% block scripts %}
<script src="{{ url_for('static', filename='hub.js') }}?v=7"></script>
<script src="{{ url_for('static', filename='hub.js') }}?v=9"></script>
<script>HubOverview.boot();</script>
{% endblock %}