Fix strategy records list showing empty rows after hub close.
Records were still in the database but CSS clipping hid row text; restore visible summary styling and symbol fallback from snapshots. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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}
|
||||
</style>
|
||||
<link rel="stylesheet" href="/static/instance_theme.css?v=8">
|
||||
<link rel="stylesheet" href="/static/instance_theme.css?v=9">
|
||||
|
||||
</head>
|
||||
<body data-page="{{ page }}">
|
||||
|
||||
@@ -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}
|
||||
</style>
|
||||
<link rel="stylesheet" href="/static/instance_theme.css?v=8">
|
||||
<link rel="stylesheet" href="/static/instance_theme.css?v=9">
|
||||
|
||||
</head>
|
||||
<body data-page="{{ page }}">
|
||||
|
||||
@@ -269,7 +269,7 @@
|
||||
.stats-split-row{grid-template-columns:1fr}
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="/static/instance_theme.css?v=8">
|
||||
<link rel="stylesheet" href="/static/instance_theme.css?v=9">
|
||||
|
||||
</head>
|
||||
<body data-page="{{ page }}">
|
||||
|
||||
@@ -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}
|
||||
</style>
|
||||
<link rel="stylesheet" href="/static/instance_theme.css?v=8">
|
||||
<link rel="stylesheet" href="/static/instance_theme.css?v=9">
|
||||
|
||||
</head>
|
||||
<body data-page="{{ page }}">
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 '—' %}
|
||||
<div class="sr-item" data-symbol="{{ s.filter_symbol or '' }}" data-pnl="{{ s.filter_pnl or '' }}" data-dca-tag="{{ s.dca_tag or '' }}" data-dca-done="{{ s.dca_done|default(0) }}" data-sort-ts="{{ s.sort_ts or '' }}">
|
||||
<div class="sr-summary" role="button" tabindex="0">
|
||||
<span class="sr-sym">#{{ s.id }} {{ sym }}</span>
|
||||
@@ -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 '—' %}
|
||||
<div class="sr-item" data-symbol="{{ s.filter_symbol or '' }}" data-pnl="{{ s.filter_pnl or '' }}" data-dca-tag="{{ s.dca_tag or '' }}" data-dca-done="{{ s.dca_done|default(0) }}" data-sort-ts="{{ s.sort_ts or '' }}">
|
||||
<div class="sr-summary" role="button" tabindex="0">
|
||||
<span class="sr-sym">#{{ s.id }} {{ sym }}</span>
|
||||
|
||||
Reference in New Issue
Block a user