feat: 按时间戳升序排序历史记录组内的日志。

This commit is contained in:
xucheng 2026-01-16 10:45:11 +08:00
parent 03c1b6a487
commit 3aa4a9a912

View File

@ -75,6 +75,11 @@ export function HistoryView() {
groups[sid].logs.push(log)
})
// Sort logs within each group by timestamp (ascending) for display
Object.values(groups).forEach(group => {
group.logs.sort((a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime())
})
// Convert to array and sort by timestamp
const sortedGroups = Object.values(groups).sort((a, b) =>
new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()