(status: AITaskStatus)
| 27 | } |
| 28 | |
| 29 | export const getTaskStatusDisplay = (status: AITaskStatus) => { |
| 30 | switch (status) { |
| 31 | case 'running': |
| 32 | return { |
| 33 | text: '运行中', |
| 34 | color: 'processing', |
| 35 | icon: <ClockCircleOutlined /> |
| 36 | } |
| 37 | case 'completed': |
| 38 | return { |
| 39 | text: '已完成', |
| 40 | color: 'success', |
| 41 | icon: <CheckCircleOutlined /> |
| 42 | } |
| 43 | case 'failed': |
| 44 | return { |
| 45 | text: '失败', |
| 46 | color: 'error', |
| 47 | icon: <CloseCircleOutlined /> |
| 48 | } |
| 49 | case 'cancelled': |
| 50 | return { |
| 51 | text: '已取消', |
| 52 | color: 'default', |
| 53 | icon: <StopOutlined /> |
| 54 | } |
| 55 | default: |
| 56 | return { |
| 57 | text: '未知', |
| 58 | color: 'default', |
| 59 | icon: <ClockCircleOutlined /> |
| 60 | } |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | export const getTaskTypeName = (type: AITaskType): string => { |
| 65 | switch (type) { |
nothing calls this directly
no outgoing calls
no test coverage detected