总览无持仓时仍显示灰色禁用平仓按钮,避免操作列只剩打开。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -302,6 +302,16 @@ button, .btn {
|
||||
}
|
||||
.btn:hover, button:hover { filter: brightness(1.06); }
|
||||
.btn-danger { background: #9f1239; color: #fff; }
|
||||
.btn-close-disabled,
|
||||
.btn-close-disabled:hover,
|
||||
.btn.btn-close-disabled:disabled {
|
||||
background: #3a3f4b;
|
||||
color: #8b93a7;
|
||||
border: 1px solid #4a5160;
|
||||
cursor: not-allowed;
|
||||
filter: none;
|
||||
opacity: 1;
|
||||
}
|
||||
.btn-sm {
|
||||
padding: 3px 8px;
|
||||
font-size: 0.75rem;
|
||||
|
||||
+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) {
|
||||
|
||||
@@ -15,6 +15,6 @@
|
||||
<div id="overview-grid"></div>
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script src="{{ url_for('static', filename='hub.js') }}?v=16"></script>
|
||||
<script src="{{ url_for('static', filename='hub.js') }}?v=17"></script>
|
||||
<script>HubOverview.boot();</script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user