diff --git a/web/app/components/app/create-app-modal/index.tsx b/web/app/components/app/create-app-modal/index.tsx index d7aafce079..c442b6e979 100644 --- a/web/app/components/app/create-app-modal/index.tsx +++ b/web/app/components/app/create-app-modal/index.tsx @@ -214,6 +214,7 @@ function CreateApp({ onClose, onSuccess, onCreateFromTemplate }: CreateAppProps) /> + {isAppsFull && }
{t('app.newApp.noIdeaTip')} @@ -251,13 +252,6 @@ function CreateApp({ onClose, onSuccess, onCreateFromTemplate }: CreateAppProps)
- { - isAppsFull && ( -
- -
- ) - } } type CreateAppDialogProps = CreateAppProps & { diff --git a/web/app/components/app/duplicate-modal/index.tsx b/web/app/components/app/duplicate-modal/index.tsx index 65ce6991b9..f0500706e5 100644 --- a/web/app/components/app/duplicate-modal/index.tsx +++ b/web/app/components/app/duplicate-modal/index.tsx @@ -96,7 +96,7 @@ const DuplicateAppModal = ({ className='h-10' /> - {isAppsFull && } + {isAppsFull && }
diff --git a/web/app/components/billing/apps-full-in-dialog/index.tsx b/web/app/components/billing/apps-full-in-dialog/index.tsx index b218216361..b721b94b01 100644 --- a/web/app/components/billing/apps-full-in-dialog/index.tsx +++ b/web/app/components/billing/apps-full-in-dialog/index.tsx @@ -3,35 +3,82 @@ import type { FC } from 'react' import React from 'react' import { useTranslation } from 'react-i18next' import UpgradeBtn from '../upgrade-btn' -import AppsInfo from '../usage-info/apps-info' +import ProgressBar from '@/app/components/billing/progress-bar' +import Button from '@/app/components/base/button' +import { mailToSupport } from '@/app/components/header/utils/util' +import { useProviderContext } from '@/context/provider-context' +import { useAppContext } from '@/context/app-context' +import { Plan } from '@/app/components/billing/type' import s from './style.module.css' import cn from '@/utils/classnames' -import GridMask from '@/app/components/base/grid-mask' -const AppsFull: FC<{ loc: string; className?: string }> = ({ +const LOW = 50 +const MIDDLE = 80 + +const AppsFull: FC<{ loc: string; className?: string; }> = ({ loc, className, }) => { const { t } = useTranslation() + const { plan } = useProviderContext() + const { userProfile, langeniusVersionInfo } = useAppContext() + const isTeam = plan.type === Plan.team + const usage = plan.usage.buildApps + const total = plan.total.buildApps + const percent = usage / total * 100 + const color = (() => { + if (percent < LOW) + return 'bg-components-progress-bar-progress-solid' + if (percent < MIDDLE) + return 'bg-components-progress-warning-progress' + + return 'bg-components-progress-error-progress' + })() return ( - -
-
-
-
{t('billing.apps.fullTipLine1')}
-
{t('billing.apps.fullTipLine2')}
+
+
+ {!isTeam && ( +
+
+ {t('billing.apps.fullTip1')} +
+
{t('billing.apps.fullTip1des')}
-
- + )} + {isTeam && ( +
+
+ {t('billing.apps.fullTip2')} +
+
{t('billing.apps.fullTip2des')}
-
- + )} + {(plan.type === Plan.sandbox || plan.type === Plan.professional) && ( + + )} + {plan.type !== Plan.sandbox && plan.type !== Plan.professional && ( + + )}
- +
+
+
{t('billing.usagePage.buildApps')}
+
{usage}/{total}
+
+ +
+
) } export default React.memo(AppsFull) diff --git a/web/app/components/billing/apps-full-in-dialog/style.module.css b/web/app/components/billing/apps-full-in-dialog/style.module.css index 7ad3180a5a..d3150914e8 100644 --- a/web/app/components/billing/apps-full-in-dialog/style.module.css +++ b/web/app/components/billing/apps-full-in-dialog/style.module.css @@ -1,5 +1,5 @@ .textGradient { - background: linear-gradient(92deg, #2250F2 -29.55%, #0EBCF3 75.22%); + background: linear-gradient(92deg, #0EBCF3 -29.55%, #2250F2 75.22%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; diff --git a/web/app/components/billing/apps-full/index.tsx b/web/app/components/billing/apps-full/index.tsx deleted file mode 100644 index 01d0bdf764..0000000000 --- a/web/app/components/billing/apps-full/index.tsx +++ /dev/null @@ -1,27 +0,0 @@ -'use client' -import type { FC } from 'react' -import React from 'react' -import { useTranslation } from 'react-i18next' -import UpgradeBtn from '../upgrade-btn' -import s from './style.module.css' -import cn from '@/utils/classnames' -import GridMask from '@/app/components/base/grid-mask' - -const AppsFull: FC = () => { - const { t } = useTranslation() - - return ( - -
-
-
{t('billing.apps.fullTipLine1')}
-
{t('billing.apps.fullTipLine2')}
-
-
- -
-
-
- ) -} -export default React.memo(AppsFull) diff --git a/web/app/components/billing/apps-full/style.module.css b/web/app/components/billing/apps-full/style.module.css deleted file mode 100644 index 7ad3180a5a..0000000000 --- a/web/app/components/billing/apps-full/style.module.css +++ /dev/null @@ -1,7 +0,0 @@ -.textGradient { - background: linear-gradient(92deg, #2250F2 -29.55%, #0EBCF3 75.22%); - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; - background-clip: text; - text-fill-color: transparent; -} \ No newline at end of file diff --git a/web/app/components/explore/create-app-modal/index.tsx b/web/app/components/explore/create-app-modal/index.tsx index a2a24babc3..585c52f828 100644 --- a/web/app/components/explore/create-app-modal/index.tsx +++ b/web/app/components/explore/create-app-modal/index.tsx @@ -142,7 +142,7 @@ const CreateAppModal = ({

{t('app.answerIcon.descriptionInExplore')}

)} - {!isEditModal && isAppsFull && } + {!isEditModal && isAppsFull && }
diff --git a/web/i18n/en-US/billing.ts b/web/i18n/en-US/billing.ts index ea84927c07..893e730842 100644 --- a/web/i18n/en-US/billing.ts +++ b/web/i18n/en-US/billing.ts @@ -170,8 +170,11 @@ const translation = { fullSolution: 'Upgrade your plan to get more space.', }, apps: { - fullTipLine1: 'Upgrade your plan to', - fullTipLine2: 'build more apps.', + fullTip1: 'Upgrade to create more apps', + fullTip1des: 'You\'ve reached the limit of build apps on this plan', + fullTip2: 'Plan limit reached', + fullTip2des: 'It is recommended to clean up inactive applications to free up usage, or contact us.', + contactUs: 'Contact us', }, annotatedResponse: { fullTipLine1: 'Upgrade your plan to', diff --git a/web/i18n/zh-Hans/billing.ts b/web/i18n/zh-Hans/billing.ts index 8b6826bb32..8bddbfc2ba 100644 --- a/web/i18n/zh-Hans/billing.ts +++ b/web/i18n/zh-Hans/billing.ts @@ -169,8 +169,11 @@ const translation = { fullSolution: '升级您的套餐以获得更多空间。', }, apps: { - fullTipLine1: '升级您的套餐以', - fullTipLine2: '构建更多的程序。', + fullTip1: '升级以创建更多应用', + fullTip1des: '您已达到此计划上构建应用的限制', + fullTip2: '计划限制已达到', + fullTip2des: '推荐您清理不活跃的应用或者联系我们', + contactUs: '联系我们', }, annotatedResponse: { fullTipLine1: '升级您的套餐以',