fix(qa): ISSUE-001 localize leader pool statuses

This commit is contained in:
codyhhchen
2026-05-04 16:34:03 +08:00
parent e7894480f3
commit e114312c0c
4 changed files with 33 additions and 13 deletions
+9
View File
@@ -566,6 +566,15 @@
"safetyHint": "Leader Pool will not auto-scale positions or auto-enable large copy trading.",
"safetyDesc": "Trial configs created from the pool use conservative defaults and are disabled by default.",
"fetchFailed": "Failed to fetch Leader Pool",
"statuses": {
"CANDIDATE": "Candidate",
"WATCH": "Watch",
"PAPER": "Paper",
"TRIAL": "Trial",
"ACTIVE": "Active",
"COOLDOWN": "Cooldown",
"RETIRED": "Retired"
},
"selectLeaderPlaceholder": "Select an existing Leader to add",
"selectLeaderFirst": "Please select a Leader first",
"addExistingLeader": "Add to Pool",
+9
View File
@@ -566,6 +566,15 @@
"safetyHint": "Leader 池不会自动加仓,也不会自动启用大额跟单。",
"safetyDesc": "从池子创建试跟配置时会使用保守默认值,并默认禁用。你可以之后在跟单配置页手动启用。",
"fetchFailed": "获取 Leader 池失败",
"statuses": {
"CANDIDATE": "候选",
"WATCH": "观察",
"PAPER": "模拟",
"TRIAL": "小额试跟",
"ACTIVE": "活跃",
"COOLDOWN": "冷却",
"RETIRED": "淘汰"
},
"selectLeaderPlaceholder": "选择已有 Leader 加入池子",
"selectLeaderFirst": "请先选择一个 Leader",
"addExistingLeader": "加入池子",
+9
View File
@@ -566,6 +566,15 @@
"safetyHint": "Leader 池不會自動加倉,也不會自動啟用大額跟單。",
"safetyDesc": "從池子創建試跟配置時會使用保守默認值,並默認禁用。你可以之後在跟單配置頁手動啟用。",
"fetchFailed": "獲取 Leader 池失敗",
"statuses": {
"CANDIDATE": "候選",
"WATCH": "觀察",
"PAPER": "模擬",
"TRIAL": "小額試跟",
"ACTIVE": "活躍",
"COOLDOWN": "冷卻",
"RETIRED": "淘汰"
},
"selectLeaderPlaceholder": "選擇已有 Leader 加入池子",
"selectLeaderFirst": "請先選擇一個 Leader",
"addExistingLeader": "加入池子",
+6 -13
View File
@@ -40,16 +40,6 @@ const VISIBLE_STATUSES: Array<{ value: LeaderPoolStatus; color: string }> = [
type LeaderPoolFilterValue = LeaderPoolStatus | 'ALL'
const statusLabels: Record<LeaderPoolStatus, string> = {
CANDIDATE: '候选',
WATCH: '观察',
PAPER: '模拟',
TRIAL: '小额试跟',
ACTIVE: '活跃',
COOLDOWN: '冷却',
RETIRED: '淘汰'
}
const formatDate = (timestamp?: number) => {
if (!timestamp) return '-'
return dayjs(timestamp).format('YYYY-MM-DD HH:mm')
@@ -83,6 +73,9 @@ const LeaderPool: React.FC = () => {
const [planForm] = Form.useForm()
const [trialForm] = Form.useForm()
const statusLabel = (status: LeaderPoolStatus) =>
t(`leaderPool.statuses.${status}`, { defaultValue: status })
const fetchPool = async (status = statusFilter) => {
setLoading(true)
try {
@@ -285,7 +278,7 @@ const LeaderPool: React.FC = () => {
width: 120,
render: (status: LeaderPoolStatus) => {
const meta = VISIBLE_STATUSES.find(item => item.value === status)
return <Tag color={meta?.color || 'default'}>{statusLabels[status] || status}</Tag>
return <Tag color={meta?.color || 'default'}>{statusLabel(status)}</Tag>
}
},
{
@@ -431,7 +424,7 @@ const LeaderPool: React.FC = () => {
onChange={(value: LeaderPoolFilterValue) => setStatusFilter(value === 'ALL' ? undefined : value)}
options={[
{ value: 'ALL', label: t('common.all') },
...VISIBLE_STATUSES.map(item => ({ value: item.value, label: statusLabels[item.value] }))
...VISIBLE_STATUSES.map(item => ({ value: item.value, label: statusLabel(item.value) }))
]}
/>
<Table
@@ -461,7 +454,7 @@ const LeaderPool: React.FC = () => {
>
<Form form={statusForm} layout="vertical">
<Form.Item name="status" label={t('common.status')} rules={[{ required: true }]}>
<Select options={VISIBLE_STATUSES.map(item => ({ value: item.value, label: statusLabels[item.value] }))} />
<Select options={VISIBLE_STATUSES.map(item => ({ value: item.value, label: statusLabel(item.value) }))} />
</Form.Item>
<Form.Item shouldUpdate noStyle>
{({ getFieldValue }) => getFieldValue('status') === 'COOLDOWN' ? (