机器对比改为模拟在上实盘在下,收益率按已结算盈亏相对初始资金计算。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-07 14:44:16 +08:00
parent 05661f3f30
commit 1c68493aa0
4 changed files with 85 additions and 6 deletions
+15 -1
View File
@@ -116,10 +116,24 @@
.join("");
}
function sortMachines(machines) {
return (machines || []).slice().sort(function (a, b) {
function rank(m) {
const mode = String((m && m.mode) || "").toLowerCase();
if (mode === "sim") return 0;
if (mode === "live") return 1;
return 2;
}
const d = rank(a) - rank(b);
if (d !== 0) return d;
return String((a && a.name) || "").localeCompare(String((b && b.name) || ""), "zh");
});
}
function renderTable(machines) {
const body = document.getElementById("stats-table-body");
if (!body) return;
const list = machines || [];
const list = sortMachines(machines);
if (!list.length) {
body.innerHTML = '<tr><td colspan="12" class="muted">暂无启用实例</td></tr>';
return;