feat(ui): add tooltip to session progress column
Explain the progress calculation (completed/estimated sessions) when hovering over the progress bar in the evaluation list.
This commit is contained in:
parent
60981b634d
commit
af8c7d6810
@ -1,7 +1,7 @@
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { useNavigate } from 'react-router-dom'
|
import { useNavigate } from 'react-router-dom'
|
||||||
import {
|
import {
|
||||||
Button, Drawer, Empty, Form, Input, InputNumber, Popconfirm, Progress, Select, Space, Spin, Table, Tabs, Tag, message,
|
Button, Drawer, Empty, Form, Input, InputNumber, Popconfirm, Progress, Select, Space, Spin, Table, Tabs, Tag, Tooltip, message,
|
||||||
} from 'antd'
|
} from 'antd'
|
||||||
import type { TabsProps } from 'antd'
|
import type { TabsProps } from 'antd'
|
||||||
import type { ColumnsType } from 'antd/es/table'
|
import type { ColumnsType } from 'antd/es/table'
|
||||||
@ -165,14 +165,17 @@ export default function IntelligentEvalsPage() {
|
|||||||
const estimated = ev.plan?.estimated_sessions ?? ev.session_count
|
const estimated = ev.plan?.estimated_sessions ?? ev.session_count
|
||||||
const running = (ev.sessions ?? []).filter((s) => s.status === 'running').length
|
const running = (ev.sessions ?? []).filter((s) => s.status === 'running').length
|
||||||
const pct = estimated ? Math.round((ev.completed_sessions / estimated) * 100) : 0
|
const pct = estimated ? Math.round((ev.completed_sessions / estimated) * 100) : 0
|
||||||
|
const tooltipText = `已完成 ${ev.completed_sessions} 个会话 / 预估 ${estimated} 个会话${running > 0 ? `(${running} 个进行中)` : ''}`
|
||||||
return (
|
return (
|
||||||
<Space size={6}>
|
<Tooltip title={tooltipText}>
|
||||||
<Progress percent={pct} size="small" style={{ width: 90 }} />
|
<Space size={6}>
|
||||||
<span style={{ fontSize: 12, color: colors.textSecondary }}>
|
<Progress percent={pct} size="small" style={{ width: 90 }} />
|
||||||
{ev.completed_sessions}/{estimated}
|
<span style={{ fontSize: 12, color: colors.textSecondary }}>
|
||||||
{running > 0 && <span style={{ color: statusColors.running, marginLeft: 4 }}>({running} 进行中)</span>}
|
{ev.completed_sessions}/{estimated}
|
||||||
</span>
|
{running > 0 && <span style={{ color: statusColors.running, marginLeft: 4 }}>({running} 进行中)</span>}
|
||||||
</Space>
|
</span>
|
||||||
|
</Space>
|
||||||
|
</Tooltip>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user