feat: 添加尾盘策略配置指南文档和前端链接
- 新增中文和英文配置指南文档(docs/zh|en/crypto-tail-strategy-user-guide.md) - 在尾盘策略列表页面添加配置指南链接按钮 - 根据用户语言自动跳转到对应语言的 GitHub 文档预览 - 添加多语言翻译键(中文简体/繁体/英文) Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1428,7 +1428,8 @@
|
||||
"delete": "Delete",
|
||||
"viewTriggers": "Orders",
|
||||
"deleteConfirm": "Delete this strategy?",
|
||||
"fetchFailed": "Failed to fetch list"
|
||||
"fetchFailed": "Failed to fetch list",
|
||||
"configGuide": "Configuration Guide"
|
||||
},
|
||||
"form": {
|
||||
"walletTip": "Use a dedicated wallet to avoid balance or order issues.",
|
||||
|
||||
@@ -1427,7 +1427,8 @@
|
||||
"delete": "删除",
|
||||
"viewTriggers": "订单",
|
||||
"deleteConfirm": "确定删除该策略?",
|
||||
"fetchFailed": "获取列表失败"
|
||||
"fetchFailed": "获取列表失败",
|
||||
"configGuide": "配置指南"
|
||||
},
|
||||
"form": {
|
||||
"walletTip": "建议使用专用钱包,避免手动操作等导致余额或下单异常。",
|
||||
|
||||
@@ -1428,7 +1428,8 @@
|
||||
"delete": "刪除",
|
||||
"viewTriggers": "訂單",
|
||||
"deleteConfirm": "確定刪除該策略?",
|
||||
"fetchFailed": "獲取列表失敗"
|
||||
"fetchFailed": "獲取列表失敗",
|
||||
"configGuide": "配置指南"
|
||||
},
|
||||
"form": {
|
||||
"walletTip": "建議使用專用錢包,避免手動操作等導致餘額或下單異常。",
|
||||
|
||||
@@ -26,16 +26,17 @@ import {
|
||||
} from 'antd'
|
||||
import type { Dayjs } from 'dayjs'
|
||||
import dayjs from 'dayjs'
|
||||
import { PlusOutlined, EditOutlined, UnorderedListOutlined, InfoCircleOutlined, WarningOutlined, CalendarOutlined, ArrowUpOutlined, ArrowDownOutlined } from '@ant-design/icons'
|
||||
import { PlusOutlined, EditOutlined, UnorderedListOutlined, InfoCircleOutlined, WarningOutlined, CalendarOutlined, ArrowUpOutlined, ArrowDownOutlined, FileTextOutlined } from '@ant-design/icons'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useMediaQuery } from 'react-responsive'
|
||||
import { apiService } from '../services/api'
|
||||
import { useAccountStore } from '../store/accountStore'
|
||||
import type { CryptoTailStrategyDto, CryptoTailStrategyTriggerDto, CryptoTailMarketOptionDto } from '../types'
|
||||
import { formatUSDC, formatNumber } from '../utils'
|
||||
import { getVersionInfo } from '../utils/version'
|
||||
|
||||
const CryptoTailStrategyList: React.FC = () => {
|
||||
const { t } = useTranslation()
|
||||
const { t, i18n } = useTranslation()
|
||||
const navigate = useNavigate()
|
||||
const isMobile = useMediaQuery({ maxWidth: 768 })
|
||||
const { accounts, fetchAccounts } = useAccountStore()
|
||||
@@ -531,9 +532,25 @@ const CryptoTailStrategyList: React.FC = () => {
|
||||
})
|
||||
}, [formModalOpen, editingId, selectedMarket, intervalSeconds])
|
||||
|
||||
const getGuideUrl = () => {
|
||||
const { githubRepoUrl } = getVersionInfo()
|
||||
const lang = i18n.language === 'zh-CN' || i18n.language === 'zh-TW' ? 'zh' : 'en'
|
||||
return `${githubRepoUrl}/blob/main/docs/${lang}/crypto-tail-strategy-user-guide.md`
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={{ padding: isMobile ? 12 : 24 }}>
|
||||
<h1 style={{ marginBottom: 16, fontSize: isMobile ? 20 : 24 }}>{t('cryptoTailStrategy.list.title')}</h1>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 16, flexWrap: 'wrap' }}>
|
||||
<h1 style={{ margin: 0, fontSize: isMobile ? 20 : 24 }}>{t('cryptoTailStrategy.list.title')}</h1>
|
||||
<Button
|
||||
type="link"
|
||||
icon={<FileTextOutlined />}
|
||||
onClick={() => window.open(getGuideUrl(), '_blank')}
|
||||
style={{ padding: 0, height: 'auto', fontSize: isMobile ? 14 : 16 }}
|
||||
>
|
||||
{t('cryptoTailStrategy.list.configGuide')}
|
||||
</Button>
|
||||
</div>
|
||||
{binanceUnhealthy.length > 0 && (
|
||||
<Alert
|
||||
type="error"
|
||||
|
||||
Reference in New Issue
Block a user