Commit Graph

68 Commits

Author SHA1 Message Date
Ember
fee7d8ccd3 refactor(web): 拆分 LandingPage 为可复用组件(HeaderBar/Hero/AnimatedSection 等),新增 pages 结构并完成集成;构建通过 2025-11-02 00:36:37 +08:00
Ember
5a597abf61 refactor(web): 引入 pages 目录并迁移 LandingPage;修正 App 引用与相对路径,保持构建通过 2025-11-02 00:28:38 +08:00
Ember
20b485609d fix(web): 更新主图像文件以改善视觉效果 2025-11-02 00:19:49 +08:00
Ember
b0b8804392 fix(web): 优化落地页内容—移除多余空行,简化图片组件,更新支持方列表 2025-11-02 00:17:19 +08:00
Ember
e09fa5d1c4 style(web): 对齐币安风格—移除渐变/发光,固化深色/面板色,新增 header 样式,按钮与卡片统一 2025-11-02 00:08:46 +08:00
Ember
f26621dc6e fix(web): 去除残留 undefined(文本最终清洗)并将启动命令改为顶层 README 流程(start.sh + compose) 2025-11-02 00:01:38 +08:00
Ember
6f48c92da5 fix(web): Typewriter 更稳健—charAt防越界、sanitizedLines防空值、pre-wrap防换行丢失 2025-11-01 23:58:48 +08:00
Ember
95003cf376 feat(web): Typewriter 优化(修复 undefined、矩阵绿样式、降低速度)并更新启动指令为 README 前端开发流程 2025-11-01 23:53:17 +08:00
Ember
1ce500a97d feat(web): 落地页“启动输出”加入打字机效果(Typewriter) 2025-11-01 23:45:27 +08:00
Ember
664acf759f feat(web): 新增 Landing 页面与 UI 优化\n\n- 新增 LandingPage、CryptoFeatureCard 等组件\n- 登录/注册页面与样式优化\n- 静态资源 images/main.png 2025-11-01 23:36:28 +08:00
icy
40152c6a2a Remote auth for prompt templates 2025-11-01 20:25:55 +08:00
icy
1fdf227f38 Merge branch 'dev' of https://github.com/tinkle-community/nofx 2025-11-01 20:09:17 +08:00
SkywalkerJi
5afbd9a3c3 Supports custom system prompts and custom models. 2025-11-01 19:45:54 +08:00
icy
2b2fa1978f Fixed i18n lint 2025-11-01 19:39:27 +08:00
icy
a404725379 Resolve merge conflicts in AITradersPage.tsx
- Fixed import statement conflict (using 'type Language')
- Merged exchange configuration logic preserving support for multiple exchange types
- Kept comprehensive form handling for Binance, Hyperliquid, Aster, and OKX exchanges
- Updated security warning messages to use proper translation keys

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-01 19:01:44 +08:00
icy
7674ce1da7 Fixed health check; Fixed dex config; Add rank trader info view; 2025-11-01 18:58:32 +08:00
SkywalkerJi
9f9c35826d Rename the model. 2025-11-01 17:10:36 +08:00
SkywalkerJi
6efdc47379 * Fixed the custom model URL.
*   Added functionality for custom model names.
2025-11-01 16:09:15 +08:00
tangmengqiu
c8c59b558b fix: Remove duplicate selectExchange key in translations
Fixed TypeScript compilation error TS1117 caused by duplicate
'selectExchange' key in both English and Chinese translation objects.

The key was already defined in the "AI Traders Management" section,
so removed the duplicate from "AI Traders Page - Additional" section.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-01 00:02:00 -04:00
tangmengqiu
3d5a0f747a fix: Complete i18n implementation for English language display
This commit addresses the issue where switching to English still showed Chinese text in many UI elements.

Changes made:
- Added 40+ missing translation keys to translations.ts for both English and Chinese
- Updated App.tsx to use t() function for all hardcoded text (logout button, loading message)
- Updated AITradersPage.tsx extensively:
  - Replaced all alert/confirm messages with translation keys
  - Updated status labels (inUse, enabled, configured)
  - Updated all modal components (SignalSource, ModelConfig, ExchangeConfig)
  - Added language prop to all modal components
  - Replaced all Chinese UI text with translation function calls

