diff --git a/static/hub.js b/static/hub.js index 55bcde9..0e1642e 100644 --- a/static/hub.js +++ b/static/hub.js @@ -452,6 +452,14 @@ "" ); } + const rows = []; + if (s.sim.machines > 0) rows.push(modeRow("sim", "sim", s.sim)); + if (s.live.machines > 0) rows.push(modeRow("live", "live", s.live)); + if (!rows.length) { + box.hidden = true; + box.innerHTML = ""; + return; + } box.hidden = false; box.innerHTML = '
' + @@ -460,8 +468,7 @@ "" + "模式在线离线仓位浮盈权利金余额" + "" + - modeRow("sim", "sim", s.sim) + - modeRow("live", "live", s.live) + + rows.join("") + "
"; } diff --git a/templates/dashboard.html b/templates/dashboard.html index f1e1c2c..d9bb543 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -15,6 +15,6 @@
{% endblock %} {% block scripts %} - + {% endblock %}