@@ -403,6 +403,14 @@ button, .btn {
|
|||||||
.pos-brief li {
|
.pos-brief li {
|
||||||
margin: 2px 0;
|
margin: 2px 0;
|
||||||
}
|
}
|
||||||
|
.exit-brief .exit-set {
|
||||||
|
color: var(--ok);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
.exit-brief .exit-unset {
|
||||||
|
color: var(--bad);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
.pos-exit {
|
.pos-exit {
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
font-size: 0.76rem;
|
font-size: 0.76rem;
|
||||||
|
|||||||
+20
-8
@@ -52,8 +52,6 @@
|
|||||||
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 exitText = formatExitBrief(p);
|
|
||||||
const exitCls = exitText === "未设出场" ? "muted" : "";
|
|
||||||
return (
|
return (
|
||||||
"<li>" +
|
"<li>" +
|
||||||
escapeHtml(id) +
|
escapeHtml(id) +
|
||||||
@@ -61,11 +59,7 @@
|
|||||||
sheets +
|
sheets +
|
||||||
"张 · " +
|
"张 · " +
|
||||||
fmtPnlHtml(p.pnl_usdt) +
|
fmtPnlHtml(p.pnl_usdt) +
|
||||||
'<div class="pos-exit ' +
|
"</li>"
|
||||||
exitCls +
|
|
||||||
'">出场: ' +
|
|
||||||
escapeHtml(exitText) +
|
|
||||||
"</div></li>"
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
const more =
|
const more =
|
||||||
@@ -75,6 +69,21 @@
|
|||||||
return "<ul class=\"pos-brief\">" + items.join("") + more + "</ul>";
|
return "<ul class=\"pos-brief\">" + items.join("") + more + "</ul>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function exitSummary(brief) {
|
||||||
|
const list = brief || [];
|
||||||
|
if (!list.length) return '<span class="muted">—</span>';
|
||||||
|
const items = list.slice(0, 8).map(function (p) {
|
||||||
|
const exitText = formatExitBrief(p);
|
||||||
|
const exitCls = exitText === "未设出场" ? "exit-unset" : "exit-set";
|
||||||
|
return '<li class="' + exitCls + '">' + escapeHtml(exitText) + "</li>";
|
||||||
|
});
|
||||||
|
const more =
|
||||||
|
list.length > 8
|
||||||
|
? '<li class="muted">…共 ' + list.length + " 笔</li>"
|
||||||
|
: "";
|
||||||
|
return '<ul class="pos-brief exit-brief">' + items.join("") + more + "</ul>";
|
||||||
|
}
|
||||||
|
|
||||||
function closeActionButtons(brief, instanceId, online) {
|
function closeActionButtons(brief, instanceId, online) {
|
||||||
if (!online) return "";
|
if (!online) return "";
|
||||||
const list = (brief || []).filter(function (p) {
|
const list = (brief || []).filter(function (p) {
|
||||||
@@ -253,6 +262,9 @@
|
|||||||
positionSummary(brief) +
|
positionSummary(brief) +
|
||||||
"</td>" +
|
"</td>" +
|
||||||
"<td>" +
|
"<td>" +
|
||||||
|
exitSummary(brief) +
|
||||||
|
"</td>" +
|
||||||
|
"<td>" +
|
||||||
bidLiquiditySummary(brief) +
|
bidLiquiditySummary(brief) +
|
||||||
"</td>" +
|
"</td>" +
|
||||||
'<td class="muted">' +
|
'<td class="muted">' +
|
||||||
@@ -463,7 +475,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>";
|
||||||
|
|||||||
@@ -14,6 +14,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=11"></script>
|
<script src="{{ url_for('static', filename='hub.js') }}?v=13"></script>
|
||||||
<script>HubOverview.boot();</script>
|
<script>HubOverview.boot();</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user