mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-06 04:20:59 +08:00
- Redesign dashboard into a cream-paper + vermilion IBM Plex Mono terminal (live L2 order book, cost/liq map, WS K-line, signal matrix, orchestration topology, risk radar, execution log, current positions, equity curve) - Convert all user-facing UI and backend strings/prompts from Chinese to English (multi-language retained, default English) - Add /api/statistics/full endpoint + full-stats frontend wiring - Fix Autopilot launch: reuse the existing trader instead of creating duplicates (eliminates repeat ~35s create cost and stale-trader 404s); launch sends 5m scan interval - Fix unreadable toasts: cream theme with high-contrast text + per-type accent - Silence background dashboard polls (getTraderConfig) to stop error-toast spam
75 lines
1.7 KiB
TypeScript
75 lines
1.7 KiB
TypeScript
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',
|
|
claw402: '#7C3AED',
|
|
}
|
|
|
|
// Returns the icon for an AI model
|
|
export const getModelIcon = (modelType: string, props: IconProps = {}) => {
|
|
// Supports full ID or type name
|
|
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 '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}
|
|
/>
|
|
)
|
|
}
|
|
|
|
// Returns the model color (fallback for when there is no icon)
|
|
export const getModelColor = (modelType: string): string => {
|
|
const type = modelType.includes('_') ? modelType.split('_').pop() : modelType
|
|
return MODEL_COLORS[type || ''] || '#E0483B'
|
|
}
|