fix(web): round usage stats badge to 2 decimals for large amounts

This commit is contained in:
t0ng7u
2026-07-11 23:06:57 +08:00
parent 1a065224ac
commit 149fe5705d
2 changed files with 13 additions and 5 deletions
@@ -112,9 +112,9 @@ export function ModelsTable() {
// Use search API whenever any filter is active so status/sync are applied server-side
const shouldSearch = Boolean(
globalFilter?.trim() ||
activeVendorFilter ||
statusFilterValue ||
syncFilterValue
activeVendorFilter ||
statusFilterValue ||
syncFilterValue
)
// Fetch models data
@@ -22,7 +22,7 @@ import { useTranslation } from 'react-i18next'
import { Badge } from '@/components/ui/badge'
import { Skeleton } from '@/components/ui/skeleton'
import { formatLogQuota } from '@/lib/format'
import { formatQuotaWithCurrency } from '@/lib/currency'
import { getLogStats, getUserLogStats } from '../api'
import { DEFAULT_LOG_STATS } from '../constants'
@@ -96,7 +96,15 @@ export function CommonLogsStats() {
<StatBadge
label={t('Usage')}
tone='usage'
value={sensitiveVisible ? formatLogQuota(stats?.quota || 0) : '••••'}
value={
sensitiveVisible
? formatQuotaWithCurrency(stats?.quota || 0, {
digitsLarge: 2,
digitsSmall: 6,
abbreviate: false,
})
: '••••'
}
/>
<StatBadge label={t('RPM')} tone='rpm' value={stats?.rpm || 0} />
<StatBadge label={t('TPM')} tone='tpm' value={stats?.tpm || 0} />