feat: cockpit

This commit is contained in:
OpenSquared
2026-07-24 21:26:41 +02:00
parent 8af398467e
commit 2d9040dbae
2 changed files with 12 additions and 8 deletions

View File

@@ -34,7 +34,7 @@ export default function TradeRankList({ trades, mode, title, linkTo, toggle, tic
const isBear = t.strategy?.toLowerCase().includes('put') || t.strategy?.toLowerCase().includes('bear') const isBear = t.strategy?.toLowerCase().includes('put') || t.strategy?.toLowerCase().includes('bear')
const entryDate = t.entry_date ? t.entry_date.slice(0, 10) : null const entryDate = t.entry_date ? t.entry_date.slice(0, 10) : null
return ( return (
<div key={i} className="flex items-center gap-1.5 text-[10px]"> <div key={i} className="flex items-center gap-1.5 text-[10px] rounded px-1 -mx-1 py-0.5 hover:bg-dark-700/40 transition-colors">
<span className="text-[9px] text-slate-700 font-mono w-3 shrink-0">{i + 1}</span> <span className="text-[9px] text-slate-700 font-mono w-3 shrink-0">{i + 1}</span>
<span className="shrink-0">{isBear ? '🐻' : '🐂'}</span> <span className="shrink-0">{isBear ? '🐻' : '🐂'}</span>
<span className="font-mono text-slate-200 font-bold shrink-0"> <span className="font-mono text-slate-200 font-bold shrink-0">

View File

@@ -228,14 +228,18 @@ export default function Dashboard() {
} }
const underlyingDisplayName = (underlying: string): string => { const underlyingDisplayName = (underlying: string): string => {
if (!underlying) return underlying if (!underlying) return underlying
const upper = underlying.toUpperCase() const upper = underlying.trim().toUpperCase()
const watchlistTickers = new Set(((watchlistItems as any[]) ?? []).map(w => w.ticker.toUpperCase())) const watchlistTickers = new Set(((watchlistItems as any[]) ?? []).map(w => String(w.ticker).trim().toUpperCase()))
const baseTicker = upper.replace(/(=X|=F)$/, '') const baseTicker = upper.replace(/(=X|=F)$/, '')
if (watchlistTickers.has(upper)) return upper let resolved = underlying
if (watchlistTickers.has(baseTicker)) return baseTicker if (watchlistTickers.has(upper)) resolved = upper
const alias = UNDERLYING_ALIASES[upper] else if (watchlistTickers.has(baseTicker)) resolved = baseTicker
if (alias && watchlistTickers.has(alias)) return alias else {
return underlying const alias = UNDERLYING_ALIASES[upper]
if (alias && watchlistTickers.has(alias)) resolved = alias
}
console.warn('[TradesOverview] underlyingDisplayName', { raw: underlying, upper, baseTicker, watchlistTickers: Array.from(watchlistTickers), resolved })
return resolved
} }
// Patterns from the last cycle only (filter by created_at >= cycle started_at) // Patterns from the last cycle only (filter by created_at >= cycle started_at)