mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-06-30 06:35:14 +08:00
fix: model quota format (#1909)
This commit is contained in:
parent
891218615e
commit
66cdf577f5
@ -15,6 +15,7 @@ import PriorityUseTip from './priority-use-tip'
|
|||||||
import { InfoCircle } from '@/app/components/base/icons/src/vender/line/general'
|
import { InfoCircle } from '@/app/components/base/icons/src/vender/line/general'
|
||||||
import Button from '@/app/components/base/button'
|
import Button from '@/app/components/base/button'
|
||||||
import TooltipPlus from '@/app/components/base/tooltip-plus'
|
import TooltipPlus from '@/app/components/base/tooltip-plus'
|
||||||
|
import { formatNumber } from '@/utils/format'
|
||||||
|
|
||||||
type QuotaPanelProps = {
|
type QuotaPanelProps = {
|
||||||
provider: ModelProvider
|
provider: ModelProvider
|
||||||
@ -50,7 +51,7 @@ const QuotaPanel: FC<QuotaPanelProps> = ({
|
|||||||
{
|
{
|
||||||
currentQuota && (
|
currentQuota && (
|
||||||
<div className='flex items-center h-4 text-xs text-gray-500'>
|
<div className='flex items-center h-4 text-xs text-gray-500'>
|
||||||
<span className='mr-0.5 text-sm font-semibold text-gray-700'>{(currentQuota?.quota_limit || 0) - (currentQuota?.quota_used || 0)}</span>
|
<span className='mr-0.5 text-sm font-semibold text-gray-700'>{formatNumber((currentQuota?.quota_limit || 0) - (currentQuota?.quota_used || 0))}</span>
|
||||||
{
|
{
|
||||||
currentQuota?.quota_unit === QuotaUnitEnum.tokens && 'Tokens'
|
currentQuota?.quota_unit === QuotaUnitEnum.tokens && 'Tokens'
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'
|
|||||||
import { useProviderContext } from '@/context/provider-context'
|
import { useProviderContext } from '@/context/provider-context'
|
||||||
|
|
||||||
const navClassName = `
|
const navClassName = `
|
||||||
flex items-center relative mr-0 sm:mr-3 px-3 h-9 rounded-xl
|
flex items-center relative mr-0 sm:mr-3 px-3 h-8 rounded-xl
|
||||||
font-medium text-sm
|
font-medium text-sm
|
||||||
cursor-pointer
|
cursor-pointer
|
||||||
`
|
`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user