@@ -8,7 +8,7 @@ import { useAuth } from '../contexts/AuthContext';
88import { getExchangeIcon } from './ExchangeIcons' ;
99import { getModelIcon } from './ModelIcons' ;
1010import { TraderConfigModal } from './TraderConfigModal' ;
11- import { Bot , Brain , Landmark , BarChart3 , Trash2 , Plus , Users , AlertTriangle } from 'lucide-react' ;
11+ import { Bot , Brain , Landmark , BarChart3 , Trash2 , Plus , Users , AlertTriangle , BookOpen } from 'lucide-react' ;
1212
1313// 获取友好的AI模型名称
1414function getModelDisplayName ( modelId : string ) : string {
@@ -1162,10 +1162,11 @@ function ExchangeConfigModal({
11621162 const [ secretKey , setSecretKey ] = useState ( '' ) ;
11631163 const [ passphrase , setPassphrase ] = useState ( '' ) ;
11641164 const [ testnet , setTestnet ] = useState ( false ) ;
1165-
1165+ const [ showGuide , setShowGuide ] = useState ( false ) ;
1166+
11661167 // Hyperliquid 特定字段
11671168 const [ hyperliquidWalletAddr , setHyperliquidWalletAddr ] = useState ( '' ) ;
1168-
1169+
11691170 // Aster 特定字段
11701171 const [ asterUser , setAsterUser ] = useState ( '' ) ;
11711172 const [ asterSigner , setAsterSigner ] = useState ( '' ) ;
@@ -1226,21 +1227,34 @@ function ExchangeConfigModal({
12261227 < h3 className = "text-xl font-bold" style = { { color : '#EAECEF' } } >
12271228 { editingExchangeId ? t ( 'editExchange' , language ) : t ( 'addExchange' , language ) }
12281229 </ h3 >
1229- { editingExchangeId && (
1230- < button
1231- type = "button"
1232- onClick = { ( ) => {
1233- if ( confirm ( t ( 'confirmDeleteExchange' , language ) ) ) {
1234- onDelete ( editingExchangeId ) ;
1235- }
1236- } }
1237- className = "p-2 rounded hover:bg-red-100 transition-colors"
1238- style = { { background : 'rgba(246, 70, 93, 0.1)' , color : '#F6465D' } }
1239- title = { t ( 'deleteConfigFailed' , language ) }
1240- >
1241- < Trash2 className = "w-4 h-4" />
1242- </ button >
1243- ) }
1230+ < div className = "flex items-center gap-2" >
1231+ { selectedExchange ?. id === 'binance' && (
1232+ < button
1233+ type = "button"
1234+ onClick = { ( ) => setShowGuide ( true ) }
1235+ className = "px-3 py-2 rounded text-sm font-semibold transition-all hover:scale-105 flex items-center gap-2"
1236+ style = { { background : 'rgba(240, 185, 11, 0.1)' , color : '#F0B90B' } }
1237+ >
1238+ < BookOpen className = "w-4 h-4" />
1239+ { t ( 'viewGuide' , language ) }
1240+ </ button >
1241+ ) }
1242+ { editingExchangeId && (
1243+ < button
1244+ type = "button"
1245+ onClick = { ( ) => {
1246+ if ( confirm ( t ( 'confirmDeleteExchange' , language ) ) ) {
1247+ onDelete ( editingExchangeId ) ;
1248+ }
1249+ } }
1250+ className = "p-2 rounded hover:bg-red-100 transition-colors"
1251+ style = { { background : 'rgba(246, 70, 93, 0.1)' , color : '#F6465D' } }
1252+ title = { t ( 'deleteConfigFailed' , language ) }
1253+ >
1254+ < Trash2 className = "w-4 h-4" />
1255+ </ button >
1256+ ) }
1257+ </ div >
12441258 </ div >
12451259
12461260 < form onSubmit = { handleSubmit } className = "space-y-4" >
@@ -1468,7 +1482,7 @@ function ExchangeConfigModal({
14681482 < button
14691483 type = "submit"
14701484 disabled = {
1471- ! selectedExchange ||
1485+ ! selectedExchange ||
14721486 ( selectedExchange . id === 'binance' && ( ! apiKey . trim ( ) || ! secretKey . trim ( ) ) ) ||
14731487 ( selectedExchange . id === 'okx' && ( ! apiKey . trim ( ) || ! secretKey . trim ( ) || ! passphrase . trim ( ) ) ) ||
14741488 ( selectedExchange . id === 'hyperliquid' && ( ! apiKey . trim ( ) || ! hyperliquidWalletAddr . trim ( ) ) ) ||
@@ -1483,6 +1497,34 @@ function ExchangeConfigModal({
14831497 </ div >
14841498 </ form >
14851499 </ div >
1500+
1501+ { /* Binance Setup Guide Modal */ }
1502+ { showGuide && (
1503+ < div className = "fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50 p-4" onClick = { ( ) => setShowGuide ( false ) } >
1504+ < div className = "bg-gray-800 rounded-lg p-6 w-full max-w-4xl relative" style = { { background : '#1E2329' } } onClick = { ( e ) => e . stopPropagation ( ) } >
1505+ < div className = "flex items-center justify-between mb-4" >
1506+ < h3 className = "text-xl font-bold flex items-center gap-2" style = { { color : '#EAECEF' } } >
1507+ < BookOpen className = "w-6 h-6" style = { { color : '#F0B90B' } } />
1508+ { t ( 'binanceSetupGuide' , language ) }
1509+ </ h3 >
1510+ < button
1511+ onClick = { ( ) => setShowGuide ( false ) }
1512+ className = "px-4 py-2 rounded text-sm font-semibold transition-all hover:scale-105"
1513+ style = { { background : '#2B3139' , color : '#848E9C' } }
1514+ >
1515+ { t ( 'closeGuide' , language ) }
1516+ </ button >
1517+ </ div >
1518+ < div className = "overflow-y-auto max-h-[80vh]" >
1519+ < img
1520+ src = "/images/guide.png"
1521+ alt = { t ( 'binanceSetupGuide' , language ) }
1522+ className = "w-full h-auto rounded"
1523+ />
1524+ </ div >
1525+ </ div >
1526+ </ div >
1527+ ) }
14861528 </ div >
14871529 ) ;
14881530}
0 commit comments