chore: remove model provider free token link (#4579)

This commit is contained in:
zxhlyh 2024-05-22 16:42:49 +08:00 • committed by GitHub
commit 4f62541bfb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 4 additions and 109 deletions

View file

@ -9,7 +9,6 @@ import type {
import { ConfigurateMethodEnum } from '../declarations'
import {
DEFAULT_BACKGROUND_COLOR,
MODEL_PROVIDER_QUOTA_GET_FREE,
MODEL_PROVIDER_QUOTA_GET_PAID,
modelTypeFormat,
} from '../utils'
@ -43,7 +42,7 @@ const ProviderAddedCard: FC<ProviderAddedCardProps> = ({
const configurateMethods = provider.configurate_methods.filter(method => method !== ConfigurateMethodEnum.fetchFromRemote)
const systemConfig = provider.system_configuration
const hasModelList = fetched && !!modelList.length
const showQuota = systemConfig.enabled && [...MODEL_PROVIDER_QUOTA_GET_FREE, ...MODEL_PROVIDER_QUOTA_GET_PAID].includes(provider.provider) && !IS_CE_EDITION
const showQuota = systemConfig.enabled && [...MODEL_PROVIDER_QUOTA_GET_PAID].includes(provider.provider) && !IS_CE_EDITION
const getModelList = async (providerName: string) => {
if (loading)

View file

@ -7,17 +7,10 @@ import {
QuotaUnitEnum,
} from '../declarations'
import {
useAnthropicBuyQuota,
useFreeQuota,
useUpdateModelProviders,
} from '../hooks'
import {
MODEL_PROVIDER_QUOTA_GET_FREE,
MODEL_PROVIDER_QUOTA_GET_PAID,
} from '../utils'
import PriorityUseTip from './priority-use-tip'
import { InfoCircle } from '@/app/components/base/icons/src/vender/line/general'
import Button from '@/app/components/base/button'
import TooltipPlus from '@/app/components/base/tooltip-plus'
import { formatNumber } from '@/utils/format'
@ -28,12 +21,7 @@ const QuotaPanel: FC<QuotaPanelProps> = ({
provider,
}) => {
const { t } = useTranslation()
const updateModelProviders = useUpdateModelProviders()
const handlePay = useAnthropicBuyQuota()
const handleFreeQuotaSuccess = () => {
updateModelProviders()
}
const handleFreeQuota = useFreeQuota(handleFreeQuotaSuccess)
const customConfig = provider.custom_configuration
const priorityUseType = provider.preferred_provider_type
const systemConfig = provider.system_configuration
@ -68,16 +56,6 @@ const QuotaPanel: FC<QuotaPanelProps> = ({
</div>
)
}
{
!currentQuota && MODEL_PROVIDER_QUOTA_GET_FREE.includes(provider.provider) && (
<Button
className='h-6 bg-white text-xs font-medium rounded-md'
onClick={() => handleFreeQuota(provider.provider)}
>
{t('common.modelProvider.getFreeTokens')}
</Button>
)
}
{
priorityUseType === PreferredProviderTypeEnum.system && customConfig.status === CustomConfigurationStatusEnum.active && (
<PriorityUseTip />