Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
489a4d93
"backend/internal/vscode:/vscode.git/clone" did not exist on "04b2866f65f31c044a991e9f2c1b299927a2ac1b"
Commit
489a4d93
authored
Apr 25, 2026
by
Oliver
Browse files
Show today stats for Vertex usage window
parent
496469ac
Changes
2
Hide whitespace changes
Inline
Side-by-side
frontend/src/components/account/AccountUsageCell.vue
View file @
489a4d93
...
...
@@ -332,6 +332,37 @@
<!-- Usage data or unlimited flow -->
<div
class=
"space-y-1"
>
<div
v-if=
"showGeminiTodayStats && todayStats"
class=
"mb-0.5 flex items-center"
>
<div
class=
"flex items-center gap-1.5 text-[9px] text-gray-500 dark:text-gray-400"
>
<span
class=
"rounded bg-gray-100 px-1.5 py-0.5 dark:bg-gray-800"
>
{{
formatKeyRequests
}}
req
</span>
<span
class=
"rounded bg-gray-100 px-1.5 py-0.5 dark:bg-gray-800"
>
{{
formatKeyTokens
}}
</span>
<span
class=
"rounded bg-gray-100 px-1.5 py-0.5 dark:bg-gray-800"
:title=
"t('usage.accountBilled')"
>
A $
{{
formatKeyCost
}}
</span>
<span
v-if=
"todayStats.user_cost != null"
class=
"rounded bg-gray-100 px-1.5 py-0.5 dark:bg-gray-800"
:title=
"t('usage.userBilled')"
>
U $
{{
formatKeyUserCost
}}
</span>
</div>
</div>
<div
v-else-if=
"showGeminiTodayStats && todayStatsLoading"
class=
"mb-0.5 flex items-center gap-1"
>
<div
class=
"h-3 w-10 animate-pulse rounded bg-gray-200 dark:bg-gray-700"
></div>
<div
class=
"h-3 w-8 animate-pulse rounded bg-gray-200 dark:bg-gray-700"
></div>
<div
class=
"h-3 w-12 animate-pulse rounded bg-gray-200 dark:bg-gray-700"
></div>
</div>
<div
v-if=
"loading"
class=
"space-y-1"
>
<div
class=
"flex items-center gap-1"
>
<div
class=
"h-3 w-[32px] animate-pulse rounded bg-gray-200 dark:bg-gray-700"
></div>
...
...
@@ -512,6 +543,10 @@ const shouldFetchUsage = computed(() => {
return
false
})
const
showGeminiTodayStats
=
computed
(()
=>
{
return
props
.
account
.
platform
===
'
gemini
'
&&
props
.
account
.
type
===
'
service_account
'
})
const
geminiUsageAvailable
=
computed
(()
=>
{
return
(
!!
usageInfo
.
value
?.
gemini_shared_daily
||
...
...
frontend/src/components/account/__tests__/AccountUsageCell.spec.ts
View file @
489a4d93
...
...
@@ -57,6 +57,19 @@ function makeAccount(overrides: Partial<Account>): Account {
describe
(
'
AccountUsageCell
'
,
()
=>
{
beforeEach
(()
=>
{
getUsage
.
mockReset
()
Object
.
defineProperty
(
window
,
'
matchMedia
'
,
{
writable
:
true
,
value
:
vi
.
fn
().
mockImplementation
(()
=>
({
matches
:
true
,
media
:
'
(min-width: 768px)
'
,
onchange
:
null
,
addListener
:
vi
.
fn
(),
removeListener
:
vi
.
fn
(),
addEventListener
:
vi
.
fn
(),
removeEventListener
:
vi
.
fn
(),
dispatchEvent
:
vi
.
fn
(),
}))
})
})
it
(
'
Antigravity 图片用量会聚合新旧 image 模型
'
,
async
()
=>
{
...
...
@@ -603,4 +616,43 @@ describe('AccountUsageCell', () => {
expect
(
wrapper
.
text
().
trim
()).
toBe
(
'
-
'
)
})
it
(
'
Vertex 账号会在 Gemini 用量窗口里展示 today stats 徽章
'
,
async
()
=>
{
const
wrapper
=
mount
(
AccountUsageCell
,
{
props
:
{
account
:
makeAccount
({
id
:
4001
,
platform
:
'
gemini
'
,
type
:
'
service_account
'
,
credentials
:
{
tier_id
:
'
vertex
'
,
project_id
:
'
vertex-proj
'
,
client_email
:
'
svc@vertex-proj.iam.gserviceaccount.com
'
,
location
:
'
global
'
},
extra
:
{}
}),
todayStats
:
{
requests
:
0
,
tokens
:
0
,
cost
:
0
,
standard_cost
:
0
,
user_cost
:
0
}
},
global
:
{
stubs
:
{
UsageProgressBar
:
true
,
AccountQuotaInfo
:
true
}
}
})
await
flushPromises
()
expect
(
wrapper
.
text
()).
toContain
(
'
0 req
'
)
expect
(
wrapper
.
text
()).
toContain
(
'
0
'
)
expect
(
wrapper
.
text
()).
toContain
(
'
A $0.00
'
)
expect
(
wrapper
.
text
()).
toContain
(
'
U $0.00
'
)
})
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment