" + - escapeHtml(row.name || "") + - "
" + - "| 合约 | 张 | 盈亏 |
|---|
内嵌打开 ' + - '
' + - "diff --git a/app.py b/app.py index aa370b3..a9b3d7a 100644 --- a/app.py +++ b/app.py @@ -205,6 +205,7 @@ def desk(): inst["base_url"], bridge_token=inst["bridge_token"], embed_path=inst.get("embed_path") or "/embed", + ttl_sec=3600, ) return render_template( "desk.html", @@ -231,6 +232,7 @@ def api_open_url(iid: int): inst["base_url"], bridge_token=inst["bridge_token"], embed_path=inst.get("embed_path") or "/embed", + ttl_sec=3600, ) return jsonify({"ok": True, "url": url, "base_url": inst["base_url"]}) diff --git a/static/hub.css b/static/hub.css index 23b7e6c..00b2c8f 100644 --- a/static/hub.css +++ b/static/hub.css @@ -28,6 +28,12 @@ a { color: #9ec1ff; text-decoration: none; } .topbar nav a.active { color: #fff; } .brand { font-weight: 700; } .main { padding: 16px; max-width: 1200px; margin: 0 auto; } +body.page-desk .main, +body.page-dashboard .main { + max-width: none; + width: 100%; + padding: 12px 16px 20px; +} .page-head { display: flex; align-items: center; gap: 12px; } .muted { color: var(--muted); font-size: 0.9rem; } .flash { @@ -80,6 +86,43 @@ button, .btn { } .check { display: flex !important; align-items: center; gap: 8px; } .inst-row { margin: 10px 0; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; } +.overview-table-wrap { + overflow-x: auto; + margin-top: 12px; + border: 1px solid var(--line); + border-radius: 12px; + background: var(--panel); +} +.overview-table { + width: 100%; + border-collapse: collapse; + font-size: 0.88rem; +} +.overview-table th, +.overview-table td { + padding: 10px 12px; + border-bottom: 1px solid var(--line); + text-align: left; + vertical-align: top; +} +.overview-table th { + color: var(--muted); + font-weight: 600; + background: #12161f; + white-space: nowrap; +} +.overview-table tr:last-child td { border-bottom: 0; } +.overview-table .status-on { color: var(--ok); } +.overview-table .status-off { color: var(--bad); } +.overview-actions { display: flex; gap: 8px; flex-wrap: wrap; } +.overview-actions .btn { margin-top: 0; } +.pos-brief { + margin: 0; + padding-left: 1.1em; + color: var(--muted); + font-size: 0.8rem; +} +.pos-brief li { margin: 2px 0; } .card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); @@ -96,7 +139,7 @@ button, .btn { .card .status-off { color: var(--bad); } .card table { width: 100%; font-size: 0.8rem; border-collapse: collapse; } .card td, .card th { border-bottom: 1px solid var(--line); padding: 4px 2px; text-align: left; } -.desk { display: grid; grid-template-columns: 200px 1fr; gap: 12px; min-height: 70vh; max-width: none; } +.desk { display: grid; grid-template-columns: 200px 1fr; gap: 12px; min-height: calc(100vh - 70px); max-width: none; } .desk-side { background: var(--panel); border: 1px solid var(--line); @@ -106,7 +149,7 @@ button, .btn { .desk-list { list-style: none; padding: 0; margin: 0; } .desk-list li { margin: 6px 0; } .desk-list li.active a { color: #fff; font-weight: 600; } -.desk-main { display: flex; flex-direction: column; min-height: 70vh; } +.desk-main { display: flex; flex-direction: column; min-height: calc(100vh - 70px); min-width: 0; } .desk-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; @@ -114,7 +157,7 @@ button, .btn { .desk-frame { flex: 1; width: 100%; - min-height: 65vh; + min-height: calc(100vh - 130px); border: 1px solid var(--line); border-radius: 10px; background: #000; diff --git a/static/hub.js b/static/hub.js index 9cf99cb..8b87126 100644 --- a/static/hub.js +++ b/static/hub.js @@ -6,60 +6,6 @@ return (n > 0 ? "+" : "") + n.toFixed(2) + " U"; } - function renderCard(row) { - const snap = row.snapshot || {}; - const inst = snap.instance || {}; - const pnl = (snap.pnl && snap.pnl.unrealized_usdt != null) - ? snap.pnl.unrealized_usdt - : snap.upl_total_usdc; - const brief = snap.positions_brief || snap.positions || []; - const online = !!row.online; - const status = online - ? '在线' - : '离线'; - const mode = inst.mode || "—"; - const err = row.error ? '
| 合约 | 张 | 盈亏 |
|---|
内嵌打开 ' + - '
' + - "暂无启用实例,请先到「实例」添加.
'; + grid.innerHTML = + '暂无启用实例,请先到「实例」添加.
'; } else { - grid.innerHTML = list.map(renderCard).join(""); + grid.innerHTML = + '| 名称 | 状态 | 模式 | 浮盈 | 持仓 | 拉取时间 | 操作 | " + + "
|---|
加载中…
- + {% endblock %} {% block scripts %}