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 { useNavigate } from 'react-router-dom'
|
||||
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'
|
||||
import type { TabsProps } from 'antd'
|
||||
import type { ColumnsType } from 'antd/es/table'
|
||||
@ -165,7 +165,9 @@ export default function IntelligentEvalsPage() {
|
||||
const estimated = ev.plan?.estimated_sessions ?? ev.session_count
|
||||
const running = (ev.sessions ?? []).filter((s) => s.status === 'running').length
|
||||
const pct = estimated ? Math.round((ev.completed_sessions / estimated) * 100) : 0
|
||||
const tooltipText = `已完成 ${ev.completed_sessions} 个会话 / 预估 ${estimated} 个会话${running > 0 ? `(${running} 个进行中)` : ''}`
|
||||
return (
|
||||
<Tooltip title={tooltipText}>
|
||||
<Space size={6}>
|
||||
<Progress percent={pct} size="small" style={{ width: 90 }} />
|
||||
<span style={{ fontSize: 12, color: colors.textSecondary }}>
|
||||
@ -173,6 +175,7 @@ export default function IntelligentEvalsPage() {
|
||||
{running > 0 && <span style={{ color: statusColors.running, marginLeft: 4 }}>({running} 进行中)</span>}
|
||||
</span>
|
||||
</Space>
|
||||
</Tooltip>
|
||||
)
|
||||
},
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user