总览持仓列展示期权杠杆倍数。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-05 06:47:49 +08:00
parent d7f1e0d2de
commit e18dd41c2d
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -112,13 +112,20 @@
const items = list.slice(0, 8).map(function (p) { const items = list.slice(0, 8).map(function (p) {
const id = p.inst_id || ""; const id = p.inst_id || "";
const sheets = escapeHtml(String(p.sheets != null ? p.sheets : "—")); const sheets = escapeHtml(String(p.sheets != null ? p.sheets : "—"));
const lev = Number(p.contract_leverage != null ? p.contract_leverage : p.leverage);
const levTxt =
Number.isFinite(lev) && lev > 0
? " · 约" + lev.toFixed(1) + "×"
: "";
const fromCond = tagOpen && (!opened || opened === id); const fromCond = tagOpen && (!opened || opened === id);
return ( return (
"<li>" + "<li>" +
escapeHtml(id) + escapeHtml(id) +
" · " + " · " +
sheets + sheets +
"张 · " + "张" +
escapeHtml(levTxt) +
" · " +
fmtPnlHtml(p.pnl_usdt) + fmtPnlHtml(p.pnl_usdt) +
(fromCond ? '<span class="overview-cond-src">条件单</span>' : "") + (fromCond ? '<span class="overview-cond-src">条件单</span>' : "") +
"</li>" "</li>"
+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=25"></script> <script src="{{ url_for('static', filename='hub.js') }}?v=26"></script>
<script>HubOverview.boot();</script> <script>HubOverview.boot();</script>
{% endblock %} {% endblock %}