总览无持仓时仍显示灰色禁用平仓按钮,避免操作列只剩打开。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+10
-2
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user