fix(intelligent-eval): task queue pagination + column widths align with eval list
All checks were successful
CI / test (push) Successful in 3m58s

任务队列页对齐评估列表:
- 分页:始终显示(pageSize 10 + showSizeChanger + showTotal),此前仅在
  >10 条时显示导致 t480(8 条)无分页器
- 列宽重新分配:评估列 230→300(长名称不截断)、原因列固定 240(ellipsis)、
  入队/完成时间 170、队列状态 100、优先级 80
- 字体格式对齐评估列表:去掉 size="middle" 改用默认(与评估列表一致)
tsc 0 错误 vitest 16 passed
This commit is contained in:
sinohqb 2026-08-18 10:35:51 +08:00
parent 47804f2df3
commit 57951f7940

View File

@ -67,11 +67,11 @@ export default function TaskQueueMonitor() {
const columns: ColumnsType<TaskQueueItem> = [
{
title: '入队时间', dataIndex: 'created_at', key: 'created_at', width: 165,
title: '入队时间', dataIndex: 'created_at', key: 'created_at', width: 170,
render: (v: string | null) => (v ? formatDateTime(v) : '—'),
},
{
title: '评估', key: 'eval', width: 230, ellipsis: true,
title: '评估', key: 'eval', width: 300, ellipsis: true,
render: (_, t) => (
<Space size={6}>
<span style={{ fontWeight: 500 }}>{t.eval_name ?? t.eval_id.slice(0, 8)}</span>
@ -84,22 +84,22 @@ export default function TaskQueueMonitor() {
),
},
{
title: '队列状态', dataIndex: 'status', key: 'status', width: 96,
title: '队列状态', dataIndex: 'status', key: 'status', width: 100,
render: (s: TaskQueueStatus) => {
const meta = STATUS_META[s]
return <Tag color={meta.color}>{meta.label}</Tag>
},
},
{
title: '优先级', dataIndex: 'priority', key: 'priority', width: 76,
title: '优先级', dataIndex: 'priority', key: 'priority', width: 80,
render: (p: number) => <Tag>{p}</Tag>,
},
{
title: '原因', dataIndex: 'reason', key: 'reason', ellipsis: true,
title: '原因', dataIndex: 'reason', key: 'reason', width: 240, ellipsis: true,
render: (r: string) => <Tooltip title={r}><span>{r}</span></Tooltip>,
},
{
title: '完成时间', dataIndex: 'completed_at', key: 'completed_at', width: 165,
title: '完成时间', dataIndex: 'completed_at', key: 'completed_at', width: 170,
render: (v: string | null, t) => {
if (t.status === 'failed' && t.error) {
return <Tooltip title={t.error}><span style={{ color: statusColors.failed }}></span></Tooltip>
@ -131,11 +131,15 @@ export default function TaskQueueMonitor() {
<div style={{ height: 'calc(100% - 44px)', overflowY: 'auto' }}>
<Table
rowKey="id"
size="middle"
loading={loading}
dataSource={tasks ?? []}
columns={columns}
pagination={(tasks?.length ?? 0) > 10 ? { pageSize: 10, showTotal: (t) => `${t}` } : false}
pagination={{
pageSize: 10,
showSizeChanger: true,
pageSizeOptions: [10, 20, 50],
showTotal: (t) => `${t}`,
}}
locale={{ emptyText: <Empty description="暂无任务" /> }}
/>
</div>