diff --git a/crypto_monitor_binance/templates/index.html b/crypto_monitor_binance/templates/index.html index 063cd3a..2ce51a2 100644 --- a/crypto_monitor_binance/templates/index.html +++ b/crypto_monitor_binance/templates/index.html @@ -232,7 +232,7 @@ .stats-period-block h3{font-size:1rem;color:#dbe4ff;margin-bottom:4px} .stats-period-block .sub{font-size:.78rem;color:#8892b0;margin-bottom:10px;line-height:1.4} - + diff --git a/crypto_monitor_gate/templates/index.html b/crypto_monitor_gate/templates/index.html index 92a2bc5..293adae 100644 --- a/crypto_monitor_gate/templates/index.html +++ b/crypto_monitor_gate/templates/index.html @@ -232,7 +232,7 @@ .stats-period-block h3{font-size:1rem;color:#dbe4ff;margin-bottom:4px} .stats-period-block .sub{font-size:.78rem;color:#8892b0;margin-bottom:10px;line-height:1.4} - + diff --git a/crypto_monitor_gate_bot/templates/index.html b/crypto_monitor_gate_bot/templates/index.html index 69eea4f..4f1a9b3 100644 --- a/crypto_monitor_gate_bot/templates/index.html +++ b/crypto_monitor_gate_bot/templates/index.html @@ -269,7 +269,7 @@ .stats-split-row{grid-template-columns:1fr} } - + diff --git a/crypto_monitor_okx/templates/index.html b/crypto_monitor_okx/templates/index.html index 7c490f4..b57dc6f 100644 --- a/crypto_monitor_okx/templates/index.html +++ b/crypto_monitor_okx/templates/index.html @@ -232,7 +232,7 @@ .stats-period-block h3{font-size:1rem;color:#dbe4ff;margin-bottom:4px} .stats-period-block .sub{font-size:.78rem;color:#8892b0;margin-bottom:10px;line-height:1.4} - + diff --git a/static/instance_theme.css b/static/instance_theme.css index c6d83ca..9f1ddec 100644 --- a/static/instance_theme.css +++ b/static/instance_theme.css @@ -438,6 +438,26 @@ html[data-theme="light"] .strategy-subnav { } /* ── 策略交易 / 策略记录(strategy_templates 内联)── */ +html[data-theme="dark"] .strategy-records-page .sr-summary, +html[data-theme="dark"] .strategy-records-page .sr-detail { + color: #cfd3ef !important; +} +html[data-theme="dark"] .strategy-records-page .sr-summary .sr-sym, +html[data-theme="dark"] .strategy-records-page .sr-detail-grid .val { + color: #f0f2ff !important; +} +html[data-theme="dark"] .strategy-records-page .sr-summary .sr-dca-tag { + color: #8892b0 !important; +} +html[data-theme="dark"] .strategy-records-page .sr-summary .sr-pnl.pos, +html[data-theme="dark"] .strategy-records-page .sr-pnl.pos { + color: #4cd97f !important; +} +html[data-theme="dark"] .strategy-records-page .sr-summary .sr-pnl.neg, +html[data-theme="dark"] .strategy-records-page .sr-pnl.neg { + color: #ff6666 !important; +} + html[data-theme="light"] .strategy-records-page h2, html[data-theme="light"] .plan-card-title, html[data-theme="light"] .sr-panel-title, diff --git a/strategy_snapshot_lib.py b/strategy_snapshot_lib.py index 4446fda..77df764 100644 --- a/strategy_snapshot_lib.py +++ b/strategy_snapshot_lib.py @@ -323,7 +323,13 @@ def enrich_strategy_snapshot_row(row: dict) -> dict: d["filter_pnl"] = "flat" else: d["filter_pnl"] = "unknown" - sym = (d.get("symbol") or d.get("exchange_symbol") or "").strip() + snap_sym = "" + if isinstance(snap, dict): + snap_sym = (snap.get("symbol") or snap.get("exchange_symbol") or "").strip() + sym = (d.get("symbol") or d.get("exchange_symbol") or snap_sym or "").strip() + if sym: + d["symbol"] = d.get("symbol") or sym + d["exchange_symbol"] = d.get("exchange_symbol") or sym d["filter_symbol"] = sym.upper().split("/")[0].split(":")[0] if sym else "" closed = (d.get("closed_at") or d.get("created_at") or "").strip() d["sort_ts"] = closed diff --git a/strategy_templates/strategy_records_page.html b/strategy_templates/strategy_records_page.html index 812afec..03b73e5 100644 --- a/strategy_templates/strategy_records_page.html +++ b/strategy_templates/strategy_records_page.html @@ -12,18 +12,23 @@ .sr-chip-row{display:flex;flex-wrap:wrap;gap:6px;align-items:center} .sr-chip{padding:5px 12px;border:1px solid #304164;border-radius:16px;background:#151a2a;color:#9aa3c4;font-size:.74rem;cursor:pointer;user-select:none} .sr-chip.active{background:#2a3f6c;color:#dbe4ff;border-color:#4a6a9a} -.sr-panels{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px} +.sr-panels{display:grid;grid-template-columns:repeat(2,minmax(280px,1fr));gap:14px} @media (max-width:960px){.sr-panels{grid-template-columns:1fr}} -.sr-panel{background:#141a2a;border:1px solid #2a3150;border-radius:12px;padding:12px 14px;min-height:120px} +.sr-panel{background:#141a2a;border:1px solid #2a3150;border-radius:12px;padding:12px 14px;min-height:120px;min-width:0} .sr-panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:8px} .sr-panel-title{font-size:.92rem;font-weight:700;color:#f0f2ff} .sr-panel-title.trend{color:#6ab8ff} .sr-panel-title.roll{color:#ffb020} .sr-panel-count{font-size:.72rem;color:#8892b0} -.sr-list{display:flex;flex-direction:column;gap:8px;max-height:62vh;overflow:auto} -.sr-item{border:1px solid #243050;border-radius:10px;background:#0f1424;overflow:hidden} +.sr-list{display:flex;flex-direction:column;gap:8px;max-height:62vh;overflow:auto;min-width:0} +.sr-item{border:1px solid #243050;border-radius:10px;background:#0f1424;overflow:visible} .sr-item.sr-hidden{display:none} -.sr-summary{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;padding:10px 12px;cursor:pointer;font-size:.78rem;color:#cfd3ef;line-height:1.45} +.sr-summary{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;padding:10px 12px;cursor:pointer;font-size:.78rem;color:#cfd3ef !important;line-height:1.45;min-height:2.4rem;min-width:0} +.sr-summary > span{flex:0 1 auto;min-width:0;color:inherit} +.sr-summary .sr-sym{color:#f0f2ff !important;flex-shrink:0} +.sr-summary .sr-dca-tag{color:#8892b0 !important} +.sr-summary .sr-pnl.pos{color:#4cd97f !important} +.sr-summary .sr-pnl.neg{color:#ff6666 !important} .sr-summary:hover{background:rgba(42,63,108,.2)} .sr-summary::before{content:"▸";color:#6ab8ff;margin-right:2px;transition:transform .15s} .sr-item.sr-open .sr-summary::before{transform:rotate(90deg)} @@ -86,7 +91,7 @@ {% set snap = s.snapshot or {} %} {% set dca = snap.dca_levels if snap.dca_levels is defined else [] %} {% set pnl = s.pnl_amount if s.pnl_amount is not none else snap.pnl_amount %} - {% set sym = s.symbol or s.exchange_symbol or '—' %} + {% set sym = s.symbol or s.exchange_symbol or snap.symbol or snap.exchange_symbol or '—' %}
#{{ s.id }} {{ sym }} @@ -140,7 +145,7 @@ {% set group = snap.group if snap.group is defined else {} %} {% set legs = snap.legs if snap.legs is defined else [] %} {% set pnl = s.pnl_amount if s.pnl_amount is not none else snap.pnl_amount %} - {% set sym = s.symbol or s.exchange_symbol or '—' %} + {% set sym = s.symbol or s.exchange_symbol or snap.symbol or snap.exchange_symbol or '—' %}
#{{ s.id }} {{ sym }}