diff --git a/frontend/src/pages/ConfigPage.tsx b/frontend/src/pages/ConfigPage.tsx index c6c7226..32200ef 100644 --- a/frontend/src/pages/ConfigPage.tsx +++ b/frontend/src/pages/ConfigPage.tsx @@ -1,240 +1,41 @@ -import { useEffect, useState } from 'react' -import { Card, Form, Button, Switch, Radio, InputNumber, message, Typography } from 'antd' -import { SaveOutlined } from '@ant-design/icons' -import { apiService } from '../services/api' -import type { CopyTradingConfig } from '../types' -import { useMediaQuery } from 'react-responsive' +import { Card, Typography, Alert } from 'antd' +import { InfoCircleOutlined } from '@ant-design/icons' const { Title } = Typography +/** + * 全局配置页面 + * 注意:全局配置功能已迁移到模板和跟单关系管理 + * 请使用"跟单模板"和"跟单配置"页面进行配置 + */ const ConfigPage: React.FC = () => { - const isMobile = useMediaQuery({ maxWidth: 768 }) - const [form] = Form.useForm() - const [loading, setLoading] = useState(false) - const [, setConfig] = useState(null) - - useEffect(() => { - fetchConfig() - }, []) - - const fetchConfig = async () => { - try { - const response = await apiService.config.get() - if (response.data.code === 0 && response.data.data) { - const data = response.data.data - setConfig(data) - form.setFieldsValue(data) - } else { - message.error(response.data.msg || '获取配置失败') - } - } catch (error: any) { - message.error(error.message || '获取配置失败') - } - } - - const handleSubmit = async (values: any) => { - setLoading(true) - try { - const response = await apiService.config.update(values) - if (response.data.code === 0) { - message.success('更新配置成功') - fetchConfig() - } else { - message.error(response.data.msg || '更新配置失败') - } - } catch (error: any) { - message.error(error.message || '更新配置失败') - } finally { - setLoading(false) - } - } - return (
- 跟单配置 + 全局配置
-
- - - 比例模式 - 固定金额模式 - - - - prevValues.copyMode !== currentValues.copyMode} - > - {({ getFieldValue }) => { - const copyMode = getFieldValue('copyMode') - return copyMode === 'RATIO' ? ( - - - - ) : ( - - - - ) - }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ +

全局配置功能已迁移到以下页面:

+
    +
  • 跟单模板:管理跟单参数(比例、金额、风险控制等)
  • +
  • 跟单配置:将账户、模板和 Leader 关联,启用跟单关系
  • +
  • 系统管理:配置代理、查看 API 健康状态
  • +
+

请使用上述页面进行配置管理。

+
+ } + type="info" + icon={} + showIcon + /> ) } export default ConfigPage - diff --git a/frontend/src/pages/CopyTradingAdd.tsx b/frontend/src/pages/CopyTradingAdd.tsx index 843d058..bf98102 100644 --- a/frontend/src/pages/CopyTradingAdd.tsx +++ b/frontend/src/pages/CopyTradingAdd.tsx @@ -4,7 +4,7 @@ import { Card, Form, Button, Select, Switch, message, Typography, Space } from ' import { ArrowLeftOutlined, SaveOutlined } from '@ant-design/icons' import { apiService } from '../services/api' import { useAccountStore } from '../store/accountStore' -import type { Account, Leader, CopyTradingTemplate } from '../types' +import type { Leader, CopyTradingTemplate } from '../types' import { useMediaQuery } from 'react-responsive' import { formatUSDC } from '../utils' @@ -13,7 +13,7 @@ const { Option } = Select const CopyTradingAdd: React.FC = () => { const navigate = useNavigate() - const isMobile = useMediaQuery({ maxWidth: 768 }) + useMediaQuery({ maxWidth: 768 }) // 用于响应式布局,但当前页面未使用 const { accounts, fetchAccounts } = useAccountStore() const [form] = Form.useForm() const [loading, setLoading] = useState(false) diff --git a/frontend/src/pages/CopyTradingBuyOrders.tsx b/frontend/src/pages/CopyTradingBuyOrders.tsx index 6f5ff44..56a3e6b 100644 --- a/frontend/src/pages/CopyTradingBuyOrders.tsx +++ b/frontend/src/pages/CopyTradingBuyOrders.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' import { useParams, useNavigate } from 'react-router-dom' -import { Card, Table, Button, Tag, Select, Input, message, Space, Divider, Spin } from 'antd' +import { Card, Table, Button, Tag, Select, Input, message, Divider, Spin } from 'antd' import { LeftOutlined } from '@ant-design/icons' import { apiService } from '../services/api' import { formatUSDC } from '../utils' diff --git a/frontend/src/pages/CopyTradingList.tsx b/frontend/src/pages/CopyTradingList.tsx index a91405a..6634f19 100644 --- a/frontend/src/pages/CopyTradingList.tsx +++ b/frontend/src/pages/CopyTradingList.tsx @@ -1,11 +1,11 @@ import { useEffect, useState } from 'react' import { useNavigate } from 'react-router-dom' -import { Card, Table, Button, Space, Tag, Popconfirm, Switch, message, Select, Input, Dropdown, Divider, Spin } from 'antd' +import { Card, Table, Button, Space, Tag, Popconfirm, Switch, message, Select, Dropdown, Divider, Spin } from 'antd' import { PlusOutlined, DeleteOutlined, BarChartOutlined, UnorderedListOutlined, ArrowUpOutlined, ArrowDownOutlined } from '@ant-design/icons' import type { MenuProps } from 'antd' import { apiService } from '../services/api' import { useAccountStore } from '../store/accountStore' -import type { CopyTrading, Account, Leader, CopyTradingTemplate, CopyTradingStatistics } from '../types' +import type { CopyTrading, Leader, CopyTradingTemplate, CopyTradingStatistics } from '../types' import { useMediaQuery } from 'react-responsive' import { formatUSDC } from '../utils' diff --git a/frontend/src/pages/CopyTradingStatistics.tsx b/frontend/src/pages/CopyTradingStatistics.tsx index 34838b8..e70267f 100644 --- a/frontend/src/pages/CopyTradingStatistics.tsx +++ b/frontend/src/pages/CopyTradingStatistics.tsx @@ -10,7 +10,7 @@ import type { CopyTradingStatistics } from '../types' const CopyTradingStatisticsPage: React.FC = () => { const { copyTradingId } = useParams<{ copyTradingId: string }>() const navigate = useNavigate() - const isMobile = useMediaQuery({ maxWidth: 768 }) + useMediaQuery({ maxWidth: 768 }) // 用于响应式布局,但当前页面未使用 const [loading, setLoading] = useState(false) const [statistics, setStatistics] = useState(null) diff --git a/frontend/src/pages/TemplateEdit.tsx b/frontend/src/pages/TemplateEdit.tsx index b57c35d..a380e0b 100644 --- a/frontend/src/pages/TemplateEdit.tsx +++ b/frontend/src/pages/TemplateEdit.tsx @@ -11,7 +11,7 @@ const { Title } = Typography const TemplateEdit: React.FC = () => { const navigate = useNavigate() const { id } = useParams<{ id: string }>() - const isMobile = useMediaQuery({ maxWidth: 768 }) + useMediaQuery({ maxWidth: 768 }) // 用于响应式布局,但当前页面未使用 const [form] = Form.useForm() const [loading, setLoading] = useState(false) const [fetching, setFetching] = useState(false) diff --git a/frontend/src/pages/TemplateList.tsx b/frontend/src/pages/TemplateList.tsx index a85e241..8cb49ba 100644 --- a/frontend/src/pages/TemplateList.tsx +++ b/frontend/src/pages/TemplateList.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' import { useNavigate } from 'react-router-dom' -import { Card, Table, Button, Space, Tag, Popconfirm, message, Input, Modal, Form, Radio, InputNumber, Switch, Row, Col, Divider, Spin } from 'antd' +import { Card, Table, Button, Space, Tag, Popconfirm, message, Input, Modal, Form, Radio, InputNumber, Switch, Divider, Spin } from 'antd' import { PlusOutlined, EditOutlined, DeleteOutlined, CopyOutlined } from '@ant-design/icons' import { apiService } from '../services/api' import type { CopyTradingTemplate } from '../types' @@ -19,7 +19,7 @@ const TemplateList: React.FC = () => { const [copyForm] = Form.useForm() const [copyLoading, setCopyLoading] = useState(false) const [copyMode, setCopyMode] = useState<'RATIO' | 'FIXED'>('RATIO') - const [sourceTemplate, setSourceTemplate] = useState(null) + const [setSourceTemplate] = useState(null) // 用于跟踪复制的源模板 useEffect(() => { fetchTemplates()