refactor: restructure project directories for better modularity

- Delete llm/ dead code (3 files, zero references)
- Split mcp/ into sub-packages: mcp/provider/ (8 providers) and
  mcp/payment/ (4 payment clients) with registry pattern
- Export Client internal fields and ClientHooks interface for
  sub-package access
- Split api/server.go (3892 lines) into 8 domain-specific handler files
- Split trader/auto_trader.go (2296 lines) into 5 focused files
- Reorganize web/src/components/ flat files into auth/, charts/,
  trader/, common/, modals/, backtest/ subdirectories
- Update all consumer imports to use registry-based provider creation
This commit is contained in:
tinkle-community
2026-03-11 23:58:13 +08:00
parent 6a30e11ee5
commit 8e294a5eed
103 changed files with 6391 additions and 8984 deletions

View File

@@ -0,0 +1,80 @@
interface IconProps {
width?: number
height?: number
className?: string
}
// AI model colors for fallback display
const MODEL_COLORS: Record<string, string> = {
deepseek: '#4A90E2',
qwen: '#9B59B6',
claude: '#D97757',
kimi: '#6366F1',
gemini: '#4285F4',
grok: '#000000',
openai: '#10A37F',
minimax: '#E45735',
'blockrun-base': '#2563EB',
'blockrun-sol': '#9945FF',
claw402: '#7C3AED',
}
// 获取AI模型图标的函数
export const getModelIcon = (modelType: string, props: IconProps = {}) => {
// 支持完整ID或类型名
const type = modelType.includes('_') ? modelType.split('_').pop() : modelType
let iconPath: string | null = null
switch (type) {
case 'deepseek':
iconPath = '/icons/deepseek.svg'
break
case 'qwen':
iconPath = '/icons/qwen.svg'
break
case 'claude':
iconPath = '/icons/claude.svg'
break
case 'kimi':
iconPath = '/icons/kimi.svg'
break
case 'gemini':
iconPath = '/icons/gemini.svg'
break
case 'grok':
iconPath = '/icons/grok.svg'
break
case 'openai':
iconPath = '/icons/openai.svg'
break
case 'minimax':
iconPath = '/icons/minimax.svg'
break
case 'blockrun-base':
case 'blockrun-sol':
iconPath = '/icons/blockrun.svg'
break
case 'claw402':
iconPath = '/icons/claw402.png'
break
default:
return null
}
return (
<img
src={iconPath}
alt={`${type} icon`}
width={props.width || 24}
height={props.height || 24}
className={props.className}
/>
)
}
// 获取模型颜色用于没有图标时的fallback
export const getModelColor = (modelType: string): string => {
const type = modelType.includes('_') ? modelType.split('_').pop() : modelType
return MODEL_COLORS[type || ''] || '#60a5fa'
}