Commit c64465ff authored by Ethan0x0000's avatar Ethan0x0000
Browse files

test(frontend): align admin usage typing with upstream model

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent

)
Co-authored-by: default avatarSisyphus <clio-agent@sisyphuslabs.ai>
parent 095200bd
...@@ -39,6 +39,7 @@ const DataTableStub = { ...@@ -39,6 +39,7 @@ const DataTableStub = {
template: ` template: `
<div> <div>
<div v-for="row in data" :key="row.request_id"> <div v-for="row in data" :key="row.request_id">
<slot name="cell-model" :row="row" :value="row.model" />
<slot name="cell-cost" :row="row" /> <slot name="cell-cost" :row="row" />
</div> </div>
</div> </div>
...@@ -108,4 +109,42 @@ describe('admin UsageTable tooltip', () => { ...@@ -108,4 +109,42 @@ describe('admin UsageTable tooltip', () => {
expect(text).toContain('$30.0000 / 1M tokens') expect(text).toContain('$30.0000 / 1M tokens')
expect(text).toContain('$0.069568') 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')
})
}) })
...@@ -978,7 +978,6 @@ export interface UsageLog { ...@@ -978,7 +978,6 @@ export interface UsageLog {
account_id: number | null account_id: number | null
request_id: string request_id: string
model: string model: string
upstream_model?: string | null
service_tier?: string | null service_tier?: string | null
reasoning_effort?: string | null reasoning_effort?: string | null
inbound_endpoint?: string | null inbound_endpoint?: string | null
...@@ -1033,6 +1032,8 @@ export interface UsageLogAccountSummary { ...@@ -1033,6 +1032,8 @@ export interface UsageLogAccountSummary {
} }
export interface AdminUsageLog extends UsageLog { export interface AdminUsageLog extends UsageLog {
upstream_model?: string | null
// 账号计费倍率(仅管理员可见) // 账号计费倍率(仅管理员可见)
account_rate_multiplier?: number | null account_rate_multiplier?: number | null
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment