From 2c01d11fe1d63cb0a68d2efd6e1a3ee70fba84e9 Mon Sep 17 00:00:00 2001 From: dekun Date: Wed, 3 Jun 2026 23:30:33 +0800 Subject: [PATCH] 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 --- manual_trading_hub/static/app.css | 30 ++++++++++++++++++++++++++-- manual_trading_hub/static/app.js | 15 ++++++++------ manual_trading_hub/static/index.html | 4 ++-- 3 files changed, 39 insertions(+), 10 deletions(-) diff --git a/manual_trading_hub/static/app.css b/manual_trading_hub/static/app.css index fbd80f1..e61a5ea 100644 --- a/manual_trading_hub/static/app.css +++ b/manual_trading_hub/static/app.css @@ -1296,9 +1296,35 @@ body.market-chart-fs-open { border-radius: 6px; font-size: 11px; line-height: 1.3; + border: 1px solid transparent; +} + +/* 突破 + 斐波 */ +.card-stat-chip.card-stat-key-breakout { color: var(--accent); - background: var(--accent-dim); - border: 1px solid var(--border-soft); + background: rgba(0, 212, 255, 0.14); + border-color: rgba(0, 212, 255, 0.38); +} + +/* 关键位监控(阻力/支撑等) */ +.card-stat-chip.card-stat-key-watch { + color: #b8a0ff; + background: rgba(123, 97, 255, 0.18); + border-color: rgba(123, 97, 255, 0.42); +} + +/* 趋势回调 */ +.card-stat-chip.card-stat-trend { + color: var(--green); + background: rgba(0, 255, 157, 0.1); + border-color: rgba(0, 255, 157, 0.38); +} + +/* 顺势加仓 */ +.card-stat-chip.card-stat-roll { + color: #ffb020; + background: rgba(255, 176, 32, 0.14); + border-color: rgba(255, 176, 32, 0.42); } .hub-tile .card-strategy-stats { diff --git a/manual_trading_hub/static/app.js b/manual_trading_hub/static/app.js index 5062498..551194c 100644 --- a/manual_trading_hub/static/app.js +++ b/manual_trading_hub/static/app.js @@ -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 `
${chips - .map((label) => `${esc(label)}`) + .map( + (c) => + `${esc(c.label)}` + ) .join("")}
`; } diff --git a/manual_trading_hub/static/index.html b/manual_trading_hub/static/index.html index 1685344..35556ab 100644 --- a/manual_trading_hub/static/index.html +++ b/manual_trading_hub/static/index.html @@ -8,7 +8,7 @@ - + @@ -246,6 +246,6 @@
- +