diff --git a/daili/src/features/security/pages/SecurityBatchesPage.tsx b/daili/src/features/security/pages/SecurityBatchesPage.tsx index 92b8627..fcb6931 100644 --- a/daili/src/features/security/pages/SecurityBatchesPage.tsx +++ b/daili/src/features/security/pages/SecurityBatchesPage.tsx @@ -5,7 +5,7 @@ import { FunnelStepper } from '../../../components/security/FunnelStepper'; import { Badge } from '../../../components/ui/Badge'; import { ErrorState } from '../../../components/ui/ErrorState'; import { LoadingState } from '../../../components/ui/LoadingState'; -import { EXECUTION_STATUS_LABELS, RISK_LEVEL_LABELS, SCAN_OUTCOME_LABELS } from '../../../types/labels'; +import { BATCH_STATUS_LABELS,EXECUTION_STATUS_LABELS, RISK_LEVEL_LABELS, SCAN_OUTCOME_LABELS } from '../../../types/labels'; import { SecurityBatchDetail, SecurityBatchSummary } from '../../../types'; const PAGE_LIMIT = 20; @@ -89,7 +89,7 @@ export function SecurityBatchesPage() {
- {batch.status} + {BATCH_STATUS_LABELS[batch.status] ?? batch.status} {batch.maxScanDepth ?? 'basic'}
目标 {batch.targetProxyCount},已检 {batch.checkedProxyCount},异常 {batch.anomalyEventCount}
@@ -108,7 +108,7 @@ export function SecurityBatchesPage() {

批次详情

{detail.batch.batchId}

- {detail.batch.status} + {BATCH_STATUS_LABELS[detail.batch.status] ?? detail.batch.status}
@@ -152,6 +152,24 @@ export function SecurityBatchesPage() { ); } +function batchStatusTone(status: string) { + switch (status) { + case 'completed': + return 'success'; + case 'running': + return 'info'; + case 'pending': + return 'warning'; + case 'failed': + case 'error': + return 'danger'; + case 'cancelled': + return 'neutral'; + default: + return 'neutral'; + } +} + function Metric({ label, value }: { label: string; value: number }) { return
{label}
{value}
; } diff --git a/daili/src/types/labels.ts b/daili/src/types/labels.ts index 7f98122..7c91e9a 100644 --- a/daili/src/types/labels.ts +++ b/daili/src/types/labels.ts @@ -30,6 +30,15 @@ export const EXECUTION_STATUS_LABELS: Record = { timeout: '超时', }; +export const BATCH_STATUS_LABELS: Record = { + pending: '等待中', + running: '执行中', + completed: '已完成', + failed: '执行失败', + error: '执行错误', + cancelled: '已取消', +}; + export const APPLICABILITY_LABELS: Record = { applicable: '适用', not_applicable: '不适用',