diff --git a/manual_trading_hub/static/dashboard.js b/manual_trading_hub/static/dashboard.js index 6e23f7d..b42b108 100644 --- a/manual_trading_hub/static/dashboard.js +++ b/manual_trading_hub/static/dashboard.js @@ -159,15 +159,27 @@ return { perp: perp, options: options }; } + function sourceBadgeClass(source) { + const s = String(source || ""); + if (s.indexOf("对冲") >= 0) return "is-hedge"; + if (s.indexOf("纯期权") >= 0 || s === "期权") return "is-opt"; + if (s.indexOf("顺势") >= 0) return "is-roll"; + if (s.indexOf("趋势") >= 0) return "is-trend"; + if (s.indexOf("关键位") >= 0) return "is-key"; + if (s.indexOf("下单") >= 0) return "is-order"; + return "is-none"; + } + + function sourceTypeCell(source) { + const s = String(source || "—"); + return `${esc(s)}`; + } + function renderUnifiedPerpTable(rows) { - if (!rows.length) { - return `
| 交易所 | 合约 | 方向 | 开仓价 | 标记价 | 张数 | 盈利金额 | 浮盈 | +交易所 | 类型 | 合约 | 方向 | 开仓价 | 标记价 | 张数 | 盈利金额 | 浮盈 |
|---|