总览无持仓时仍显示灰色禁用平仓按钮,避免操作列只剩打开。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-04 09:57:47 +08:00
parent 706601416b
commit 822ef65f2d
3 changed files with 21 additions and 3 deletions
+10 -2
View File
@@ -85,11 +85,19 @@
}
function closeActionButtons(brief, instanceId, online) {
if (!online) return "";
const list = (brief || []).filter(function (p) {
return !!(p && p.inst_id);
});
if (!list.length) return "";
if (!online) {
return (
'<button type="button" class="btn btn-close-disabled" disabled title="实例离线">平仓</button>'
);
}
if (!list.length) {
return (
'<button type="button" class="btn btn-close-disabled" disabled title="暂无持仓">平仓</button>'
);
}
return list
.slice(0, 8)
.map(function (p) {