mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
feat: support more request statuses in timeline
This commit is contained in:
@@ -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
|
||||
// 执行结果字段
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user