Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
08677566
authored
Jul 20, 2026
by
RedwindA
Committed by
GitHub
Jul 20, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(web): show used quota for unlimited API keys (#6224)
parent
270accc3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
11 deletions
+40
-11
web/src/features/keys/components/api-keys-cells.tsx
+35
-0
web/src/features/keys/components/api-keys-columns.tsx
+3
-9
web/src/features/keys/components/api-keys-table.tsx
+2
-2
No files found.
web/src/features/keys/components/api-keys-cells.tsx
View file @
08677566
...
@@ -34,6 +34,7 @@ import {
...
@@ -34,6 +34,7 @@ import {
TooltipTrigger
,
TooltipTrigger
,
}
from
'@/components/ui/tooltip'
}
from
'@/components/ui/tooltip'
import
{
copyToClipboard
}
from
'@/lib/copy-to-clipboard'
import
{
copyToClipboard
}
from
'@/lib/copy-to-clipboard'
import
{
formatQuota
}
from
'@/lib/format'
import
type
{
ApiKey
}
from
'../types'
import
type
{
ApiKey
}
from
'../types'
import
{
useApiKeys
}
from
'./api-keys-provider'
import
{
useApiKeys
}
from
'./api-keys-provider'
...
@@ -141,6 +142,40 @@ export function ApiKeyCell({ apiKey }: { apiKey: ApiKey }) {
...
@@ -141,6 +142,40 @@ export function ApiKeyCell({ apiKey }: { apiKey: ApiKey }) {
)
)
}
}
type
UnlimitedQuotaBadgeProps
=
{
used
:
number
}
export
function
UnlimitedQuotaBadge
(
props
:
UnlimitedQuotaBadgeProps
)
{
const
{
t
}
=
useTranslation
()
const
formattedUsed
=
formatQuota
(
props
.
used
)
return
(
<
Popover
>
<
PopoverTrigger
render=
{
<
button
type=
'button'
className=
'focus-visible:ring-ring/50 -ml-1.5 cursor-help rounded-4xl focus-visible:ring-[3px] focus-visible:outline-none'
aria
-
label=
{
`${t('Unlimited')}; ${t('Used:')} ${formattedUsed}`
}
/>
}
>
<
StatusBadge
label=
{
t
(
'Unlimited'
)
}
variant=
'neutral'
copyable=
{
false
}
/>
</
PopoverTrigger
>
<
PopoverContent
className=
'w-auto p-2'
side=
'top'
>
<
span
className=
'text-xs'
>
{
t
(
'Used:'
)
}
{
formattedUsed
}
</
span
>
</
PopoverContent
>
</
Popover
>
)
}
export
function
ModelLimitsCell
({
apiKey
}:
{
apiKey
:
ApiKey
})
{
export
function
ModelLimitsCell
({
apiKey
}:
{
apiKey
:
ApiKey
})
{
const
{
t
}
=
useTranslation
()
const
{
t
}
=
useTranslation
()
...
...
web/src/features/keys/components/api-keys-columns.tsx
View file @
08677566
...
@@ -41,8 +41,9 @@ import type { ApiKey } from '../types'
...
@@ -41,8 +41,9 @@ import type { ApiKey } from '../types'
import
{
ApiKeyTimestampCell
}
from
'./api-key-timestamp-cell'
import
{
ApiKeyTimestampCell
}
from
'./api-key-timestamp-cell'
import
{
import
{
ApiKeyCell
,
ApiKeyCell
,
ModelLimitsCell
,
IpRestrictionsCell
,
IpRestrictionsCell
,
ModelLimitsCell
,
UnlimitedQuotaBadge
,
}
from
'./api-keys-cells'
}
from
'./api-keys-cells'
import
{
DataTableRowActions
}
from
'./data-table-row-actions'
import
{
DataTableRowActions
}
from
'./data-table-row-actions'
...
@@ -145,14 +146,7 @@ export function useApiKeysColumns(now: number): ColumnDef<ApiKey>[] {
...
@@ -145,14 +146,7 @@ export function useApiKeysColumns(now: number): ColumnDef<ApiKey>[] {
cell
:
({
row
})
=>
{
cell
:
({
row
})
=>
{
const
apiKey
=
row
.
original
const
apiKey
=
row
.
original
if
(
apiKey
.
unlimited_quota
)
{
if
(
apiKey
.
unlimited_quota
)
{
return
(
return
<
UnlimitedQuotaBadge
used=
{
apiKey
.
used_quota
}
/>
<
StatusBadge
label=
{
t
(
'Unlimited'
)
}
variant=
'neutral'
copyable=
{
false
}
className=
'-ml-1.5'
/>
)
}
}
const
used
=
apiKey
.
used_quota
const
used
=
apiKey
.
used_quota
...
...
web/src/features/keys/components/api-keys-table.tsx
View file @
08677566
...
@@ -53,7 +53,7 @@ import {
...
@@ -53,7 +53,7 @@ import {
ERROR_MESSAGES
,
ERROR_MESSAGES
,
}
from
'../constants'
}
from
'../constants'
import
type
{
ApiKey
}
from
'../types'
import
type
{
ApiKey
}
from
'../types'
import
{
ApiKeyCell
}
from
'./api-keys-cells'
import
{
ApiKeyCell
,
UnlimitedQuotaBadge
}
from
'./api-keys-cells'
import
{
useApiKeysColumns
}
from
'./api-keys-columns'
import
{
useApiKeysColumns
}
from
'./api-keys-columns'
import
{
useApiKeys
}
from
'./api-keys-provider'
import
{
useApiKeys
}
from
'./api-keys-provider'
import
{
DataTableBulkActions
}
from
'./data-table-bulk-actions'
import
{
DataTableBulkActions
}
from
'./data-table-bulk-actions'
...
@@ -168,7 +168,7 @@ function ApiKeysMobileList({
...
@@ -168,7 +168,7 @@ function ApiKeysMobileList({
<
div
className=
'flex items-center justify-between gap-2 text-xs'
>
<
div
className=
'flex items-center justify-between gap-2 text-xs'
>
<
span
className=
'text-muted-foreground'
>
{
t
(
'Quota'
)
}
</
span
>
<
span
className=
'text-muted-foreground'
>
{
t
(
'Quota'
)
}
</
span
>
{
apiKey
.
unlimited_quota
?
(
{
apiKey
.
unlimited_quota
?
(
<
span
className=
'font-medium'
>
{
t
(
'Unlimited'
)
}
</
span
>
<
UnlimitedQuotaBadge
used=
{
apiKey
.
used_quota
}
/
>
)
:
(
)
:
(
<
span
className=
'font-medium tabular-nums'
>
<
span
className=
'font-medium tabular-nums'
>
{
formatQuota
(
apiKey
.
remain_quota
)
}
{
formatQuota
(
apiKey
.
remain_quota
)
}
...
...
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