fix: add Chinese labels for import status, type, and step fields
All checks were successful
Deploy Admin Frontend / build-and-deploy (push) Successful in 9s
All checks were successful
Deploy Admin Frontend / build-and-deploy (push) Successful in 9s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
3b936d6cb0
commit
5edc467d19
@ -31,14 +31,20 @@ export default function ImportMonitorPage() {
|
||||
qc.invalidateQueries({ queryKey: ['admin-imports'] })
|
||||
}
|
||||
|
||||
const statusLabel: Record<string, string> = {
|
||||
QUEUED: '排队中', PROCESSING: '处理中', COMPLETED: '已完成', FAILED: '失败', CANCELLED: '已取消',
|
||||
}
|
||||
const statusColor: Record<string, string> = {
|
||||
QUEUED: 'blue', PROCESSING: 'processing', COMPLETED: 'green', FAILED: 'red', CANCELLED: 'default',
|
||||
}
|
||||
const stepLabel: Record<string, string> = {
|
||||
pending: '待处理', running: '执行中', completed: '已完成', failed: '失败', skipped: '已跳过',
|
||||
}
|
||||
|
||||
const columns = [
|
||||
{ title: '名称', dataIndex: 'sourceName', width: 180, ellipsis: true },
|
||||
{ title: '类型', dataIndex: 'sourceType', width: 80 },
|
||||
{ title: '状态', dataIndex: 'status', width: 90, render: (s: string) => <Tag color={statusColor[s] || 'default'}>{s}</Tag> },
|
||||
{ title: '类型', dataIndex: 'sourceType', width: 80, render: (s: string) => (s === 'file' ? '文件' : s === 'url' ? '链接' : s === 'text' ? '文本' : s) },
|
||||
{ title: '状态', dataIndex: 'status', width: 90, render: (s: string) => <Tag color={statusColor[s] || 'default'}>{statusLabel[s] || s}</Tag> },
|
||||
{ title: '进度', dataIndex: 'progress', width: 70, render: (v: number) => `${v || 0}%` },
|
||||
{ title: '重试', dataIndex: 'retryCount', width: 60, align: 'center' as const },
|
||||
{ title: '步骤', dataIndex: 'step', width: 100, ellipsis: true },
|
||||
@ -57,7 +63,7 @@ export default function ImportMonitorPage() {
|
||||
|
||||
const stepCols = [
|
||||
{ title: '步骤', dataIndex: 'step', width: 120 },
|
||||
{ title: '状态', dataIndex: 'status', width: 80, render: (s: string) => <Tag color={s === 'completed' ? 'green' : s === 'failed' ? 'red' : 'blue'}>{s}</Tag> },
|
||||
{ title: '状态', dataIndex: 'status', width: 80, render: (s: string) => <Tag color={s === 'completed' ? 'green' : s === 'failed' ? 'red' : 'blue'}>{stepLabel[s] || s}</Tag> },
|
||||
{ title: '详情', dataIndex: 'detail', ellipsis: true },
|
||||
{ title: '开始', dataIndex: 'startedAt', width: 130, render: (d: string) => d ? dayjs(d).format('HH:mm:ss') : '-' },
|
||||
{ title: '完成', dataIndex: 'completedAt', width: 130, render: (d: string) => d ? dayjs(d).format('HH:mm:ss') : '-' },
|
||||
@ -75,7 +81,7 @@ export default function ImportMonitorPage() {
|
||||
{detail && (
|
||||
<>
|
||||
<Title level={5} style={{ fontSize: 14 }}>Job: {detail.job?.id}</Title>
|
||||
<Text>状态: <Tag color={statusColor[detail.job?.status]}>{detail.job?.status}</Tag></Text>
|
||||
<Text>状态: <Tag color={statusColor[detail.job?.status]}>{statusLabel[detail.job?.status] || detail.job?.status}</Tag></Text>
|
||||
<Text style={{ marginLeft: 16 }}>进度: {detail.job?.progress || 0}%</Text>
|
||||
<Text style={{ marginLeft: 16 }}>重试: {detail.job?.retryCount}/{detail.job?.maxRetries}</Text>
|
||||
{detail.job?.errorMessage && <div style={{ marginTop: 8 }}><Text type="danger">{detail.job?.errorMessage}</Text></div>}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user