'use client' import Pagination, { type Props as PaginationProps } from '@/app/components/base/pagination' import type { FC } from 'react' import Button from '@/app/components/base/button' import cn from '@/utils/classnames' import { useTranslation } from 'react-i18next' import useTimestamp from '@/hooks/use-timestamp' import { downloadLogFile } from '@/service/common' type PageListProps = { list: [] pagination: PaginationProps onUpdate: () => void } const LogPageList: FC = ({ list = [], pagination, onUpdate, }) => { const { t } = useTranslation() const { formatTime } = useTimestamp() const statusMap = new Map([ ['CREATED', '创建'], ['TRAINING', '训练中'], ['COMPLETED', '完成'], ]) const handleDownload = async (item: any) => { await downloadLogFile({ url: `/intentions/train_tasks/download/${item.id}`, fileName: item.name, }) } return (
{list.map((item: any, index) => ( ))}
训练任务 训练状态 训练语料数据集版本 训练时间 训练模型结果版本 操作
{item.name} {statusMap.get(item.status)} {item.dataset_info.version} {formatTime(item.created_at, t('datasetHitTesting.dateTimeFormat') as string)} {item.model_info.version}
{/* Show Pagination only if the total is more than the limit */} {pagination.total && ( )}
) } export default LogPageList