Restyle the web UI as a dark trading terminal

- Single palette (web/src/styles/palette.ts) taken from the Stitch
  design, exposed as ap-* UnoCSS colors and --ap-* CSS variables and
  used for Element Plus dark theme overrides, KLineChart and the news
  iframe; zero radius, JetBrains Mono / Space Grotesk bundled locally
- New sidebar and header layout; trading page, plan card and analysis
  drawer follow the design; other pages use the same panels
- Status API reports today's closed trades, wins and net PnL, shown as
  today's PnL and win rate on the trading page
This commit is contained in:
eezd committed 2026-10-15 18:28:59 +08:00
1 parent 665c12fc31
commit d5fa78f1ad
31 files changed
+1199 -505

No files matched your search

+6
View File
@@ -4,6 +4,12 @@ export function formatTime(value: string | null | undefined, pattern = "MM-DD HH
return value ? dayjs(value).format(pattern) : "-"
}
/** 两个时间点之间的耗时,如「1m 52s」 */
export function formatDuration(from: string, to: string) {
const seconds = Math.round((new Date(to).getTime() - new Date(from).getTime()) / 1000)
return seconds >= 60 ? `${Math.floor(seconds / 60)}m ${seconds % 60}s` : `${seconds}s`
}
/** HTML 转纯文本行;DOMParser 解析的文档不会执行脚本 */
export function htmlToLines(html: string): string[] {
const marked = html.replace(/<br\s*\/?>|<\/(?:p|div|li|h\d)>/gi, "\n")