diff --git a/frontend/src/components/admin/usage/__tests__/UsageTable.spec.ts b/frontend/src/components/admin/usage/__tests__/UsageTable.spec.ts index e38bb4f7..9309c88b 100644 --- a/frontend/src/components/admin/usage/__tests__/UsageTable.spec.ts +++ b/frontend/src/components/admin/usage/__tests__/UsageTable.spec.ts @@ -39,6 +39,7 @@ const DataTableStub = { template: `
+
@@ -108,4 +109,42 @@ describe('admin UsageTable tooltip', () => { expect(text).toContain('$30.0000 / 1M tokens') expect(text).toContain('$0.069568') }) + + it('shows requested and upstream models separately for admin rows', () => { + const row = { + request_id: 'req-admin-model-1', + model: 'claude-sonnet-4', + upstream_model: 'claude-sonnet-4-20250514', + actual_cost: 0, + total_cost: 0, + account_rate_multiplier: 1, + rate_multiplier: 1, + input_cost: 0, + output_cost: 0, + cache_creation_cost: 0, + cache_read_cost: 0, + input_tokens: 0, + output_tokens: 0, + } + + const wrapper = mount(UsageTable, { + props: { + data: [row], + loading: false, + columns: [], + }, + global: { + stubs: { + DataTable: DataTableStub, + EmptyState: true, + Icon: true, + Teleport: true, + }, + }, + }) + + const text = wrapper.text() + expect(text).toContain('claude-sonnet-4') + expect(text).toContain('claude-sonnet-4-20250514') + }) }) diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts index 056efae2..65740527 100644 --- a/frontend/src/types/index.ts +++ b/frontend/src/types/index.ts @@ -978,7 +978,6 @@ export interface UsageLog { account_id: number | null request_id: string model: string - upstream_model?: string | null service_tier?: string | null reasoning_effort?: string | null inbound_endpoint?: string | null @@ -1033,6 +1032,8 @@ export interface UsageLogAccountSummary { } export interface AdminUsageLog extends UsageLog { + upstream_model?: string | null + // 账号计费倍率(仅管理员可见) account_rate_multiplier?: number | null