The implementation now properly supports language switching between English and Chinese throughout the entire application.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-31 23:58:44 -04:00
icy
905adc69c3 删除未使用的AlertTriangle导入
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-01 02:34:33 +08:00
icy
c39c629c22 手动合并冲突,保留TraderConfigModal功能并添加lucide-react图标支持
- 解决AITradersPage.tsx合并冲突,保留TraderConfigModal导入
- 添加lucide-react图标库支持
- 保留信号源配置的OI TOP URL功能
- 使用我们版本解决其他文件冲突,保持UI简洁
- 确保编译成功和依赖正确安装

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-11-01 02:33:37 +08:00
icy
bf83e89b33 Merge branch 'dev' of github.com:Icyoung/nofx
# Conflicts:
#	manager/trader_manager.go
#	web/src/components/AITradersPage.tsx
2025-11-01 02:23:05 +08:00
icy
ccd4938857 竞赛fix、交易员新增参数 2025-11-01 02:17:11 +08:00
Ember
f4ce57d52d UI feat: replace Lucide icons with logo images in multiple components 2025-10-31 23:54:10 +08:00
Ember
10f8ceb69a feat: enhance UI with Lucide icons across various components
- add logo
- Replaced emoji placeholders with Lucide icons in AITradersPage, CompetitionPage, EquityChart, Header, LoginPage, and RegisterPage for improved visual consistency.
- Updated button styles to include icons for actions like adding models and exchanges.
- Enhanced error and empty state displays with relevant icons to provide better user feedback.
2025-10-31 23:28:19 +08:00
Ember
d35e4ca46d Fix: Add proper validation for Aster DEX exchange in trader creation
- Add specific field validation for Aster exchange (asterUser, asterSigner, asterPrivateKey)
- Add specific field validation for Hyperliquid exchange (apiKey, hyperliquidWalletAddr)
- Keep existing validation for Binance (apiKey, secretKey)
- Remove debug console logs
- Fix issue where Aster exchange was not appearing in trader creation dropdown

This ensures all three supported exchanges can be properly selected when creating a new AI trader.
2025-10-31 21:40:21 +08:00
SkywalkerJi
363b32718e Change the minimum amount to 50 and remove the maximum amount limit. 2025-10-31 18:34:48 +08:00
icy
9edcd19caa Route fix 2025-10-31 13:49:05 +08:00
icy
56a6d7e5a7 Add MarginMode configration 2025-10-31 13:14:24 +08:00
icy
87d163340a Merge branch 'main' of github.com:Icyoung/nofx
# Conflicts:
#	config.json.example
#	config/config.go
#	main.go
#	trader/auto_trader.go
#	web/src/App.tsx
#	web/src/components/CompetitionPage.tsx
2025-10-31 03:59:58 +08:00
icy
d3e7b7dbb1 account system、custom prompt 2025-10-31 03:42:01 +08:00
tinkle-community
5f036d7669 UI: Unify trader colors between Leaderboard and Performance Chart
Problem:
- Leaderboard used ai_model-based colors (qwen=purple, other=blue)
- Performance Comparison used index-based colors (10 color pool)
- This caused color mismatch between the two components
- Same trader showed different colors in different sections

Solution:
- Create shared color utility (utils/traderColors.ts)
- Define single color pool with 10 distinct colors
- Implement unified getTraderColor function based on trader index
- Update both ComparisonChart and CompetitionPage to use shared utility

Changes:
- New file: web/src/utils/traderColors.ts (shared color logic)
- Updated: ComparisonChart.tsx (use shared utility)
- Updated: CompetitionPage.tsx (use shared utility in Leaderboard
  and Head-to-Head sections)

Now traders consistently display the same color across all UI sections.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-30 22:21:57 +08:00
tinkle-community
e8aec99d36 UI: Fix duplicate colors in Performance Comparison chart
Problem:
- Multiple traders using the same AI model had duplicate colors
- Only 2 colors were available (blue for deepseek, purple for qwen)
- Made it difficult to distinguish between traders

Solution:
- Expand color pool from 2 to 10 distinct colors
- Change color assignment from ai_model-based to index-based
- Each trader now gets a unique color based on their position
- Colors cycle if there are more than 10 traders

Color pool includes: blue, purple, emerald, orange, pink, amber,
sky, violet, green, rose

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-30 22:12:09 +08:00
tinkle-community
f5931bd9eb feat: Add trader enabled switch and fix critical bugs
New Features:
- Add 'enabled' field to trader config for selective startup
- Only enabled traders will be initialized and run
- Display skip messages for disabled traders in logs

Bug Fixes:
- Fix Hyperliquid account value calculation
  * AccountValue is total equity, no need to add TotalMarginUsed
  * Correctly calculate wallet balance without unrealized PnL
  * Fix available balance calculation (AccountValue - TotalMarginUsed)
- Fix frontend page refresh navigation issue
  * Use URL hash to persist page state across refreshes
  * Support browser back/forward buttons
  * Prevent Details page from reverting to Competition on refresh

