diff --git a/manual_trading_hub/static/app.css b/manual_trading_hub/static/app.css index 9e73648..f415236 100644 --- a/manual_trading_hub/static/app.css +++ b/manual_trading_hub/static/app.css @@ -3541,6 +3541,20 @@ body.hub-page-ai #page-ai { padding-bottom: 4px; border-bottom: 1px solid var(--border-soft); } +.ai-md-body.ai-result-md h2:first-child { + margin-top: 0; +} +.ai-md-body.ai-result-md h3 { + font-size: 0.92rem; + color: var(--accent-2, var(--accent)); + margin: 16px 0 8px; + padding-bottom: 4px; + border-bottom: 1px solid var(--border-soft); + font-weight: 600; +} +.ai-md-body.ai-result-md h3:first-of-type { + margin-top: 4px; +} .ai-result-md h3, .ai-result-md h4 { font-size: 0.92rem; @@ -3609,23 +3623,9 @@ body.hub-page-ai #page-ai { background: color-mix(in srgb, var(--accent-dim) 35%, transparent); } .ai-ac-name { - display: flex; - align-items: flex-start; - gap: 8px; min-width: 9rem; font-weight: 500; } -.ai-ac-name > span:last-child { - flex: 1; - min-width: 0; -} -.ai-ex-icon { - display: inline-flex; - flex-shrink: 0; - line-height: 0; - border-radius: 5px; - overflow: hidden; -} .ai-ac-remark { color: var(--muted); font-size: 0.74rem; @@ -3640,8 +3640,12 @@ body.hub-page-ai #page-ai { .ai-ac-warn { color: var(--amber, #d4a017); } -.ai-ac-table .pos, -.ai-ac-table .neg { +.ai-ac-table .ai-stat-val.pos { + color: var(--green); + font-weight: 600; +} +.ai-ac-table .ai-stat-val.neg { + color: var(--red); font-weight: 600; } .ai-placeholder { diff --git a/manual_trading_hub/static/app.js b/manual_trading_hub/static/app.js index b8565e9..e732e68 100644 --- a/manual_trading_hub/static/app.js +++ b/manual_trading_hub/static/app.js @@ -2972,43 +2972,20 @@ return renderHubMarkdown(text); } - const AI_EX_SVG = { - binance: - '', - okx: - '', - gate: - '', - gate_bot: - '', - other: - '', - }; - - function resolveExchangeIconId(key, name) { - const k = String(key || "").toLowerCase(); - const n = String(name || "").toLowerCase(); - if (k === "gate_bot" || k.includes("gate_bot") || n.includes("趋势") || n.includes("gate_bot")) - return "gate_bot"; - if (k === "binance" || k.includes("binance") || n.includes("币安")) return "binance"; - if (k === "okx" || k.includes("okx")) return "okx"; - if (k === "gate" || k.includes("gate") || n.includes("gate")) return "gate"; - return "other"; + function enhanceHubSummaryMarkdown(md) { + let out = String(md || ""); + out = out.replace(/\*\*今日交易总结(([^)]+))\*\*/g, "# 📋 今日交易总结($1)"); + out = out.replace(/\*\*1\.\s*(?:📊\s*)?总览\*\*/g, "## 1. 📊 总览"); + out = out.replace(/\*\*2\.\s*(?:👥\s*)?分户明细\*\*/g, "## 2. 👥 分户明细"); + out = out.replace(/\*\*3\.\s*(?:⚠️\s*)?需关注\*\*/g, "## 3. ⚠️ 需关注"); + out = out.replace(/\*\*4\.\s*(?:ℹ️\s*)?数据说明\*\*/g, "## 4. ℹ️ 数据说明"); + return out; } - function hubExchangeIconHtml(key, name) { - const id = resolveExchangeIconId(key, name); - const title = - id === "binance" - ? "Binance" - : id === "okx" - ? "OKX" - : id === "gate_bot" - ? "Gate Bot" - : id === "gate" - ? "Gate" - : ""; - return ``; + function aiPnlCellHtml(v, digits) { + const cls = aiPnlClass(v); + const valCls = cls ? ` ai-stat-val ${cls}` : " ai-stat-val"; + return `${aiPnlSigned(v, digits)}`; } function aiAccountStatusClass(status) { @@ -3038,11 +3015,11 @@ const statusCls = aiAccountStatusClass(ac.status); return ( "