From a5198b9a5b38d55d94175bd4c8d82376b0de1dd4 Mon Sep 17 00:00:00 2001 From: icy Date: Tue, 4 Nov 2025 00:16:14 +0800 Subject: [PATCH] =?UTF-8?q?Limit=20performance=20comparison=20chart=20to?= =?UTF-8?q?=20top=205=20traders=20Frontend=20changes=20to=20ensure=20equit?= =?UTF-8?q?y-history-batch=20API=20only=20requests=20data=20for=20top=205?= =?UTF-8?q?=20performers:=20-=20Modify=20CompetitionPage=20to=20pass=20onl?= =?UTF-8?q?y=20top=205=20traders=20to=20ComparisonChart=20component=20-=20?= =?UTF-8?q?Update=20API=20comments=20to=20reflect=20the=20change=20from=20?= =?UTF-8?q?top=2010=20to=20top=205=20-=20Optimize=20chart=20performance=20?= =?UTF-8?q?by=20reducing=20data=20volume=20and=20API=20calls=20This=20ensu?= =?UTF-8?q?res=20the=20performance=20comparison=20chart=20shows=20only=20t?= =?UTF-8?q?he=20most=20relevant=20traders=20while=20improving=20load=20tim?= =?UTF-8?q?es.=20=F0=9F=A4=96=20Generated=20with=20[Claude=20Code](https:/?= =?UTF-8?q?/claude.ai/code)=20Co-Authored-By:=20tinkle-community=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/AITradersPage.tsx | 8 ++++---- web/src/components/CompetitionPage.tsx | 2 +- web/src/lib/api.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/web/src/components/AITradersPage.tsx b/web/src/components/AITradersPage.tsx index 41b3cdc2..6965d8f8 100644 --- a/web/src/components/AITradersPage.tsx +++ b/web/src/components/AITradersPage.tsx @@ -182,8 +182,8 @@ export function AITradersPage({ onTraderSelect }: AITradersPageProps) { if (!editingTrader) return; try { - const model = enabledModels?.find(m => m.id === data.ai_model_id); - const exchange = enabledExchanges?.find(e => e.id === data.exchange_id); + const model = allModels?.find(m => m.id === data.ai_model_id); + const exchange = allExchanges?.find(e => e.id === data.exchange_id); if (!model) { alert(t('modelConfigNotExist', language)); @@ -782,8 +782,8 @@ export function AITradersPage({ onTraderSelect }: AITradersPageProps) { isOpen={showEditModal} isEditMode={true} traderData={editingTrader} - availableModels={enabledModels} - availableExchanges={enabledExchanges} + availableModels={allModels} + availableExchanges={allExchanges} onSave={handleSaveEditTrader} onClose={() => { setShowEditModal(false); diff --git a/web/src/components/CompetitionPage.tsx b/web/src/components/CompetitionPage.tsx index b123a75b..3168bd14 100644 --- a/web/src/components/CompetitionPage.tsx +++ b/web/src/components/CompetitionPage.tsx @@ -116,7 +116,7 @@ export function CompetitionPage() { {t('realTimePnL', language)} - + {/* Right: Leaderboard */} diff --git a/web/src/lib/api.ts b/web/src/lib/api.ts index 607f4be6..0e066dce 100644 --- a/web/src/lib/api.ts +++ b/web/src/lib/api.ts @@ -260,10 +260,10 @@ export const api = { return res.json(); }, - // 获取前10名交易员数据(无需认证) + // 获取前5名交易员数据(无需认证) async getTopTraders(): Promise { const res = await fetch(`${API_BASE}/top-traders`); - if (!res.ok) throw new Error('获取前10名交易员失败'); + if (!res.ok) throw new Error('获取前5名交易员失败'); return res.json(); },