mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-25 20:02:47 +00:00
chore: i18n; team auth
This commit is contained in:
parent
a1ef36bbc0
commit
ebb780961e
|
|
@ -133,5 +133,7 @@
|
|||
"app_registration_count": "App registration count",
|
||||
"audit_log_store_duration": "Audit log storage duration",
|
||||
"ticket_response_time": "Ticket response time",
|
||||
"custom_config_details": "Custom configuration details"
|
||||
"custom_config_details": "Custom configuration details",
|
||||
"upgrade_to_use_custom_domain": "Current plan does not support custom domains, please upgrade first",
|
||||
"upgrade_plan": "Upgrade plan"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,9 +123,6 @@
|
|||
"requests_per_minute": "QPM",
|
||||
"reset_default": "恢复默认配置",
|
||||
"status": "状态",
|
||||
"subscription_mode_month": "时长",
|
||||
"subscription_package": "订阅套餐",
|
||||
"subscription_period": "订阅周期",
|
||||
"support_wallet_amount": "金额",
|
||||
"team": "团队管理",
|
||||
"third_party": "第三方账号",
|
||||
|
|
@ -133,5 +130,11 @@
|
|||
"usage_records": "使用记录",
|
||||
"website_sync_per_dataset": "站点同步最大页数",
|
||||
"yes": "是",
|
||||
"yuan": "{{amount}}元"
|
||||
"yuan": "{{amount}}元",
|
||||
"no": "否",
|
||||
"subscription_period": "订阅周期",
|
||||
"subscription_package": "订阅套餐",
|
||||
"subscription_mode_month": "时长",
|
||||
"upgrade_to_use_custom_domain": "当前套餐不支持自定义域名,请先升级",
|
||||
"upgrade_plan": "升级套餐"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,5 +133,10 @@
|
|||
"usage_records": "使用記錄",
|
||||
"website_sync_per_dataset": "站點同步最大頁數",
|
||||
"yes": "是",
|
||||
"yuan": "{{amount}}元"
|
||||
"yuan": "{{amount}}元",
|
||||
"month": "月",
|
||||
"extra_dataset_size": "額外知識庫容量",
|
||||
"extra_ai_points": "AI 積分運算標準",
|
||||
"upgrade_to_use_custom_domain": "目前套餐不支援自訂域名,請先升級",
|
||||
"upgrade_plan": "升級套餐"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,10 @@ import { useConfirm } from '@fastgpt/web/hooks/useConfirm';
|
|||
import EmptyTip from '@fastgpt/web/components/common/EmptyTip';
|
||||
import MyLoading from '@fastgpt/web/components/common/MyLoading';
|
||||
import type { CustomDomainType } from '@fastgpt/global/support/customDomain/type';
|
||||
import { useState } from 'react';
|
||||
import { useState, useMemo } from 'react';
|
||||
import { useUserStore } from '@/web/support/user/useUserStore';
|
||||
import { StandardSubLevelEnum } from '@fastgpt/global/support/wallet/sub/constants';
|
||||
import { useRouter } from 'next/router';
|
||||
|
||||
const CreateCustomDomainModal = dynamic(
|
||||
() => import('@/pageComponents/account/customDomain/createModal')
|
||||
|
|
@ -33,6 +36,9 @@ const DomainVerifyModal = dynamic(
|
|||
|
||||
const CustomDomain = () => {
|
||||
const { t } = useTranslation();
|
||||
const router = useRouter();
|
||||
const { teamPlanStatus } = useUserStore();
|
||||
|
||||
const {
|
||||
data: customDomainList,
|
||||
refreshAsync: refreshCustomDomainList,
|
||||
|
|
@ -64,6 +70,14 @@ const CustomDomain = () => {
|
|||
|
||||
const [editDomain, setEditDomain] = useState<CustomDomainType | undefined>(undefined);
|
||||
|
||||
// 检查用户是否有 advanced 套餐
|
||||
const isAdvancedPlan = useMemo(() => {
|
||||
const currentLevel = teamPlanStatus?.standard?.currentSubLevel;
|
||||
if (!currentLevel) return false;
|
||||
|
||||
return currentLevel === StandardSubLevelEnum.advanced;
|
||||
}, [teamPlanStatus?.standard?.currentSubLevel]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<AccountContainer>
|
||||
|
|
@ -75,7 +89,12 @@ const CustomDomain = () => {
|
|||
{t('account:custom_domain')}
|
||||
{customDomainList?.length ? `: (${customDomainList.length}/3)` : <></>}
|
||||
</Box>
|
||||
<Button variant="whitePrimaryOutline" onClick={onOpenCreateModal}>
|
||||
|
||||
<Button
|
||||
variant="whitePrimaryOutline"
|
||||
onClick={onOpenCreateModal}
|
||||
isDisabled={!isAdvancedPlan}
|
||||
>
|
||||
{t('common:Add')}
|
||||
</Button>
|
||||
</Flex>
|
||||
|
|
@ -136,8 +155,31 @@ const CustomDomain = () => {
|
|||
) : (
|
||||
<Tr h="100%">
|
||||
<Td colSpan={5} textAlign="center" h="100%">
|
||||
<Flex h="100%" alignItems="center" justifyContent="center" minH="400px">
|
||||
<EmptyTip />
|
||||
<Flex
|
||||
h="100%"
|
||||
alignItems="center"
|
||||
justifyContent="center"
|
||||
minH="400px"
|
||||
flexDirection="column"
|
||||
gap={4}
|
||||
>
|
||||
<EmptyTip
|
||||
text={
|
||||
!isAdvancedPlan && (
|
||||
<Flex flexDir="column" alignItems="center">
|
||||
<Box>{t('account:upgrade_to_use_custom_domain')}</Box>
|
||||
<Button
|
||||
mt="4"
|
||||
variant="primary"
|
||||
onClick={() => router.push('/price')}
|
||||
size="md"
|
||||
>
|
||||
{t('account:upgrade_plan')}
|
||||
</Button>
|
||||
</Flex>
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Flex>
|
||||
</Td>
|
||||
</Tr>
|
||||
|
|
|
|||
Loading…
Reference in New Issue