815b3758a7
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 47s
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
CI/CD Pipeline / Validate - Code Quality (push) Successful in 5m25s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 2m37s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 2m25s
CI/CD Pipeline / Unit Tests (push) Successful in 9m11s
CI/CD Pipeline / Integration Tests (push) Successful in 2m40s
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 3m7s
CI/CD Pipeline / PR Build API Image (push) Has been skipped
CI/CD Pipeline / PR Build Web Image (push) Has been skipped
CI/CD Pipeline / PR Build Worker Image (push) Has been skipped
CI/CD Pipeline / Build Staging API Image (push) Successful in 15m16s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 3m2s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 7m58s
CI/CD Pipeline / Build Production API Image (push) Has been skipped
CI/CD Pipeline / Build Production Web Image (push) Has been skipped
CI/CD Pipeline / Build Production Worker Image (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / CI Gate (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (push) Has been cancelled
CI/CD Pipeline / ACR Image Cleanup (push) Has been cancelled
CI/CD Pipeline / Canary Release to Production (push) Has been cancelled
73 lines
1.8 KiB
TypeScript
Executable File
73 lines
1.8 KiB
TypeScript
Executable File
import React from "react"
|
|
import { Table } from "antd"
|
|
import type { TaskItem } from "@/api/tasks"
|
|
import { TaskErrorDetail } from "./TaskErrorDetail"
|
|
import { useTaskTableColumns, TaskEmptyState } from "./task-table"
|
|
|
|
interface TaskTableProps {
|
|
dataSource: TaskItem[]
|
|
loading: boolean
|
|
total: number
|
|
page: number
|
|
pageSize: number
|
|
expandedTaskId: string | null
|
|
expandedTaskDetail: TaskItem | null
|
|
retryLoading: boolean
|
|
onPageChange: (page: number, pageSize: number) => void
|
|
onExpand: (expanded: boolean, record: TaskItem) => void
|
|
onRetry: (id: string) => void
|
|
onViewDetail: (record: TaskItem) => void
|
|
}
|
|
|
|
/**
|
|
* 任务列表表格
|
|
*/
|
|
export const TaskTable: React.FC<TaskTableProps> = ({
|
|
dataSource,
|
|
loading,
|
|
total,
|
|
page,
|
|
pageSize,
|
|
expandedTaskId,
|
|
expandedTaskDetail,
|
|
retryLoading,
|
|
onPageChange,
|
|
onExpand,
|
|
onRetry,
|
|
onViewDetail,
|
|
}) => {
|
|
const columns = useTaskTableColumns({ retryLoading, onRetry, onViewDetail })
|
|
|
|
return (
|
|
<Table
|
|
columns={columns}
|
|
dataSource={dataSource}
|
|
rowKey="id"
|
|
loading={loading}
|
|
pagination={{
|
|
current: page,
|
|
pageSize,
|
|
total,
|
|
showSizeChanger: true,
|
|
showQuickJumper: true,
|
|
showTotal: (t) => `共 ${t} 条`,
|
|
onChange: onPageChange,
|
|
}}
|
|
expandable={{
|
|
expandedRowRender: (record) => (
|
|
<TaskErrorDetail record={record} detail={expandedTaskDetail} />
|
|
),
|
|
expandedRowKeys: expandedTaskId ? [expandedTaskId] : [],
|
|
onExpand,
|
|
rowExpandable: (record) =>
|
|
record.status === "failed" && (!!record.error_info || !!record.error_message),
|
|
}}
|
|
scroll={{ x: 800 }}
|
|
className="task-table"
|
|
locale={{
|
|
emptyText: <TaskEmptyState />,
|
|
}}
|
|
/>
|
|
)
|
|
}
|