机器对比改为模拟在上实盘在下,收益率按已结算盈亏相对初始资金计算。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+15
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user