import { Descriptions, Drawer, Space, Tag, Typography } from '@arco-design/web-react' import type { BackupTaskDetail } from '../../types/backup-tasks' import { formatDateTime } from '../../utils/format' import { getBackupTaskStatusColor, getBackupTaskStatusLabel, getBackupTaskTypeLabel } from './field-config' interface BackupTaskDetailDrawerProps { visible: boolean task: BackupTaskDetail | null onCancel: () => void } export function BackupTaskDetailDrawer({ visible, task, onCancel }: BackupTaskDetailDrawerProps) { return ( {task ? (
{task.name} {getBackupTaskTypeLabel(task.type)} {task.enabled ? '已启用' : '已停用'} {getBackupTaskStatusLabel(task.lastStatus)}
0 ? task.storageTargetNames.join('、') : (task.storageTargetName || task.storageTargetId) }, { label: '保留天数', value: task.retentionDays }, { label: '最大保留份数', value: task.maxBackups }, { label: '压缩', value: task.compression }, { label: '加密', value: task.encrypt ? '已启用' : '未启用' }, { label: '最近执行', value: formatDateTime(task.lastRunAt) }, { label: '创建时间', value: formatDateTime(task.createdAt) }, { label: '更新时间', value: formatDateTime(task.updatedAt) }, ]} /> {task.type === 'file' ? ( 0 ? task.sourcePaths.join('\n') : (task.sourcePath || '-'), }, { label: '排除规则', value: task.excludePatterns.join(', ') || '-' }, ]} /> ) : null} {task.type === 'sqlite' ? : null} {task.type === 'mysql' || task.type === 'postgresql' ? ( ) : null}
) : null}
) }