style(hub): color-code monitor card strategy stat chips
Use shared cyan for breakout/fib keys, purple for watch keys, green for trends, and orange for roll groups. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1652,19 +1652,22 @@
|
||||
const chips = [];
|
||||
if (caps.includes("key")) {
|
||||
const kc = countKeyMonitorsByBucket(hm.keys || []);
|
||||
if (kc.breakout > 0) chips.push(`突破 ${kc.breakout}`);
|
||||
if (kc.fib > 0) chips.push(`斐波 ${kc.fib}`);
|
||||
if (kc.watch > 0) chips.push(`监控 ${kc.watch}`);
|
||||
if (kc.breakout > 0) chips.push({ kind: "key-breakout", label: `突破 ${kc.breakout}` });
|
||||
if (kc.fib > 0) chips.push({ kind: "key-breakout", label: `斐波 ${kc.fib}` });
|
||||
if (kc.watch > 0) chips.push({ kind: "key-watch", label: `监控 ${kc.watch}` });
|
||||
}
|
||||
if (caps.includes("trend")) {
|
||||
const trendN = Array.isArray(hm.trends) ? hm.trends.length : 0;
|
||||
if (trendN > 0) chips.push(`趋势回调 ${trendN}`);
|
||||
if (trendN > 0) chips.push({ kind: "trend", label: `趋势回调 ${trendN}` });
|
||||
}
|
||||
const rollN = Array.isArray(hm.rolls) ? hm.rolls.length : 0;
|
||||
if (rollN > 0) chips.push(`顺势加仓 ${rollN}`);
|
||||
if (rollN > 0) chips.push({ kind: "roll", label: `顺势加仓 ${rollN}` });
|
||||
if (!chips.length) return "";
|
||||
return `<div class="card-strategy-stats">${chips
|
||||
.map((label) => `<span class="card-stat-chip">${esc(label)}</span>`)
|
||||
.map(
|
||||
(c) =>
|
||||
`<span class="card-stat-chip card-stat-${esc(c.kind)}">${esc(c.label)}</span>`
|
||||
)
|
||||
.join("")}</div>`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user