feat(ui): widen drawer and restructure overview tab layout
- Drawer width: 1000px → 1200px for more content space - Overview tab: move user input to full-width bottom section - Seeds JSON area: maxHeight 160px → 300px with better padding - Unify font sizes: 13px body, 12px labels/tags throughout - Fix progress calculation to use estimated_sessions consistently
This commit is contained in:
parent
af8c7d6810
commit
63e96c2bf2
@ -19,18 +19,18 @@ function PlanView({ ev }: { ev: IntelligentEval }) {
|
||||
if (!plan) return <Empty description="暂无粗计划" image={Empty.PRESENTED_IMAGE_SIMPLE} />
|
||||
return (
|
||||
<div>
|
||||
<Descriptions column={3} size="small" bordered style={{ marginBottom: 12 }}>
|
||||
<Descriptions column={3} size="small" bordered style={{ marginBottom: 12 }} labelStyle={{ fontSize: 12 }} contentStyle={{ fontSize: 13 }}>
|
||||
<Descriptions.Item label="预估会话数">{plan.estimated_sessions}</Descriptions.Item>
|
||||
<Descriptions.Item label="单会话最大轮数">{plan.budget?.max_turns_per_session ?? '—'}</Descriptions.Item>
|
||||
<Descriptions.Item label="总轮数上限">{plan.budget?.total_max_turns ?? '—'}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
|
||||
<div style={{ fontWeight: 500, marginBottom: 6 }}>评测维度</div>
|
||||
<div style={{ fontSize: 13, fontWeight: 500, marginBottom: 6 }}>评测维度</div>
|
||||
<Space size={6} wrap style={{ marginBottom: 12 }}>
|
||||
{(plan.dimensions ?? []).map((d) => <Tag key={d} color="blue">{d}</Tag>)}
|
||||
{(plan.dimensions ?? []).map((d) => <Tag key={d} color="blue" style={{ fontSize: 12 }}>{d}</Tag>)}
|
||||
</Space>
|
||||
|
||||
<div style={{ fontWeight: 500, marginBottom: 6 }}>虚拟用户</div>
|
||||
<div style={{ fontSize: 13, fontWeight: 500, marginBottom: 6 }}>虚拟用户</div>
|
||||
<Space direction="vertical" size={4} style={{ width: '100%', marginBottom: 12 }}>
|
||||
{(plan.virtual_users ?? []).map((u, i) => (
|
||||
<div key={i} style={{ fontSize: 13, color: colors.textSecondary }}>
|
||||
@ -39,11 +39,11 @@ function PlanView({ ev }: { ev: IntelligentEval }) {
|
||||
))}
|
||||
</Space>
|
||||
|
||||
<div style={{ fontWeight: 500, marginBottom: 6 }}>时间分布</div>
|
||||
<div style={{ fontSize: 13, fontWeight: 500, marginBottom: 6 }}>时间分布</div>
|
||||
<Space direction="vertical" size={4} style={{ width: '100%', marginBottom: 12 }}>
|
||||
{(plan.time_distribution ?? []).map((t, i) => (
|
||||
<div key={i} style={{ fontSize: 13, color: colors.textSecondary }}>
|
||||
<Tag style={{ margin: 0 }}>{t.time_slot}</Tag> {t.sessions} 个会话 · {t.scenario}
|
||||
<Tag style={{ margin: 0, fontSize: 12 }}>{t.time_slot}</Tag> {t.sessions} 个会话 · {t.scenario}
|
||||
</div>
|
||||
))}
|
||||
</Space>
|
||||
@ -72,10 +72,11 @@ export default function EvalOverview({ ev, targetName }: EvalOverviewProps) {
|
||||
const sessions = showSessions ? ev.sessions ?? [] : []
|
||||
|
||||
return (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
|
||||
<Row gutter={16}>
|
||||
<Col span={9}>
|
||||
<Col span={8}>
|
||||
<Card size="small" title="基本信息" style={sectionCard}>
|
||||
<Descriptions column={1} size="small">
|
||||
<Descriptions column={1} size="small" labelStyle={{ fontSize: 12, color: colors.textSecondary }} contentStyle={{ fontSize: 13 }}>
|
||||
<Descriptions.Item label="评测对象">{targetName}</Descriptions.Item>
|
||||
<Descriptions.Item label="状态">
|
||||
<Tag color={meta.color}>{meta.label}</Tag>
|
||||
@ -84,58 +85,12 @@ export default function EvalOverview({ ev, targetName }: EvalOverviewProps) {
|
||||
<Descriptions.Item label="创建时间">{formatDateTime(ev.created_at)}</Descriptions.Item>
|
||||
<Descriptions.Item label="开始时间">{formatDateTime(ev.started_at)}</Descriptions.Item>
|
||||
<Descriptions.Item label="完成时间">{formatDateTime(ev.completed_at)}</Descriptions.Item>
|
||||
<Descriptions.Item label="会话进度">{ev.completed_sessions}/{ev.session_count}</Descriptions.Item>
|
||||
<Descriptions.Item label="会话进度">{ev.completed_sessions}/{ev.plan?.estimated_sessions ?? ev.session_count}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</Card>
|
||||
|
||||
<Card size="small" title="用户输入" style={sectionCard}>
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
|
||||
<div>
|
||||
<div style={{ fontSize: 12, color: colors.textSecondary, marginBottom: 4 }}>评估目标</div>
|
||||
<div style={{
|
||||
fontSize: 13, padding: '8px 12px', background: colors.bgSubtle,
|
||||
borderRadius: 6, whiteSpace: 'pre-wrap', maxHeight: 120, overflowY: 'auto',
|
||||
}}>
|
||||
{ev.goal || '—'}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ fontSize: 12, color: colors.textSecondary, marginBottom: 4 }}>考察意图</div>
|
||||
<div style={{
|
||||
fontSize: 13, padding: '8px 12px', background: colors.bgSubtle,
|
||||
borderRadius: 6, whiteSpace: 'pre-wrap', maxHeight: 100, overflowY: 'auto',
|
||||
}}>
|
||||
{ev.intent || '—'}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ fontSize: 12, color: colors.textSecondary, marginBottom: 4 }}>角色描述</div>
|
||||
<div style={{
|
||||
fontSize: 13, padding: '8px 12px', background: colors.bgSubtle,
|
||||
borderRadius: 6, whiteSpace: 'pre-wrap', maxHeight: 100, overflowY: 'auto',
|
||||
}}>
|
||||
{ev.role_description || '—'}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ fontSize: 12, color: colors.textSecondary, marginBottom: 4 }}>种子集</div>
|
||||
{Object.keys(ev.seeds ?? {}).length === 0 ? (
|
||||
<div style={{ fontSize: 13, padding: '8px 12px', background: colors.bgSubtle, borderRadius: 6 }}>—</div>
|
||||
) : (
|
||||
<pre style={{
|
||||
margin: 0, fontSize: 12, background: colors.bgSubtle,
|
||||
padding: '8px 12px', borderRadius: 6, overflowX: 'auto',
|
||||
maxHeight: 160, overflowY: 'auto',
|
||||
}}>
|
||||
{JSON.stringify(ev.seeds, null, 2)}
|
||||
</pre>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
|
||||
<Col span={15}>
|
||||
<Col span={16}>
|
||||
{ev.status === 'planning' && (
|
||||
ev.plan_feedback ? (
|
||||
<Alert
|
||||
@ -148,7 +103,7 @@ export default function EvalOverview({ ev, targetName }: EvalOverviewProps) {
|
||||
) : (
|
||||
<Card size="small" style={sectionCard}>
|
||||
<Spin size="small" />
|
||||
<span style={{ marginLeft: 10, color: colors.textSecondary }}>
|
||||
<span style={{ marginLeft: 10, fontSize: 13, color: colors.textSecondary }}>
|
||||
OpenClaw 正在规划,产出粗计划后会自动进入待审批…
|
||||
</span>
|
||||
</Card>
|
||||
@ -164,11 +119,11 @@ export default function EvalOverview({ ev, targetName }: EvalOverviewProps) {
|
||||
{showSessions && (
|
||||
<Card
|
||||
size="small"
|
||||
title={`会话进度(${ev.completed_sessions}/${ev.session_count})`}
|
||||
title={`会话进度(${ev.completed_sessions}/${ev.plan?.estimated_sessions ?? ev.session_count})`}
|
||||
style={sectionCard}
|
||||
extra={(
|
||||
<Progress
|
||||
percent={ev.session_count ? Math.round((ev.completed_sessions / ev.session_count) * 100) : 0}
|
||||
percent={(ev.plan?.estimated_sessions ?? ev.session_count) ? Math.round((ev.completed_sessions / (ev.plan?.estimated_sessions ?? ev.session_count)) * 100) : 0}
|
||||
size="small"
|
||||
style={{ width: 140 }}
|
||||
/>
|
||||
@ -186,16 +141,16 @@ export default function EvalOverview({ ev, targetName }: EvalOverviewProps) {
|
||||
key={s.id}
|
||||
style={{
|
||||
display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap',
|
||||
padding: '6px 0', borderBottom: `1px solid ${colors.border}`, fontSize: 13,
|
||||
padding: '8px 0', borderBottom: `1px solid ${colors.border}`,
|
||||
}}
|
||||
>
|
||||
<b style={{ color: colors.text }}>{personaLabel(s.persona)}</b>
|
||||
<Tag color={sMeta.color} style={{ margin: 0 }}>{sMeta.label}</Tag>
|
||||
{s.dimension && <Tag style={{ margin: 0 }}>{s.dimension}</Tag>}
|
||||
<span style={{ color: colors.textSecondary, flex: 1, minWidth: 120 }}>{s.goal}</span>
|
||||
<span style={{ color: colors.textMuted }}>{s.turn_count} 轮</span>
|
||||
<b style={{ fontSize: 13, color: colors.text }}>{personaLabel(s.persona)}</b>
|
||||
<Tag color={sMeta.color} style={{ margin: 0, fontSize: 12 }}>{sMeta.label}</Tag>
|
||||
{s.dimension && <Tag style={{ margin: 0, fontSize: 12 }}>{s.dimension}</Tag>}
|
||||
<span style={{ fontSize: 13, color: colors.textSecondary, flex: 1, minWidth: 120 }}>{s.goal}</span>
|
||||
<span style={{ fontSize: 12, color: colors.textMuted }}>{s.turn_count} 轮</span>
|
||||
{s.created_at && (
|
||||
<span style={{ color: colors.textMuted }}>{shortDateTime(s.created_at)}</span>
|
||||
<span style={{ fontSize: 12, color: colors.textMuted }}>{shortDateTime(s.created_at)}</span>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
@ -209,5 +164,54 @@ export default function EvalOverview({ ev, targetName }: EvalOverviewProps) {
|
||||
)}
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Card size="small" title="用户输入">
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<div style={{ marginBottom: 12 }}>
|
||||
<div style={{ fontSize: 12, color: colors.textSecondary, marginBottom: 4 }}>评估目标</div>
|
||||
<div style={{
|
||||
fontSize: 13, padding: '8px 12px', background: colors.bgSubtle,
|
||||
borderRadius: 6, whiteSpace: 'pre-wrap', maxHeight: 120, overflowY: 'auto',
|
||||
}}>
|
||||
{ev.goal || '—'}
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ marginBottom: 12 }}>
|
||||
<div style={{ fontSize: 12, color: colors.textSecondary, marginBottom: 4 }}>考察意图</div>
|
||||
<div style={{
|
||||
fontSize: 13, padding: '8px 12px', background: colors.bgSubtle,
|
||||
borderRadius: 6, whiteSpace: 'pre-wrap', maxHeight: 100, overflowY: 'auto',
|
||||
}}>
|
||||
{ev.intent || '—'}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ fontSize: 12, color: colors.textSecondary, marginBottom: 4 }}>角色描述</div>
|
||||
<div style={{
|
||||
fontSize: 13, padding: '8px 12px', background: colors.bgSubtle,
|
||||
borderRadius: 6, whiteSpace: 'pre-wrap', maxHeight: 100, overflowY: 'auto',
|
||||
}}>
|
||||
{ev.role_description || '—'}
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
<Col span={16}>
|
||||
<div style={{ fontSize: 12, color: colors.textSecondary, marginBottom: 4 }}>种子集</div>
|
||||
{Object.keys(ev.seeds ?? {}).length === 0 ? (
|
||||
<div style={{ fontSize: 13, padding: '8px 12px', background: colors.bgSubtle, borderRadius: 6 }}>—</div>
|
||||
) : (
|
||||
<pre style={{
|
||||
margin: 0, fontSize: 12, background: colors.bgSubtle,
|
||||
padding: '12px 16px', borderRadius: 6, overflowX: 'auto',
|
||||
maxHeight: 300, overflowY: 'auto', lineHeight: 1.6,
|
||||
}}>
|
||||
{JSON.stringify(ev.seeds, null, 2)}
|
||||
</pre>
|
||||
)}
|
||||
</Col>
|
||||
</Row>
|
||||
</Card>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@ -274,7 +274,7 @@ export default function IntelligentEvalsPage() {
|
||||
title={selected?.name ?? '评估详情'}
|
||||
open={selectedId != null}
|
||||
onClose={closeDrawer}
|
||||
width={1000}
|
||||
width={1200}
|
||||
destroyOnClose
|
||||
styles={{ body: { padding: 0, display: 'flex', flexDirection: 'column' } }}
|
||||
extra={selected && (
|
||||
|
||||
Loading…
Reference in New Issue
Block a user