mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
Fix/usage transfer filter (#307)
* fix(usage): 恢复 usage 列表中的 fallback 路由信号 * fix(admin): 支持 usage 记录展示和筛选 fallback 转移 * fix(usage): 在用户 usage 记录中暴露 fallback 标记 * fix(usage): 共享 usage 页面支持 fallback 筛选 * fix(usage): 对齐 fallback 筛选相关前端类型 * fix(usage): propagate has_fallback through active polling --------- Co-authored-by: fawney19 <elky0401@gmail.com>
This commit is contained in:
@@ -144,7 +144,7 @@ import {
|
||||
getDateRangeFromPeriod
|
||||
} from '@/features/usage/composables'
|
||||
import { reconcileActiveRequestDiscovery } from '@/features/usage/utils/activeRequestDiscovery'
|
||||
import { isUsageRecordFailed } from '@/features/usage/utils/status'
|
||||
import { hasUsageFallback, isUsageRecordFailed } from '@/features/usage/utils/status'
|
||||
import type { DateRangeParams, FilterStatusValue } from '@/features/usage/types'
|
||||
import type { UserOption } from '@/features/usage/components/UsageRecordsTable.vue'
|
||||
import { log } from '@/utils/logger'
|
||||
@@ -309,6 +309,8 @@ const filteredRecords = computed(() => {
|
||||
records = records.filter(record => isUsageRecordFailed(record))
|
||||
} else if (filterStatus.value === 'cancelled') {
|
||||
records = records.filter(record => record.status === 'cancelled')
|
||||
} else if (filterStatus.value === 'has_fallback') {
|
||||
records = records.filter(record => hasUsageFallback(record))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -399,6 +401,9 @@ async function pollActiveRequests() {
|
||||
if (update.api_format != null) record.api_format = update.api_format
|
||||
if (update.endpoint_api_format != null) record.endpoint_api_format = update.endpoint_api_format
|
||||
if (update.has_format_conversion != null) record.has_format_conversion = update.has_format_conversion
|
||||
if (typeof update.has_fallback === 'boolean') {
|
||||
record.has_fallback = record.has_fallback === true || update.has_fallback
|
||||
}
|
||||
// 模型映射:streaming 时已可确定
|
||||
if ('target_model' in update && (typeof update.target_model === 'string' || update.target_model === null)) {
|
||||
record.target_model = update.target_model
|
||||
|
||||
Reference in New Issue
Block a user