mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-04 00:17:45 +08:00
Merge remote-tracking branch 'origin/main' into codex/usage-pending-reasoning-reset-expiry-20260712
# Conflicts: # crates/aether-ai-formats/src/formats/openai/responses/mod.rs # crates/aether-usage/runtime/src/runtime.rs # frontend/src/features/usage/components/UsageRecordsTable.vue # frontend/src/features/usage/components/__tests__/UsageRecordsTable.spec.ts
This commit is contained in:
@@ -154,6 +154,7 @@ import {
|
||||
getDateRangeFromPeriod
|
||||
} from '@/features/usage/composables'
|
||||
import { reconcileActiveRequestDiscovery } from '@/features/usage/utils/activeRequestDiscovery'
|
||||
import { mergeUsageRecordFirstByteTimeMs } from '@/features/usage/utils/recordSync'
|
||||
import {
|
||||
hasUsageFallback,
|
||||
isUsageRecordFailed,
|
||||
@@ -521,7 +522,10 @@ async function pollActiveRequests() {
|
||||
record.actual_cost = update.actual_cost ?? undefined
|
||||
record.rate_multiplier = update.rate_multiplier ?? undefined
|
||||
record.response_time_ms = update.response_time_ms ?? undefined
|
||||
record.first_byte_time_ms = update.first_byte_time_ms ?? undefined
|
||||
record.first_byte_time_ms = mergeUsageRecordFirstByteTimeMs(
|
||||
record.first_byte_time_ms,
|
||||
update.first_byte_time_ms
|
||||
)
|
||||
if ('updated_at' in update) {
|
||||
record.updated_at = typeof update.updated_at === 'string' ? update.updated_at : null
|
||||
}
|
||||
@@ -822,6 +826,7 @@ onMounted(async () => {
|
||||
const heatmapPromise = loadHeatmapData().catch(err => {
|
||||
log.error('加载热力图数据失败:', err)
|
||||
})
|
||||
const adminUsersPromise = loadAdminUsers()
|
||||
|
||||
await loadRecords(
|
||||
{ page: currentPage.value, pageSize: pageSize.value },
|
||||
@@ -830,8 +835,7 @@ onMounted(async () => {
|
||||
)
|
||||
void (async () => {
|
||||
await refreshAdminAnalytics({ force: true, preserveOnFailure: false })
|
||||
await heatmapPromise
|
||||
await loadAdminUsers()
|
||||
await Promise.all([heatmapPromise, adminUsersPromise])
|
||||
})()
|
||||
} else {
|
||||
// 用户页面:loadStats 已包含记录加载,不需要单独调用 loadRecords
|
||||
@@ -1109,7 +1113,10 @@ function handleDetailRequestState(update: {
|
||||
record.response_time_ms = update.responseTimeMs
|
||||
}
|
||||
if ('firstByteTimeMs' in update) {
|
||||
record.first_byte_time_ms = update.firstByteTimeMs ?? undefined
|
||||
record.first_byte_time_ms = mergeUsageRecordFirstByteTimeMs(
|
||||
record.first_byte_time_ms,
|
||||
update.firstByteTimeMs
|
||||
)
|
||||
}
|
||||
if ('isStream' in update && typeof update.isStream === 'boolean') {
|
||||
record.is_stream = update.isStream
|
||||
|
||||
Reference in New Issue
Block a user