Technical Changes:
- config/config.go: Add Enabled bool field to TraderConfig
- main.go: Skip disabled traders during initialization
- trader/hyperliquid_trader.go: Correct account value logic
- web/src/App.tsx: Implement hash-based routing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-30 21:07:43 +08:00
icy
a2cded592b Merge remote tracking branch into local development
- Resolved conflicts in README.md: Combined web-based config updates with multi-exchange support
- Resolved conflicts in main.go: Fixed database initialization and default coin settings
- Resolved conflicts in manager/trader_manager.go: Updated trader management for new database structure
- Resolved conflicts in web/src/App.tsx: Combined UI improvements with responsive design
- Resolved conflicts in web/.dockerignore: Merged dependency exclusions
- Removed deprecated files: Dockerfile, config/config.go, web/Dockerfile, ComparisonChart.tsx, CompetitionPage.tsx

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-30 20:57:57 +08:00
icy
c64727ffd0 sync fork 2025-10-30 20:51:22 +08:00
tinkle-community
8b52138424 UI: Display position details in Trade History
Frontend changes:
- Update TradeOutcome interface with new fields:
  - quantity: Position size
  - leverage: Leverage multiplier
  - position_value: Total position value
  - margin_used: Margin required

- Add position details display in trade cards:
  - Quantity (with 4 decimal precision)
  - Leverage (shown as "50x")
  - Position Value (shown as "$10000.00")
  - Margin Used (shown as "$200.00")

Visual design:
- 2x2 grid layout for position details
- Color coding: Leverage in gold, Margin in purple
- Conditional rendering with fallback "-" for missing data

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-30 18:11:15 +08:00
刘 志
eaaaaf3d1e fix: hyperliquid余额不准确 2025-10-30 08:38:31 +00:00
tinkle-community
7283035445 Merge pull request #40 from d0lwl0b/main
docs: modernize Docker Compose documentation to V2 syntax
2025-10-30 14:24:52 +08:00
SkywalkerJi
27bd26c8a6 Reduce the request frequency to the Binance API and add backend caching. 2025-10-30 14:01:06 +08:00
d0lwl0b
1faacf0565 Merge branch 'tinkle-community:main' into main 2025-10-30 13:49:39 +08:00
d0lwl0b
f9524c459a refactor(docker): restructure Docker setup with dedicated backend/frontend services 2025-10-30 13:11:29 +08:00
SkywalkerJi
45ae0f714e Smooth the account equity curve. 2025-10-30 12:53:27 +08:00
d0lwl0b
0dc341675f Merge branch 'tinkle-community:main' into main 2025-10-30 12:26:21 +08:00
d0lwl0b
10f9ad0288 Merge branch 'tinkle-community:main' into main 2025-10-30 12:13:00 +08:00
SkywalkerJi
616215cdd9 Optimize mobile display to prevent selection boxes from exceeding the screen boundaries. 2025-10-30 12:08:39 +08:00
sue
3f002a193e fix: 修复配置硬编码问题
## 修复内容

### 1. AI决策杠杆配置动态化 (decision/engine.go)
- **问题**: System Prompt 中硬编码 50x/20x 杠杆,导致 AI 生成的决策不符合用户配置(5x)
- **修复**:
  - buildSystemPrompt() 新增 btcEthLeverage, altcoinLeverage 参数
  - System Prompt 文本使用动态杠杆值(第225-226行)
  - 示例 JSON 使用配置杠杆值(第299行)
  - 调用时传入实际配置值(第100行)
- **影响**: AI 现在会根据用户配置的杠杆限制生成决策

### 2. 前端初始余额显示优化 (web/src/components/EquityChart.tsx)
- **问题**: 初始余额硬编码为 1000 USDT,与用户配置的 100 USDT 不符
- **修复**: 实现三级回退机制
  1. 优先使用历史数据第一个点的 total_equity
  2. 备用使用当前账户 account.total_equity
  3. 最后使用默认值 100(匹配常见配置)
- **影响**: 前端显示的初始余额现在与实际配置一致

## 技术细节

**函数签名变更**:
```go
// 修改前
func buildSystemPrompt(accountEquity float64) string

// 修改后
func buildSystemPrompt(accountEquity float64, btcEthLeverage, altcoinLeverage int) string
```

**React 状态优化**:
```typescript
// 修改前
const initialBalance = history[0]?.total_equity || 1000;

// 修改后
const initialBalance = history[0]?.total_equity || account?.total_equity || 100;
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-30 02:43:14 +08:00
sue
0d7325e082 fix: 修复AI学习数据加载失败问题
问题描述:
- AILearning组件直接使用硬编码的localhost:8080地址
- 绕过了Vite代理配置,导致加载失败
- 在生产环境无法正常工作

修复内容:
1. api.ts: 添加统一的getPerformance()方法
2. AILearning.tsx: 移除硬编码URL,使用统一API
3. 删除多余的fetcher函数

技术改进:
- 使用Vite代理配置,避免CORS问题
- 统一API管理,提高可维护性
- 支持开发和生产环境

影响范围:
- web/src/lib/api.ts: +11行 (新增getPerformance方法)
- web/src/components/AILearning.tsx: -4行, +2行 (重构API调用)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: tinkle-community <tinklefund@gmail.com>
2025-10-30 01:36:51 +08:00
d0lwl0b
b39399fe85 chore: update .dockerignore to exclude lock files 2025-10-30 00:28:39 +08:00