mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-03 04:43:01 +00:00
fix(web): round usage stats badge to 2 decimals for large amounts
This commit is contained in:
@@ -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} />
|
||||
|
||||
Reference in New Issue
Block a user