feat: support more request statuses in timeline

This commit is contained in:
fawney19
2026-02-04 13:32:42 +08:00
parent 2516460a0d
commit 065b1caaf9
2 changed files with 16 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ export interface CandidateRecord {
key_preview?: string // 密钥脱敏预览(如 sk-***abc
key_capabilities?: Record<string, boolean> | null // Key 支持的能力
required_capabilities?: Record<string, boolean> | null // 请求实际需要的能力标签
status: 'pending' | 'streaming' | 'success' | 'failed' | 'skipped' | 'cancelled'
status: 'pending' | 'streaming' | 'success' | 'failed' | 'skipped' | 'cancelled' | 'available' | 'unused' | 'stream_interrupted'
skip_reason?: string
is_cached: boolean
// 执行结果字段

View File

@@ -433,7 +433,17 @@ const formatLatency = (ms: number | undefined | null): string => {
const timeline = computed<CandidateRecord[]>(() => {
if (!trace.value) return []
return [...trace.value.candidates]
.filter(c => ['success', 'failed', 'skipped', 'cancelled', 'pending', 'streaming'].includes(c.status))
.filter(c => [
'success',
'failed',
'skipped',
'cancelled',
'pending',
'streaming',
'available',
'unused',
'stream_interrupted'
].includes(c.status))
.sort((a, b) => {
const startedA = a.started_at ? new Date(a.started_at).getTime() : Infinity
const startedB = b.started_at ? new Date(b.started_at).getTime() : Infinity
@@ -730,8 +740,10 @@ const formatDuration = (startStr: string, endStr: string): string => {
const getStatusLabel = (status: string) => {
const labels: Record<string, string> = {
available: '未执行',
unused: '未执行',
pending: '等待中',
streaming: '传输中',
stream_interrupted: '流中断',
success: '成功',
failed: '失败',
cancelled: '已取消',
@@ -744,8 +756,10 @@ const getStatusLabel = (status: string) => {
const getStatusColorClass = (status: string) => {
const classes: Record<string, string> = {
available: 'status-available',
unused: 'status-available',
pending: 'status-pending',
streaming: 'status-pending',
stream_interrupted: 'status-failed',
success: 'status-success',
failed: 'status-failed',
cancelled: 'status-cancelled',