style(usage): 请求链路节点改回居中布局并修复 TypeScript 兼容性

- 将节点布局从两端对齐改回居中展示
- 将 findLastIndex 替换为向后兼容的 for 循环实现
This commit is contained in:
fawney19
2026-01-15 13:29:22 +08:00
parent 6de113b852
commit bc2b430ec3

View File

@@ -677,8 +677,14 @@ watch(groupedTimeline, (newGroups) => {
const group = newGroups[i]
if (group.primaryStatus === 'failed') {
selectedGroupIndex.value = i
// 选中最后一个失败的尝试
const failedIdx = group.allAttempts.findLastIndex((a: CandidateRecord) => a.status === 'failed')
// 选中最后一个失败的尝试(从后往前遍历)
let failedIdx = -1
for (let j = group.allAttempts.length - 1; j >= 0; j--) {
if (group.allAttempts[j].status === 'failed') {
failedIdx = j
break
}
}
selectedAttemptIndex.value = failedIdx >= 0 ? failedIdx : group.allAttempts.length - 1
return
}
@@ -756,7 +762,7 @@ const getStatusColorClass = (status: string) => {
.minimal-track {
display: flex;
align-items: center;
justify-content: space-between;
justify-content: center;
gap: 64px;
padding: 2rem;
overflow-x: auto;