mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-12-02 11:18:19 +08:00
chore: update price page (#2272)
This commit is contained in:
parent
d76d1adb59
commit
6c3b34a61d
@ -3,6 +3,8 @@ import { Plan, type PlanInfo, Priority } from '@/app/components/billing/type'
|
|||||||
const supportModelProviders = 'OpenAI/Anthropic/Azure OpenAI/ Llama2/Hugging Face/Replicate'
|
const supportModelProviders = 'OpenAI/Anthropic/Azure OpenAI/ Llama2/Hugging Face/Replicate'
|
||||||
|
|
||||||
export const NUM_INFINITE = 99999999
|
export const NUM_INFINITE = 99999999
|
||||||
|
export const contractSales = 'contractSales'
|
||||||
|
export const unAvailable = 'unAvailable'
|
||||||
|
|
||||||
export const contactSalesUrl = 'mailto:business@dify.ai'
|
export const contactSalesUrl = 'mailto:business@dify.ai'
|
||||||
|
|
||||||
@ -16,7 +18,11 @@ export const ALL_PLANS: Record<Plan, PlanInfo> = {
|
|||||||
vectorSpace: 5,
|
vectorSpace: 5,
|
||||||
documentProcessingPriority: Priority.standard,
|
documentProcessingPriority: Priority.standard,
|
||||||
logHistory: 30,
|
logHistory: 30,
|
||||||
messageRequest: 500,
|
customTools: unAvailable,
|
||||||
|
messageRequest: {
|
||||||
|
en: '200 messages',
|
||||||
|
zh: '200 条信息',
|
||||||
|
},
|
||||||
annotatedResponse: 10,
|
annotatedResponse: 10,
|
||||||
},
|
},
|
||||||
professional: {
|
professional: {
|
||||||
@ -28,7 +34,11 @@ export const ALL_PLANS: Record<Plan, PlanInfo> = {
|
|||||||
vectorSpace: 200,
|
vectorSpace: 200,
|
||||||
documentProcessingPriority: Priority.priority,
|
documentProcessingPriority: Priority.priority,
|
||||||
logHistory: NUM_INFINITE,
|
logHistory: NUM_INFINITE,
|
||||||
messageRequest: NUM_INFINITE,
|
customTools: 10,
|
||||||
|
messageRequest: {
|
||||||
|
en: '5,000 messages/month',
|
||||||
|
zh: '5,000 条信息/月',
|
||||||
|
},
|
||||||
annotatedResponse: 2000,
|
annotatedResponse: 2000,
|
||||||
},
|
},
|
||||||
team: {
|
team: {
|
||||||
@ -40,7 +50,11 @@ export const ALL_PLANS: Record<Plan, PlanInfo> = {
|
|||||||
vectorSpace: 1000,
|
vectorSpace: 1000,
|
||||||
documentProcessingPriority: Priority.topPriority,
|
documentProcessingPriority: Priority.topPriority,
|
||||||
logHistory: NUM_INFINITE,
|
logHistory: NUM_INFINITE,
|
||||||
messageRequest: NUM_INFINITE,
|
customTools: NUM_INFINITE,
|
||||||
|
messageRequest: {
|
||||||
|
en: '10,000 messages/month',
|
||||||
|
zh: '10,000 条信息/月',
|
||||||
|
},
|
||||||
annotatedResponse: 5000,
|
annotatedResponse: 5000,
|
||||||
},
|
},
|
||||||
enterprise: {
|
enterprise: {
|
||||||
@ -52,7 +66,11 @@ export const ALL_PLANS: Record<Plan, PlanInfo> = {
|
|||||||
vectorSpace: NUM_INFINITE,
|
vectorSpace: NUM_INFINITE,
|
||||||
documentProcessingPriority: Priority.topPriority,
|
documentProcessingPriority: Priority.topPriority,
|
||||||
logHistory: NUM_INFINITE,
|
logHistory: NUM_INFINITE,
|
||||||
messageRequest: NUM_INFINITE,
|
customTools: NUM_INFINITE,
|
||||||
|
messageRequest: {
|
||||||
|
en: contractSales,
|
||||||
|
zh: contractSales,
|
||||||
|
},
|
||||||
annotatedResponse: NUM_INFINITE,
|
annotatedResponse: NUM_INFINITE,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -3,14 +3,17 @@ import type { FC } from 'react'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import cn from 'classnames'
|
import cn from 'classnames'
|
||||||
|
import { useContext } from 'use-context-selector'
|
||||||
import { Plan } from '../type'
|
import { Plan } from '../type'
|
||||||
import { ALL_PLANS, NUM_INFINITE, contactSalesUrl } from '../config'
|
import { ALL_PLANS, NUM_INFINITE, contactSalesUrl, contractSales, unAvailable } from '../config'
|
||||||
import Toast from '../../base/toast'
|
import Toast from '../../base/toast'
|
||||||
import TooltipPlus from '../../base/tooltip-plus'
|
import TooltipPlus from '../../base/tooltip-plus'
|
||||||
import { PlanRange } from './select-plan-range'
|
import { PlanRange } from './select-plan-range'
|
||||||
import { HelpCircle } from '@/app/components/base/icons/src/vender/line/general'
|
import { HelpCircle } from '@/app/components/base/icons/src/vender/line/general'
|
||||||
import { useAppContext } from '@/context/app-context'
|
import { useAppContext } from '@/context/app-context'
|
||||||
import { fetchSubscriptionUrls } from '@/service/billing'
|
import { fetchSubscriptionUrls } from '@/service/billing'
|
||||||
|
import { LanguagesSupportedUnderscore, getModelRuntimeSupported } from '@/utils/language'
|
||||||
|
import I18n from '@/context/i18n'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
currentPlan: Plan
|
currentPlan: Plan
|
||||||
@ -69,6 +72,9 @@ const PlanItem: FC<Props> = ({
|
|||||||
canPay,
|
canPay,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
const { locale } = useContext(I18n)
|
||||||
|
const language = getModelRuntimeSupported(locale)
|
||||||
|
const isZh = language === LanguagesSupportedUnderscore[1]
|
||||||
const [loading, setLoading] = React.useState(false)
|
const [loading, setLoading] = React.useState(false)
|
||||||
const i18nPrefix = `billing.plans.${plan}`
|
const i18nPrefix = `billing.plans.${plan}`
|
||||||
const isFreePlan = plan === Plan.sandbox
|
const isFreePlan = plan === Plan.sandbox
|
||||||
@ -79,7 +85,13 @@ const PlanItem: FC<Props> = ({
|
|||||||
const isCurrent = plan === currentPlan
|
const isCurrent = plan === currentPlan
|
||||||
const isPlanDisabled = planInfo.level <= ALL_PLANS[currentPlan].level || (!canPay && plan !== Plan.enterprise)
|
const isPlanDisabled = planInfo.level <= ALL_PLANS[currentPlan].level || (!canPay && plan !== Plan.enterprise)
|
||||||
const { isCurrentWorkspaceManager } = useAppContext()
|
const { isCurrentWorkspaceManager } = useAppContext()
|
||||||
|
const messagesRequest = (() => {
|
||||||
|
const value = planInfo.messageRequest[isZh ? 'zh' : 'en']
|
||||||
|
if (value === contractSales)
|
||||||
|
return t('billing.plansCommon.contractSales')
|
||||||
|
|
||||||
|
return value
|
||||||
|
})()
|
||||||
const btnText = (() => {
|
const btnText = (() => {
|
||||||
if (!canPay && plan !== Plan.enterprise)
|
if (!canPay && plan !== Plan.enterprise)
|
||||||
return t('billing.plansCommon.contractOwner')
|
return t('billing.plansCommon.contractOwner')
|
||||||
@ -100,7 +112,16 @@ const PlanItem: FC<Props> = ({
|
|||||||
const supportContent = (() => {
|
const supportContent = (() => {
|
||||||
switch (plan) {
|
switch (plan) {
|
||||||
case Plan.sandbox:
|
case Plan.sandbox:
|
||||||
return t('billing.plansCommon.supportItems.communityForums')
|
return (<div className='space-y-3.5'>
|
||||||
|
<div>{t('billing.plansCommon.supportItems.communityForums')}</div>
|
||||||
|
<div>{t('billing.plansCommon.supportItems.agentMode')}</div>
|
||||||
|
<div className='flex items-center space-x-1'>
|
||||||
|
<div className='flex items-center'>
|
||||||
|
<div className='mr-0.5'> {t('billing.plansCommon.supportItems.workflow')}</div>
|
||||||
|
</div>
|
||||||
|
<div>{comingSoon}</div>
|
||||||
|
</div>
|
||||||
|
</div>)
|
||||||
case Plan.professional:
|
case Plan.professional:
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@ -122,19 +143,12 @@ const PlanItem: FC<Props> = ({
|
|||||||
</div>
|
</div>
|
||||||
<div>{comingSoon}</div>
|
<div>{comingSoon}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className='mt-3.5 flex items-center space-x-1'>
|
|
||||||
<div>+ {t('billing.plansCommon.supportItems.agentModel')}</div>
|
|
||||||
<div>{comingSoon}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
case Plan.team:
|
case Plan.team:
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div>{t('billing.plansCommon.supportItems.priorityEmail')}</div>
|
<div>{t('billing.plansCommon.supportItems.priorityEmail')}</div>
|
||||||
<div className='mt-3.5 flex items-center space-x-1'>
|
|
||||||
<div>+ {t('billing.plansCommon.supportItems.logoChange')}</div>
|
|
||||||
</div>
|
|
||||||
<div className='mt-3.5 flex items-center space-x-1'>
|
<div className='mt-3.5 flex items-center space-x-1'>
|
||||||
<div>+ {t('billing.plansCommon.supportItems.SSOAuthentication')}</div>
|
<div>+ {t('billing.plansCommon.supportItems.SSOAuthentication')}</div>
|
||||||
<div>{comingSoon}</div>
|
<div>{comingSoon}</div>
|
||||||
@ -145,6 +159,9 @@ const PlanItem: FC<Props> = ({
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div>{t('billing.plansCommon.supportItems.personalizedSupport')}</div>
|
<div>{t('billing.plansCommon.supportItems.personalizedSupport')}</div>
|
||||||
|
<div className='mt-3.5 flex items-center space-x-1'>
|
||||||
|
<div>+ {t('billing.plansCommon.supportItems.dedicatedAPISupport')}</div>
|
||||||
|
</div>
|
||||||
<div className='mt-3.5 flex items-center space-x-1'>
|
<div className='mt-3.5 flex items-center space-x-1'>
|
||||||
<div>+ {t('billing.plansCommon.supportItems.customIntegration')}</div>
|
<div>+ {t('billing.plansCommon.supportItems.customIntegration')}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -194,7 +211,7 @@ const PlanItem: FC<Props> = ({
|
|||||||
)}
|
)}
|
||||||
<div className={cn(style[plan].bg, 'grow px-6 py-6 rounded-[10px]')}>
|
<div className={cn(style[plan].bg, 'grow px-6 py-6 rounded-[10px]')}>
|
||||||
<div className={cn(style[plan].title, 'mb-1 leading-[125%] text-lg font-semibold')}>{t(`${i18nPrefix}.name`)}</div>
|
<div className={cn(style[plan].title, 'mb-1 leading-[125%] text-lg font-semibold')}>{t(`${i18nPrefix}.name`)}</div>
|
||||||
<div className={cn(isFreePlan ? 'text-[#FB6514]' : 'text-gray-500', 'mb-4 h-8 leading-[125%] text-[13px] font-normal')}>{t(`${i18nPrefix}.description`)}</div>
|
<div className={cn(isFreePlan ? 'mb-5 text-[#FB6514]' : 'mb-4 text-gray-500', 'h-8 leading-[125%] text-[13px] font-normal')}>{t(`${i18nPrefix}.description`)}</div>
|
||||||
|
|
||||||
{/* Price */}
|
{/* Price */}
|
||||||
{isFreePlan && (
|
{isFreePlan && (
|
||||||
@ -225,6 +242,11 @@ const PlanItem: FC<Props> = ({
|
|||||||
<div className='leading-[125%] text-[13px] font-normal text-gray-900'>
|
<div className='leading-[125%] text-[13px] font-normal text-gray-900'>
|
||||||
{t(`${i18nPrefix}.includesTitle`)}
|
{t(`${i18nPrefix}.includesTitle`)}
|
||||||
</div>
|
</div>
|
||||||
|
<KeyValue
|
||||||
|
label={t('billing.plansCommon.messageRequest.title')}
|
||||||
|
value={messagesRequest}
|
||||||
|
tooltip={t('billing.plansCommon.messageRequest.tooltip') as string}
|
||||||
|
/>
|
||||||
<KeyValue
|
<KeyValue
|
||||||
label={t('billing.plansCommon.modelProviders')}
|
label={t('billing.plansCommon.modelProviders')}
|
||||||
value={planInfo.modelProviders}
|
value={planInfo.modelProviders}
|
||||||
@ -246,11 +268,7 @@ const PlanItem: FC<Props> = ({
|
|||||||
label={t('billing.plansCommon.documentProcessingPriority')}
|
label={t('billing.plansCommon.documentProcessingPriority')}
|
||||||
value={t(`billing.plansCommon.priority.${planInfo.documentProcessingPriority}`) as string}
|
value={t(`billing.plansCommon.priority.${planInfo.documentProcessingPriority}`) as string}
|
||||||
/>
|
/>
|
||||||
<KeyValue
|
|
||||||
label={t('billing.plansCommon.messageRequest.title')}
|
|
||||||
value={planInfo.messageRequest === NUM_INFINITE ? t('billing.plansCommon.unlimited') as string : `${planInfo.messageRequest} ${t('billing.plansCommon.messageRequest.unit')}`}
|
|
||||||
tooltip={t('billing.plansCommon.messageRequest.tooltip') as string}
|
|
||||||
/>
|
|
||||||
<KeyValue
|
<KeyValue
|
||||||
label={t('billing.plansCommon.annotatedResponse.title')}
|
label={t('billing.plansCommon.annotatedResponse.title')}
|
||||||
value={planInfo.annotatedResponse === NUM_INFINITE ? t('billing.plansCommon.unlimited') as string : `${planInfo.annotatedResponse}`}
|
value={planInfo.annotatedResponse === NUM_INFINITE ? t('billing.plansCommon.unlimited') as string : `${planInfo.annotatedResponse}`}
|
||||||
@ -260,6 +278,10 @@ const PlanItem: FC<Props> = ({
|
|||||||
label={t('billing.plansCommon.logsHistory')}
|
label={t('billing.plansCommon.logsHistory')}
|
||||||
value={planInfo.logHistory === NUM_INFINITE ? t('billing.plansCommon.unlimited') as string : `${planInfo.logHistory} ${t('billing.plansCommon.days')}`}
|
value={planInfo.logHistory === NUM_INFINITE ? t('billing.plansCommon.unlimited') as string : `${planInfo.logHistory} ${t('billing.plansCommon.days')}`}
|
||||||
/>
|
/>
|
||||||
|
<KeyValue
|
||||||
|
label={t('billing.plansCommon.customTools')}
|
||||||
|
value={planInfo.customTools === NUM_INFINITE ? t('billing.plansCommon.unlimited') as string : (planInfo.customTools === unAvailable ? t('billing.plansCommon.unavailable') as string : `${planInfo.customTools}`)}
|
||||||
|
/>
|
||||||
<KeyValue
|
<KeyValue
|
||||||
label={t('billing.plansCommon.support')}
|
label={t('billing.plansCommon.support')}
|
||||||
value={supportContent}
|
value={supportContent}
|
||||||
|
@ -19,7 +19,11 @@ export type PlanInfo = {
|
|||||||
vectorSpace: number
|
vectorSpace: number
|
||||||
documentProcessingPriority: Priority
|
documentProcessingPriority: Priority
|
||||||
logHistory: number
|
logHistory: number
|
||||||
messageRequest: number
|
customTools: string | number
|
||||||
|
messageRequest: {
|
||||||
|
en: string | number
|
||||||
|
zh: string | number
|
||||||
|
}
|
||||||
annotatedResponse: number
|
annotatedResponse: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ const translation = {
|
|||||||
save: 'Save ',
|
save: 'Save ',
|
||||||
free: 'Free',
|
free: 'Free',
|
||||||
currentPlan: 'Current Plan',
|
currentPlan: 'Current Plan',
|
||||||
|
contractSales: 'Contact sales',
|
||||||
contractOwner: 'Contact team manager',
|
contractOwner: 'Contact team manager',
|
||||||
startForFree: 'Start for free',
|
startForFree: 'Start for free',
|
||||||
getStartedWith: 'Get started with ',
|
getStartedWith: 'Get started with ',
|
||||||
@ -40,6 +41,8 @@ const translation = {
|
|||||||
'top-priority': 'Top Priority',
|
'top-priority': 'Top Priority',
|
||||||
},
|
},
|
||||||
logsHistory: 'Logs history',
|
logsHistory: 'Logs history',
|
||||||
|
customTools: 'Custom Tools',
|
||||||
|
unavailable: 'Unavailable',
|
||||||
days: 'days',
|
days: 'days',
|
||||||
unlimited: 'Unlimited',
|
unlimited: 'Unlimited',
|
||||||
support: 'Support',
|
support: 'Support',
|
||||||
@ -53,15 +56,15 @@ const translation = {
|
|||||||
dedicatedAPISupport: 'Dedicated API support',
|
dedicatedAPISupport: 'Dedicated API support',
|
||||||
customIntegration: 'Custom integration and support',
|
customIntegration: 'Custom integration and support',
|
||||||
ragAPIRequest: 'RAG API Requests',
|
ragAPIRequest: 'RAG API Requests',
|
||||||
agentModel: 'Agent Model',
|
agentMode: 'Agent Mode',
|
||||||
|
workflow: 'Workflow',
|
||||||
},
|
},
|
||||||
comingSoon: 'Coming soon',
|
comingSoon: 'Coming soon',
|
||||||
member: 'Member',
|
member: 'Member',
|
||||||
memberAfter: 'Member',
|
memberAfter: 'Member',
|
||||||
messageRequest: {
|
messageRequest: {
|
||||||
title: 'Message Requests',
|
title: 'Message Credits',
|
||||||
unit: 'per day',
|
tooltip: 'Message invocation quotas for various plans using OpenAI models (except gpt4).Messages over the limit will use your OpenAI API Key.',
|
||||||
tooltip: 'Includes all messages from your apps, whether via APIs or web sessions. (Not LLM resource usage)',
|
|
||||||
},
|
},
|
||||||
annotatedResponse: {
|
annotatedResponse: {
|
||||||
title: 'Annotation Quota Limits',
|
title: 'Annotation Quota Limits',
|
||||||
|
@ -59,9 +59,8 @@ const translation = {
|
|||||||
member: 'Member',
|
member: 'Member',
|
||||||
memberAfter: 'Member',
|
memberAfter: 'Member',
|
||||||
messageRequest: {
|
messageRequest: {
|
||||||
title: 'Message Requests',
|
title: 'Message Credits',
|
||||||
unit: 'per day',
|
tooltip: 'Message invocation quotas for various plans using OpenAI models (except gpt4).Messages over the limit will use your OpenAI API Key.',
|
||||||
tooltip: 'Includes all messages from your apps, whether via APIs or web sessions. (Not LLM resource usage)',
|
|
||||||
},
|
},
|
||||||
annotatedResponse: {
|
annotatedResponse: {
|
||||||
title: 'Annotation Quota Limits',
|
title: 'Annotation Quota Limits',
|
||||||
|
@ -19,6 +19,7 @@ const translation = {
|
|||||||
year: '年',
|
year: '年',
|
||||||
save: '节省',
|
save: '节省',
|
||||||
currentPlan: '当前计划',
|
currentPlan: '当前计划',
|
||||||
|
contractSales: '联系销售',
|
||||||
contractOwner: '联系团队管理员',
|
contractOwner: '联系团队管理员',
|
||||||
free: '免费',
|
free: '免费',
|
||||||
startForFree: '免费开始',
|
startForFree: '免费开始',
|
||||||
@ -40,6 +41,8 @@ const translation = {
|
|||||||
'top-priority': '最高优先级',
|
'top-priority': '最高优先级',
|
||||||
},
|
},
|
||||||
logsHistory: '日志历史',
|
logsHistory: '日志历史',
|
||||||
|
customTools: '自定义工具',
|
||||||
|
unavailable: '不可用',
|
||||||
days: '天',
|
days: '天',
|
||||||
unlimited: '无限制',
|
unlimited: '无限制',
|
||||||
support: '支持',
|
support: '支持',
|
||||||
@ -53,15 +56,15 @@ const translation = {
|
|||||||
dedicatedAPISupport: '专用 API 支持',
|
dedicatedAPISupport: '专用 API 支持',
|
||||||
customIntegration: '自定义集成和支持',
|
customIntegration: '自定义集成和支持',
|
||||||
ragAPIRequest: 'RAG API 请求',
|
ragAPIRequest: 'RAG API 请求',
|
||||||
agentModel: 'Agent 模型',
|
agentMode: '代理模式',
|
||||||
|
workflow: '工作流',
|
||||||
},
|
},
|
||||||
comingSoon: '即将推出',
|
comingSoon: '即将推出',
|
||||||
member: '成员',
|
member: '成员',
|
||||||
memberAfter: '个成员',
|
memberAfter: '个成员',
|
||||||
messageRequest: {
|
messageRequest: {
|
||||||
title: '信息限制',
|
title: '消息额度',
|
||||||
unit: '条每天',
|
tooltip: '为不同方案提供基于 OpenAI 模型的消息响应额度。',
|
||||||
tooltip: '指每日应用会话调用 Dify API 的次数(而非 LLMs 的 API 资源调用),它包含你所有应用中通过 API 或者在 WebApp 会话中产生的消息数。',
|
|
||||||
},
|
},
|
||||||
annotatedResponse: {
|
annotatedResponse: {
|
||||||
title: '标注回复数',
|
title: '标注回复数',
|
||||||
|
Loading…
Reference in New Issue
Block a user