fix(usage): prefer explicit video billing mode over image_count

Reuse shared getDisplayBillingMode so user usage rows with billing_mode=video
are not mislabeled as image when image_count is non-zero.
This commit is contained in:
IanShaw027 committed 2026-08-08 09:45:12 +08:00
1 parent bdeb13021a
commit b7863650ec
3 files changed
+33 -5

No files matched your search

+2 -5
View File
@@ -231,7 +231,7 @@ import Icon from '@/components/icons/Icon.vue'
import UserErrorRequestsTable from '@/components/user/UserErrorRequestsTable.vue'
import { getPersistedPageSize } from '@/composables/usePersistedPageSize'
import { formatReasoningEffort } from '@/utils/format'
import { BILLING_MODE_IMAGE, getBillingModeLabel } from '@/utils/billingMode'
import { getBillingModeLabel, getDisplayBillingMode as resolveDisplayBillingMode } from '@/utils/billingMode'
import { resolveUsageRequestType, requestTypeToLegacyStream } from '@/utils/usageRequestType'
import type {
ApiKey,
@@ -605,10 +605,7 @@ const getRequestTypeExportText = (log: UsageLog): string => {
const getDisplayBillingMode = (
row: Pick<UsageLog, 'billing_mode' | 'image_count'> | null | undefined
): string | null | undefined => {
if ((row?.image_count ?? 0) > 0) return BILLING_MODE_IMAGE
return row?.billing_mode
}
): string | null | undefined => resolveDisplayBillingMode(row)
const escapeCSVValue = (value: unknown): string => {
if (value == null) return ''