Liu Xiang Qian
|
f6b3972847
|
feat: 添加 AI 扫描决策间隔配置支持
## 功能描述
在创建和编辑 Trader 时,支持配置 AI 扫描决策间隔(scan_interval_minutes),允许用户自定义 AI 决策的频率。
## 修改内容
### 后端修改 (api/server.go)
1. **CreateTraderRequest** 添加 `ScanIntervalMinutes` 字段
2. **UpdateTraderRequest** 添加 `ScanIntervalMinutes` 字段和 `SystemPromptTemplate` 字段
3. **handleCreateTrader** 处理扫描间隔默认值(默认 3 分钟)
4. **handleUpdateTrader** 支持更新扫描间隔
5. **handleGetTraderConfig** 返回中添加 `scan_interval_minutes` 字段
### 前端修改
#### web/src/types.ts
- `CreateTraderRequest` 添加 `scan_interval_minutes?` 可选字段
- `TraderConfigData` 添加 `scan_interval_minutes` 必填字段
#### web/src/components/TraderConfigModal.tsx
- 本地 `TraderConfigData` 接口添加 `scan_interval_minutes`
- 初始状态设置默认值为 3 分钟
- 添加 UI 输入框(范围 1-60 分钟)
- Label 优化为 "AI 扫描决策间隔 (分钟)"
#### web/src/components/AITradersPage.tsx
- `handleSaveEditTrader` 的更新请求中添加 `scan_interval_minutes`
#### web/src/components/landing/CommunitySection.tsx
- 修复 TypeScript 编译错误:定义 `CardProps` 接口
- 修正 `TestimonialCard` 组件的 prop 名称(author → authorName)
## 功能特性
- ✅ 支持 1-60 分钟的自定义间隔
- ✅ 默认值为 3 分钟
- ✅ UI 提示建议范围:3-10 分钟
- ✅ 创建和编辑时均支持配置
- ✅ 后端验证和处理默认值
## 测试步骤
1. 创建新 Trader,设置自定义扫描间隔(如 10 分钟)
2. 验证 Trader 创建成功
3. 编辑现有 Trader,修改扫描间隔
4. 验证修改保存成功
5. 确认 AI 决策按照新的间隔执行
|
2025-11-03 21:55:26 +08:00 |
|
Ember
|
2b1b93f22e
|
ui(web): 对齐 #138 风格——用 Lucide/矢量图标替换表情与占位,增强空态/警告显示(ComparisonChart/Competition/AITraders/ConfigModal)
|
2025-11-02 01:02:15 +08:00 |
|
icy
|
40152c6a2a
|
Remote auth for prompt templates
|
2025-11-01 20:25:55 +08:00 |
|
SkywalkerJi
|
5afbd9a3c3
|
Supports custom system prompts and custom models.
|
2025-11-01 19:45:54 +08:00 |
|
SkywalkerJi
|
6efdc47379
|
* Fixed the custom model URL.
* Added functionality for custom model names.
|
2025-11-01 16:09:15 +08:00 |
|
icy
|
ccd4938857
|
竞赛fix、交易员新增参数
|
2025-11-01 02:17:11 +08:00 |
|