总览拉取时间并入已更新行,除工作台外各页 1800 宽并左右留白。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-04 21:57:53 +08:00
parent 1b0acfdb08
commit d7f1e0d2de
4 changed files with 30 additions and 34 deletions
+15 -27
View File
@@ -206,33 +206,26 @@ a:hover { color: #7dd3fc; }
.main { .main {
width: 100%; width: 100%;
max-width: 1200px; max-width: 1800px;
margin: 0 auto; margin: 0 auto;
padding: 0 clamp(6px, 1vw, 14px) 16px; padding: 0 clamp(24px, 4vw, 64px) 16px;
} }
/* 总览/实例与客户端一致: 铺满,带鱼屏锁 1800 */
body.page-dashboard .main, body.page-dashboard .main,
body.page-instances .main { body.page-instances .main,
max-width: none; body.page-stats .main,
body.page-settings .main,
body.page-cond-orders .main {
max-width: 1800px;
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
padding: 0 clamp(6px, 1vw, 14px) 16px; padding: 0 clamp(24px, 4vw, 64px) 16px;
} }
@media (min-aspect-ratio: 21/9) { body.page-settings .settings-shell {
body.page-dashboard .main, max-width: none;
body.page-instances .main, width: 100%;
body.page-stats .main, }
body.page-settings .main, body.page-settings .settings-grid {
body.page-cond-orders .main { max-width: none;
max-width: min(1800px, calc(100vw - 24px));
}
body.page-settings .settings-shell {
max-width: none;
width: 100%;
}
body.page-settings .settings-grid {
max-width: none;
}
} }
body.page-desk { body.page-desk {
height: 100vh; height: 100vh;
@@ -1671,10 +1664,5 @@ input.readonly {
font-size: 0.75rem; font-size: 0.75rem;
} }
body.page-stats .main { body.page-stats .main {
max-width: 1400px; max-width: 1800px;
}
@media (min-aspect-ratio: 21/9) {
body.page-stats .main {
max-width: min(1800px, calc(100vw - 24px));
}
} }
+13 -5
View File
@@ -351,9 +351,6 @@
"<td>" + "<td>" +
bidLiquiditySummary(brief) + bidLiquiditySummary(brief) +
"</td>" + "</td>" +
'<td class="muted">' +
escapeHtml(row.pulled_at || "—") +
"</td>" +
'<td><div class="overview-actions">' + '<td><div class="overview-actions">' +
'<a class="btn" href="/desk?id=' + '<a class="btn" href="/desk?id=' +
encodeURIComponent(row.id) + encodeURIComponent(row.id) +
@@ -566,6 +563,15 @@
}); });
} }
function latestPulledAt(list) {
let best = "";
(list || []).forEach(function (row) {
const t = String((row && row.pulled_at) || "").trim();
if (t && t !== "—" && t > best) best = t;
});
return best;
}
async function refresh() { async function refresh() {
const status = document.getElementById("overview-status"); const status = document.getElementById("overview-status");
const grid = document.getElementById("overview-grid"); const grid = document.getElementById("overview-grid");
@@ -585,7 +591,7 @@
grid.innerHTML = grid.innerHTML =
'<div class="overview-table-wrap"><table class="overview-table">' + '<div class="overview-table-wrap"><table class="overview-table">' +
"<thead><tr>" + "<thead><tr>" +
"<th>名称</th><th>状态</th><th>模式</th><th>浮盈</th><th>权利金</th><th>资金占比</th><th>持仓</th><th>出场</th><th>买一/流动性</th><th>拉取时间</th><th>操作</th>" + "<th>名称</th><th>状态</th><th>模式</th><th>浮盈</th><th>权利金</th><th>资金占比</th><th>持仓</th><th>出场</th><th>买一/流动性</th><th>操作</th>" +
"</tr></thead><tbody>" + "</tr></thead><tbody>" +
list.map(renderRow).join("") + list.map(renderRow).join("") +
"</tbody></table></div>"; "</tbody></table></div>";
@@ -597,13 +603,15 @@
} }
if (status) { if (status) {
const s = summarizeOverview(list); const s = summarizeOverview(list);
const pulled = latestPulledAt(list);
status.textContent = status.textContent =
"已更新 · 共 " + "已更新 · 共 " +
list.length + list.length +
" 台 · 在线 " + " 台 · 在线 " +
s.all.online + s.all.online +
" · 离线 " + " · 离线 " +
s.all.offline; s.all.offline +
(pulled ? " · 拉取时间 " + pulled : "");
} }
} catch (e) { } catch (e) {
if (status) status.textContent = e.message || "加载失败"; if (status) status.textContent = e.message || "加载失败";
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}加密货币|OKX 期权中控{% endblock %}</title> <title>{% block title %}加密货币|OKX 期权中控{% endblock %}</title>
<link rel="stylesheet" href="{{ url_for('static', filename='hub.css') }}?v=35"> <link rel="stylesheet" href="{{ url_for('static', filename='hub.css') }}?v=36">
</head> </head>
<body class="{% if request.path.startswith('/login') %}page-login{% elif request.path.startswith('/desk') %}page-desk{% elif request.path.startswith('/stats') %}page-stats{% elif request.path.startswith('/instances') %}page-instances{% elif request.path.startswith('/settings') %}page-settings{% elif request.path.startswith('/cond_orders') %}page-cond-orders{% elif request.path == '/' %}page-dashboard{% endif %}"> <body class="{% if request.path.startswith('/login') %}page-login{% elif request.path.startswith('/desk') %}page-desk{% elif request.path.startswith('/stats') %}page-stats{% elif request.path.startswith('/instances') %}page-instances{% elif request.path.startswith('/settings') %}page-settings{% elif request.path.startswith('/cond_orders') %}page-cond-orders{% elif request.path == '/' %}page-dashboard{% endif %}">
{% if session.get('logged_in') %} {% if session.get('logged_in') %}
+1 -1
View File
@@ -15,6 +15,6 @@
<div id="overview-grid"></div> <div id="overview-grid"></div>
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
<script src="{{ url_for('static', filename='hub.js') }}?v=24"></script> <script src="{{ url_for('static', filename='hub.js') }}?v=25"></script>
<script>HubOverview.boot();</script> <script>HubOverview.boot();</script>
{% endblock %} {% endblock %}