diff --git a/web/src/components/SiderMenu/SubscriptionDetailModal.tsx b/web/src/components/SiderMenu/SubscriptionDetailModal.tsx index fbb5030c..699328e2 100644 --- a/web/src/components/SiderMenu/SubscriptionDetailModal.tsx +++ b/web/src/components/SiderMenu/SubscriptionDetailModal.tsx @@ -2,11 +2,11 @@ * @Author: ZhaoYing * @Date: 2026-04-14 12:28:23 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-04-16 17:34:02 + * @Last Modified time: 2026-04-21 15:46:35 */ import { useState, forwardRef, useImperativeHandle } from 'react'; -import { Flex, Tooltip, Divider } from 'antd'; +import { Flex, Divider } from 'antd'; import { useTranslation } from 'react-i18next'; import clsx from 'clsx'; @@ -82,8 +82,7 @@ const SubscriptionDetailModal = forwardRef((_props, {/* Features */} {billingUnits.map(({ key, unit, icon }) => { - const value = detail?.quotas[key as keyof Subscription['quotas']]; - if (value === undefined || value === null) return null; + const value = detail?.quotas?.[key as keyof Subscription['quotas']]; return ( ((_props, /> ) })} - {detail?.package_plan?.tech_support && ( + {detail?.package_plan?.tech_support && detail?.package_plan?.[getKeyWithLanguage('tech_support')] && ( ((_props, theme_color={detail?.package_plan?.theme_color} /> )} - {detail?.package_plan?.sla_compliance && ( + {detail?.package_plan?.sla_compliance && detail?.package_plan?.[getKeyWithLanguage('sla_compliance')] && ( {['workspace_quota', 'skill_quota', 'app_quota', 'model_quota'].map(key => (
-
{subscription.quotas?.[key as keyof typeof subscription.quotas]}
+
{subscription.quotas?.[key as keyof typeof subscription.quotas] ?? t('package.noLimit')}
{t(`index.${key}`)}
))} diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index 64b600ba..13634544 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -3093,6 +3093,7 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re editPackage: 'Edit Package', viewDetail: 'View full package details', + noLimit: 'Unlimited', }, }, }; diff --git a/web/src/i18n/zh.ts b/web/src/i18n/zh.ts index cabb1eca..64689bc2 100644 --- a/web/src/i18n/zh.ts +++ b/web/src/i18n/zh.ts @@ -3057,6 +3057,7 @@ export const zh = { editPackage: '编辑套餐', viewDetail: '查看完整套餐详情', + noLimit: '不限制', }, }, } \ No newline at end of file diff --git a/web/src/views/Package/constant.ts b/web/src/views/Package/constant.ts index 7fc69969..168b65f8 100644 --- a/web/src/views/Package/constant.ts +++ b/web/src/views/Package/constant.ts @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-04-14 11:43:57 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-04-14 11:44:40 + * @Last Modified time: 2026-04-21 15:44:13 */ export const billingUnits = [ { @@ -42,7 +42,7 @@ export const billingUnits = [ }, { key: 'model_quota', - unit: 'ops', placeholder: 'numberPlaceholder', + unit: 'pcs', placeholder: 'numberPlaceholder', icon: 'model', }, { diff --git a/web/src/views/Package/index.tsx b/web/src/views/Package/index.tsx index b3aed9d5..ea9f1ec5 100644 --- a/web/src/views/Package/index.tsx +++ b/web/src/views/Package/index.tsx @@ -2,7 +2,7 @@ * @Author: ZhaoYing * @Date: 2026-04-14 11:34:42 * @Last Modified by: ZhaoYing - * @Last Modified time: 2026-04-16 17:23:49 + * @Last Modified time: 2026-04-21 15:45:30 */ /** * Package Component @@ -60,7 +60,7 @@ const btnClassNames = { default: 'rb:h-10! rb:rounded-[8px]! rb:bg-[#212332]! rb:text-white! rb:border-0! rb:hover:border-0! rb:hover:opacity-[0.8]', } -export const UnitWrapper = ({ titleKey, value, icon, unit, theme_color = '#171719' }: { titleKey: string; value: number | string; icon: string; unit?: string; theme_color?: string; }) => { +export const UnitWrapper = ({ titleKey, value, icon, unit, theme_color = '#171719' }: { titleKey: string; value?: number | string | null; icon: string; unit?: string; theme_color?: string; }) => { const { t } = useTranslation(); const renderFeatureIcon = (iconKey: string, color: string) => { @@ -78,7 +78,7 @@ export const UnitWrapper = ({ titleKey, value, icon, unit, theme_color = '#17171 >{renderFeatureIcon(icon, theme_color)}
{t(`package.${titleKey}`)}
-
{value} {unit ? t(`package.${unit}`) : ''}
+ {value ?
{value} {unit ? t(`package.${unit}`) : ''}
:
{t('package.noLimit')}
}
) @@ -252,7 +252,6 @@ const Package: FC = () => { > {billingUnits.map(({ key, unit, icon }) => { const value = pkg?.quotas?.[key as keyof Package['quotas']]; - if (value === undefined || value === null) return null; return ( { /> ) })} - {pkg.tech_support && ( + {pkg.tech_support && pkg[getKeyWithLanguage('tech_support')] && ( { theme_color={pkg.theme_color} /> )} - {pkg.sla_compliance && ( + {pkg.sla_compliance && pkg[getKeyWithLanguage('sla_compliance')] && (