From c018b3693a725b8046e9029cf9c791725fefe562 Mon Sep 17 00:00:00 2001 From: eezd Date: Thu, 15 Oct 2026 20:16:34 +0800 Subject: [PATCH] Restyle the web UI in a light theme, step 1: theme, top nav, demo trading Follow the Stitch "Daylight" design: light canvas, white panels with hairline borders, deep cyan primary, Inter for UI text and JetBrains Mono for numbers (bundled via @fontsource-variable). - Override Element Plus variables in one place and derive light/dark shades with color-mix; pages use the UnoCSS Tailwind palette. - Replace the sidebar with a horizontal top navigation bar. - Rebuild the demo trading page: status panel with metric tiles, positions table, and a three-column layout (symbols, plan card, open orders and timeline); restyle the analysis drawer. - Fix the stale risk wording in the trading capital dialog. --- web/package.json | 2 + web/pnpm-lock.yaml | 16 + web/src/layouts/index.vue | 65 ++- web/src/main.ts | 2 + .../trading/components/AnalysisDrawer.vue | 106 +++- web/src/pages/trading/components/PlanCard.vue | 285 ++++++--- web/src/pages/trading/index.vue | 542 +++++++++++------- web/src/styles/index.css | 126 +++- web/types/components.d.ts | 20 +- web/uno.config.ts | 10 +- 10 files changed, 836 insertions(+), 338 deletions(-) diff --git a/web/package.json b/web/package.json index 7094504..58bf2e4 100644 --- a/web/package.json +++ b/web/package.json @@ -10,6 +10,8 @@ }, "dependencies": { "@element-plus/icons-vue": "^2.3.2", + "@fontsource-variable/inter": "^5.3.0", + "@fontsource-variable/jetbrains-mono": "^5.3.0", "axios": "^1.20.0", "dayjs": "^1.11.23", "element-plus": "^2.14.7", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index e1b4979..b19f412 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -11,6 +11,12 @@ importers: '@element-plus/icons-vue': specifier: ^2.3.2 version: 2.3.2(vue@3.5.43(typescript@6.0.3)) + '@fontsource-variable/inter': + specifier: ^5.3.0 + version: 5.3.0 + '@fontsource-variable/jetbrains-mono': + specifier: ^5.3.0 + version: 5.3.0 axios: specifier: ^1.20.0 version: 1.20.0(debug@4.4.3) @@ -303,6 +309,12 @@ packages: '@floating-ui/utils@0.2.12': resolution: {integrity: sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==} + '@fontsource-variable/inter@5.3.0': + resolution: {integrity: sha512-OupL48va4JNofb97w6NYeF9S7W/kHNKM0Er8Dem5nqi4jeOLrVJDoE8tZEpnMJmtkvNbB1EIPPwHcdkF6b1oUA==} + + '@fontsource-variable/jetbrains-mono@5.3.0': + resolution: {integrity: sha512-F32xpS2NsGYoQi2ADSkKTgpJj7ozajsGgDJ8woTnqjmIB+dxDIqImjl4pXZVEExu8UFZ2ndhmX18EBS/hdz3Lw==} + '@humanfs/core@0.19.2': resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==} engines: {node: '>=18.18.0'} @@ -2889,6 +2901,10 @@ snapshots: '@floating-ui/utils@0.2.12': {} + '@fontsource-variable/inter@5.3.0': {} + + '@fontsource-variable/jetbrains-mono@5.3.0': {} + '@humanfs/core@0.19.2': dependencies: '@humanfs/types': 0.15.0 diff --git a/web/src/layouts/index.vue b/web/src/layouts/index.vue index 1fd17ff..a9f2e52 100644 --- a/web/src/layouts/index.vue +++ b/web/src/layouts/index.vue @@ -1,8 +1,8 @@ + + diff --git a/web/src/main.ts b/web/src/main.ts index 40d97be..8d07854 100644 --- a/web/src/main.ts +++ b/web/src/main.ts @@ -3,6 +3,8 @@ import App from "@/App.vue" import { router } from "@/router" import "element-plus/dist/index.css" import "element-plus/theme-chalk/dark/css-vars.css" +import "@fontsource-variable/inter" +import "@fontsource-variable/jetbrains-mono" import "@/styles/index.css" import "virtual:uno.css" diff --git a/web/src/pages/trading/components/AnalysisDrawer.vue b/web/src/pages/trading/components/AnalysisDrawer.vue index fa4604b..686d49e 100644 --- a/web/src/pages/trading/components/AnalysisDrawer.vue +++ b/web/src/pages/trading/components/AnalysisDrawer.vue @@ -24,6 +24,9 @@ const toolResults = computed(() => { return results }) +const duration = computed(() => detail.value?.finished_at ? Math.round((new Date(detail.value.finished_at).getTime() - new Date(detail.value.started_at).getTime()) / 1000) : null) +const toolCallCount = computed(() => (detail.value?.transcript ?? []).reduce((n, m) => n + (m.role === "assistant" ? m.tool_calls.length : 0), 0)) + function pretty(raw: string | undefined) { if (raw === undefined) return "无结果" @@ -38,31 +41,92 @@ function pretty(raw: string | undefined) {