fix: add Chinese labels for security-events type/risk/result
All checks were successful
Deploy Admin Frontend / build-and-deploy (push) Successful in 8s

This commit is contained in:
wangdl 2026-06-19 13:25:20 +08:00
parent def5c953be
commit 2400e48777

View File

@ -4,6 +4,12 @@ import { ReloadOutlined, SafetyOutlined } from '@ant-design/icons'
import { api } from '@/services/http-client'
import dayjs from 'dayjs'
const contentTypeLabels: Record<string, string> = {
text: '文本', image: '图片', chat: '聊天', knowledge_item: '知识点', knowledge_base: '知识库',
}
const riskLabels: Record<string, string> = { critical: '严重', high: '高', medium: '中', low: '低' }
const resultLabels: Record<string, string> = { pending: '待审核', passed: '通过', blocked: '拦截' }
const { Title } = Typography
export default function SecurityEventsPage() {
@ -12,10 +18,10 @@ export default function SecurityEventsPage() {
const cols = [
{ title: '时间', dataIndex: 'createdAt', width: 140, render: (d: string) => dayjs(d).format('MM-DD HH:mm:ss') },
{ title: '类型', dataIndex: 'contentType', width: 100 },
{ title: '类型', dataIndex: 'contentType', width: 100, render: (v: string) => contentTypeLabels[v] || v },
{ title: '用户', dataIndex: 'userId', width: 100, ellipsis: true , render: (_: any, r: any) => r.userName || r.userId },
{ title: '风险', dataIndex: 'riskLevel', width: 70, render: (v: string) => <Tag color={v==='critical'?'red':v==='high'?'orange':'default'}>{v}</Tag> },
{ title: '结果', dataIndex: 'result', width: 80, render: (v: string) => <Tag color={v==='passed'?'green':v==='blocked'?'red':'gold'}>{v}</Tag> },
{ title: '风险', dataIndex: 'riskLevel', width: 70, render: (v: string) => <Tag color={v==='critical'?'red':v==='high'?'orange':'default'}>{riskLabels[v] || v}</Tag> },
{ title: '结果', dataIndex: 'result', width: 80, render: (v: string) => <Tag color={v==='passed'?'green':v==='blocked'?'red':'gold'}>{resultLabels[v] || v}</Tag> },
{ title: '匹配词', dataIndex: 'matchedWords', ellipsis: true, width: 150, render: (v: string) => v || '-' },
]