feat: optimize i18n implementation for better localization (#2062)
* feat: optimize i18n implementation for better localization * delete i18n-ally-custom-framework.yml * update common key
This commit is contained in:
@@ -43,7 +43,7 @@ const BillTable = () => {
|
||||
const billTypeList = useMemo(
|
||||
() =>
|
||||
[
|
||||
{ label: t('common.All'), value: '' },
|
||||
{ label: t('common:common.All'), value: '' },
|
||||
...Object.entries(billTypeMap).map(([key, value]) => ({
|
||||
label: t(value.label),
|
||||
value: key
|
||||
@@ -120,9 +120,9 @@ const BillTable = () => {
|
||||
w={'130px'}
|
||||
></MySelect>
|
||||
</Th>
|
||||
<Th>{t('user.Time')}</Th>
|
||||
<Th>{t('support.wallet.Amount')}</Th>
|
||||
<Th>{t('support.wallet.bill.Status')}</Th>
|
||||
<Th>{t('common:user.Time')}</Th>
|
||||
<Th>{t('common:support.wallet.Amount')}</Th>
|
||||
<Th>{t('common:support.wallet.bill.Status')}</Th>
|
||||
<Th></Th>
|
||||
</Tr>
|
||||
</Thead>
|
||||
@@ -139,11 +139,11 @@ const BillTable = () => {
|
||||
<Td>
|
||||
{item.status === 'NOTPAY' && (
|
||||
<Button mr={4} onClick={() => handleRefreshPayOrder(item._id)} size={'sm'}>
|
||||
{t('common.Update')}
|
||||
{t('common:common.Update')}
|
||||
</Button>
|
||||
)}
|
||||
<Button variant={'whiteBase'} size={'sm'} onClick={() => setBillDetail(item)}>
|
||||
{t('common.Detail')}
|
||||
{t('common:common.Detail')}
|
||||
</Button>
|
||||
</Td>
|
||||
</Tr>
|
||||
@@ -164,7 +164,7 @@ const BillTable = () => {
|
||||
>
|
||||
<MyIcon name="empty" w={'48px'} h={'48px'} color={'transparent'} />
|
||||
<Box mt={2} color={'myGray.500'}>
|
||||
{t('support.wallet.noBill')}
|
||||
{t('common:support.wallet.noBill')}
|
||||
</Box>
|
||||
</Flex>
|
||||
)}
|
||||
@@ -187,40 +187,40 @@ function BillDetailModal({ bill, onClose }: { bill: BillSchemaType; onClose: ()
|
||||
isOpen={true}
|
||||
onClose={onClose}
|
||||
iconSrc="/imgs/modal/bill.svg"
|
||||
title={t('support.wallet.usage.Usage Detail')}
|
||||
title={t('common:support.wallet.usage.Usage Detail')}
|
||||
maxW={['90vw', '700px']}
|
||||
>
|
||||
<ModalBody>
|
||||
<Flex alignItems={'center'} pb={4}>
|
||||
<FormLabel flex={'0 0 120px'}>{t('support.wallet.bill.Number')}:</FormLabel>
|
||||
<FormLabel flex={'0 0 120px'}>{t('common:support.wallet.bill.Number')}:</FormLabel>
|
||||
<Box>{bill.orderId}</Box>
|
||||
</Flex>
|
||||
<Flex alignItems={'center'} pb={4}>
|
||||
<FormLabel flex={'0 0 120px'}>{t('support.wallet.usage.Time')}:</FormLabel>
|
||||
<FormLabel flex={'0 0 120px'}>{t('common:support.wallet.usage.Time')}:</FormLabel>
|
||||
<Box>{dayjs(bill.createTime).format('YYYY/MM/DD HH:mm:ss')}</Box>
|
||||
</Flex>
|
||||
<Flex alignItems={'center'} pb={4}>
|
||||
<FormLabel flex={'0 0 120px'}>{t('support.wallet.bill.Status')}:</FormLabel>
|
||||
<FormLabel flex={'0 0 120px'}>{t('common:support.wallet.bill.Status')}:</FormLabel>
|
||||
<Box>{t(billStatusMap[bill.status]?.label)}</Box>
|
||||
</Flex>
|
||||
{!!bill.metadata?.payWay && (
|
||||
<Flex alignItems={'center'} pb={4}>
|
||||
<FormLabel flex={'0 0 120px'}>{t('support.wallet.bill.payWay.Way')}:</FormLabel>
|
||||
<FormLabel flex={'0 0 120px'}>{t('common:support.wallet.bill.payWay.Way')}:</FormLabel>
|
||||
<Box>{t(billPayWayMap[bill.metadata.payWay]?.label)}</Box>
|
||||
</Flex>
|
||||
)}
|
||||
<Flex alignItems={'center'} pb={4}>
|
||||
<FormLabel flex={'0 0 120px'}>{t('support.wallet.Amount')}:</FormLabel>
|
||||
<FormLabel flex={'0 0 120px'}>{t('common:support.wallet.Amount')}:</FormLabel>
|
||||
<Box>{formatStorePrice2Read(bill.price)}元</Box>
|
||||
</Flex>
|
||||
<Flex alignItems={'center'} pb={4}>
|
||||
<FormLabel flex={'0 0 120px'}>{t('support.wallet.bill.Type')}:</FormLabel>
|
||||
<FormLabel flex={'0 0 120px'}>{t('common:support.wallet.bill.Type')}:</FormLabel>
|
||||
<Box>{t(billTypeMap[bill.type]?.label)}</Box>
|
||||
</Flex>
|
||||
{!!bill.metadata?.subMode && (
|
||||
<Flex alignItems={'center'} pb={4}>
|
||||
<FormLabel flex={'0 0 120px'}>
|
||||
{t('support.wallet.subscription.mode.Period')}:
|
||||
{t('common:support.wallet.subscription.mode.Period')}:
|
||||
</FormLabel>
|
||||
<Box>{t(subModeMap[bill.metadata.subMode]?.label)}</Box>
|
||||
</Flex>
|
||||
@@ -228,7 +228,7 @@ function BillDetailModal({ bill, onClose }: { bill: BillSchemaType; onClose: ()
|
||||
{!!bill.metadata?.standSubLevel && (
|
||||
<Flex alignItems={'center'} pb={4}>
|
||||
<FormLabel flex={'0 0 120px'}>
|
||||
{t('support.wallet.subscription.Stand plan level')}:
|
||||
{t('common:support.wallet.subscription.Stand plan level')}:
|
||||
</FormLabel>
|
||||
<Box>{t(standardSubLevelMap[bill.metadata.standSubLevel]?.label)}</Box>
|
||||
</Flex>
|
||||
@@ -236,7 +236,7 @@ function BillDetailModal({ bill, onClose }: { bill: BillSchemaType; onClose: ()
|
||||
{bill.metadata?.month !== undefined && (
|
||||
<Flex alignItems={'center'} pb={4}>
|
||||
<FormLabel flex={'0 0 120px'}>
|
||||
{t('support.wallet.subscription.Month amount')}:
|
||||
{t('common:support.wallet.subscription.Month amount')}:
|
||||
</FormLabel>
|
||||
<Box>{bill.metadata?.month}</Box>
|
||||
</Flex>
|
||||
@@ -244,7 +244,7 @@ function BillDetailModal({ bill, onClose }: { bill: BillSchemaType; onClose: ()
|
||||
{bill.metadata?.datasetSize !== undefined && (
|
||||
<Flex alignItems={'center'} pb={4}>
|
||||
<FormLabel flex={'0 0 120px'}>
|
||||
{t('support.wallet.subscription.Extra dataset size')}:
|
||||
{t('common:support.wallet.subscription.Extra dataset size')}:
|
||||
</FormLabel>
|
||||
<Box>{bill.metadata?.datasetSize}</Box>
|
||||
</Flex>
|
||||
@@ -252,7 +252,7 @@ function BillDetailModal({ bill, onClose }: { bill: BillSchemaType; onClose: ()
|
||||
{bill.metadata?.extraPoints !== undefined && (
|
||||
<Flex alignItems={'center'} pb={4}>
|
||||
<FormLabel flex={'0 0 120px'}>
|
||||
{t('support.wallet.subscription.Extra ai points')}:
|
||||
{t('common:support.wallet.subscription.Extra ai points')}:
|
||||
</FormLabel>
|
||||
<Box>{bill.metadata.extraPoints}</Box>
|
||||
</Flex>
|
||||
|
||||
@@ -29,7 +29,7 @@ const Individuation = () => {
|
||||
});
|
||||
reset(data);
|
||||
toast({
|
||||
title: t('dataset.data.Update Success Tip'),
|
||||
title: t('common:dataset.data.Update Success Tip'),
|
||||
status: 'success'
|
||||
});
|
||||
},
|
||||
@@ -40,12 +40,12 @@ const Individuation = () => {
|
||||
<Box py={[3, '28px']} px={['5vw', '64px']}>
|
||||
<Flex alignItems={'center'} fontSize={'lg'} h={'30px'}>
|
||||
<MyIcon mr={2} name={'support/user/individuation'} w={'20px'} />
|
||||
{t('support.account.Individuation')}
|
||||
{t('common:support.account.Individuation')}
|
||||
</Flex>
|
||||
|
||||
<Card mt={6} px={[3, 10]} py={[3, 7]} fontSize={'sm'}>
|
||||
<Flex alignItems={'center'} w={['85%', '350px']}>
|
||||
<Box flex={'0 0 80px'}>{t('user.Language')}: </Box>
|
||||
<Box flex={'0 0 80px'}>{t('common:user.Language')}: </Box>
|
||||
<Box flex={'1 0 0'}>
|
||||
<MySelect
|
||||
value={i18n.language}
|
||||
@@ -68,7 +68,7 @@ const Individuation = () => {
|
||||
</Box>
|
||||
</Flex>
|
||||
<Flex mt={6} alignItems={'center'} w={['85%', '350px']}>
|
||||
<Box flex={'0 0 80px'}>{t('user.Timezone')}: </Box>
|
||||
<Box flex={'0 0 80px'}>{t('common:user.Timezone')}: </Box>
|
||||
<TimezoneSelect
|
||||
value={userInfo?.timezone}
|
||||
onChange={(e) => {
|
||||
|
||||
@@ -127,7 +127,7 @@ const MyInfo = () => {
|
||||
});
|
||||
reset(data);
|
||||
toast({
|
||||
title: t('dataset.data.Update Success Tip'),
|
||||
title: t('common:dataset.data.Update Success Tip'),
|
||||
status: 'success'
|
||||
});
|
||||
},
|
||||
@@ -152,7 +152,7 @@ const MyInfo = () => {
|
||||
});
|
||||
} catch (err: any) {
|
||||
toast({
|
||||
title: typeof err === 'string' ? err : t('common.error.Select avatar failed'),
|
||||
title: typeof err === 'string' ? err : t('common:common.error.Select avatar failed'),
|
||||
status: 'warning'
|
||||
});
|
||||
}
|
||||
@@ -172,16 +172,16 @@ const MyInfo = () => {
|
||||
{isPc && (
|
||||
<Flex alignItems={'center'} fontSize={'md'} h={'30px'}>
|
||||
<MyIcon mr={2} name={'support/user/userLight'} w={'1.25rem'} />
|
||||
{t('support.user.User self info')}
|
||||
{t('common:support.user.User self info')}
|
||||
</Flex>
|
||||
)}
|
||||
|
||||
<Box mt={[0, 6]} fontSize={'sm'}>
|
||||
{isPc ? (
|
||||
<Flex alignItems={'center'} cursor={'pointer'}>
|
||||
<Box {...labelStyles}>{t('support.user.Avatar')}: </Box>
|
||||
<Box {...labelStyles}>{t('common:support.user.Avatar')}: </Box>
|
||||
|
||||
<MyTooltip label={t('common.avatar.Select Avatar')}>
|
||||
<MyTooltip label={t('common:common.avatar.Select Avatar')}>
|
||||
<Box
|
||||
w={['44px', '56px']}
|
||||
h={['44px', '56px']}
|
||||
@@ -204,7 +204,7 @@ const MyInfo = () => {
|
||||
cursor={'pointer'}
|
||||
onClick={onOpenSelectFile}
|
||||
>
|
||||
<MyTooltip label={t('common.avatar.Select Avatar')}>
|
||||
<MyTooltip label={t('common:common.avatar.Select Avatar')}>
|
||||
<Box
|
||||
w={['44px', '54px']}
|
||||
h={['44px', '54px']}
|
||||
@@ -221,17 +221,17 @@ const MyInfo = () => {
|
||||
|
||||
<Flex alignItems={'center'} fontSize={'sm'} color={'myGray.600'}>
|
||||
<MyIcon mr={1} name={'edit'} w={'14px'} />
|
||||
{t('user.Replace')}
|
||||
{t('common:user.Replace')}
|
||||
</Flex>
|
||||
</Flex>
|
||||
)}
|
||||
{feConfigs.isPlus && (
|
||||
<Flex mt={[0, 4]} alignItems={'center'}>
|
||||
<Box {...labelStyles}>{t('user.Member Name')}: </Box>
|
||||
<Box {...labelStyles}>{t('common:user.Member Name')}: </Box>
|
||||
<Input
|
||||
flex={'1 0 0'}
|
||||
defaultValue={userInfo?.team?.memberName || 'Member'}
|
||||
title={t('user.Edit name')}
|
||||
title={t('common:user.Edit name')}
|
||||
borderColor={'transparent'}
|
||||
transform={'translateX(-11px)'}
|
||||
maxLength={20}
|
||||
@@ -246,20 +246,20 @@ const MyInfo = () => {
|
||||
</Flex>
|
||||
)}
|
||||
<Flex alignItems={'center'} mt={6}>
|
||||
<Box {...labelStyles}>{t('user.Account')}: </Box>
|
||||
<Box {...labelStyles}>{t('common:user.Account')}: </Box>
|
||||
<Box flex={1}>{userInfo?.username}</Box>
|
||||
</Flex>
|
||||
{feConfigs.isPlus && (
|
||||
<Flex mt={6} alignItems={'center'}>
|
||||
<Box {...labelStyles}>{t('user.Password')}: </Box>
|
||||
<Box {...labelStyles}>{t('common:user.Password')}: </Box>
|
||||
<Box flex={1}>*****</Box>
|
||||
<Button size={'sm'} variant={'whitePrimary'} onClick={onOpenUpdatePsw}>
|
||||
{t('user.Change')}
|
||||
{t('common:user.Change')}
|
||||
</Button>
|
||||
</Flex>
|
||||
)}
|
||||
<Flex mt={6} alignItems={'center'}>
|
||||
<Box {...labelStyles}>{t('user.Team')}: </Box>
|
||||
<Box {...labelStyles}>{t('common:user.Team')}: </Box>
|
||||
<Box flex={1}>
|
||||
<TeamMenu />
|
||||
</Box>
|
||||
@@ -267,13 +267,13 @@ const MyInfo = () => {
|
||||
{feConfigs.isPlus && (
|
||||
<Box mt={6} whiteSpace={'nowrap'}>
|
||||
<Flex alignItems={'center'}>
|
||||
<Box {...labelStyles}>{t('user.team.Balance')}: </Box>
|
||||
<Box {...labelStyles}>{t('common:user.team.Balance')}: </Box>
|
||||
<Box flex={1}>
|
||||
<strong>{formatStorePrice2Read(userInfo?.team?.balance).toFixed(3)}</strong> 元
|
||||
</Box>
|
||||
{feConfigs?.show_pay && userInfo?.team?.permission.hasWritePer && (
|
||||
<Button variant={'whitePrimary'} size={'sm'} ml={5} onClick={onOpenPayModal}>
|
||||
{t('user.Pay')}
|
||||
{t('common:user.Pay')}
|
||||
</Button>
|
||||
)}
|
||||
</Flex>
|
||||
@@ -332,7 +332,7 @@ const PlanUsage = () => {
|
||||
return {
|
||||
colorScheme: 'green',
|
||||
value: 0,
|
||||
maxSize: t('common.Unlimited'),
|
||||
maxSize: t('common:common.Unlimited'),
|
||||
usedSize: 0
|
||||
};
|
||||
}
|
||||
@@ -347,7 +347,7 @@ const PlanUsage = () => {
|
||||
return {
|
||||
colorScheme,
|
||||
value: rate * 100,
|
||||
maxSize: teamPlanStatus.datasetMaxSize || t('common.Unlimited'),
|
||||
maxSize: teamPlanStatus.datasetMaxSize || t('common:common.Unlimited'),
|
||||
usedSize: teamPlanStatus.usedDatasetSize
|
||||
};
|
||||
}, [teamPlanStatus, t]);
|
||||
@@ -356,7 +356,7 @@ const PlanUsage = () => {
|
||||
return {
|
||||
colorScheme: 'green',
|
||||
value: 0,
|
||||
maxSize: t('common.Unlimited'),
|
||||
maxSize: t('common:common.Unlimited'),
|
||||
usedSize: 0
|
||||
};
|
||||
}
|
||||
@@ -372,7 +372,7 @@ const PlanUsage = () => {
|
||||
return {
|
||||
colorScheme,
|
||||
value: rate * 100,
|
||||
max: teamPlanStatus.totalPoints ? teamPlanStatus.totalPoints : t('common.Unlimited'),
|
||||
max: teamPlanStatus.totalPoints ? teamPlanStatus.totalPoints : t('common:common.Unlimited'),
|
||||
used: teamPlanStatus.usedPoints ? Math.round(teamPlanStatus.usedPoints) : 0
|
||||
};
|
||||
}, [teamPlanStatus, t]);
|
||||
@@ -382,13 +382,13 @@ const PlanUsage = () => {
|
||||
<Flex fontSize={'lg'} h={'30px'}>
|
||||
<Flex alignItems={'center'}>
|
||||
<MyIcon mr={2} name={'support/account/plans'} w={'20px'} />
|
||||
{t('support.wallet.subscription.Team plan and usage')}
|
||||
{t('common:support.wallet.subscription.Team plan and usage')}
|
||||
</Flex>
|
||||
<Button ml={4} size={'sm'} onClick={() => router.push(AI_POINT_USAGE_CARD_ROUTE)}>
|
||||
{t('support.user.Price')}
|
||||
{t('common:support.user.Price')}
|
||||
</Button>
|
||||
<Button ml={4} variant={'whitePrimary'} size={'sm'} onClick={onOpenStandardModal}>
|
||||
{t('support.wallet.Standard Plan Detail')}
|
||||
{t('common:support.wallet.Standard Plan Detail')}
|
||||
</Button>
|
||||
</Flex>
|
||||
<Box
|
||||
@@ -401,7 +401,7 @@ const PlanUsage = () => {
|
||||
<Flex px={[5, 7]} py={[3, 6]}>
|
||||
<Box flex={'1 0 0'}>
|
||||
<Box color={'myGray.600'} fontSize="sm">
|
||||
{t('support.wallet.subscription.Current plan')}
|
||||
{t('common:support.wallet.subscription.Current plan')}
|
||||
</Box>
|
||||
<Box fontWeight={'bold'} fontSize="lg">
|
||||
{t(planName)}
|
||||
@@ -410,7 +410,7 @@ const PlanUsage = () => {
|
||||
{isFreeTeam ? (
|
||||
<>
|
||||
<Flex mt="2" color={'#485264'} fontSize="sm">
|
||||
<Box>{t('support.wallet.Plan reset time')}:</Box>
|
||||
<Box>{t('common:support.wallet.Plan reset time')}:</Box>
|
||||
<Box ml={2}>{formatTime2YMD(standardPlan?.expiredTime)}</Box>
|
||||
</Flex>
|
||||
<Box mt="2" color={'#485264'} fontSize="sm">
|
||||
@@ -419,13 +419,13 @@ const PlanUsage = () => {
|
||||
</>
|
||||
) : (
|
||||
<Flex mt="2" color={'#485264'} fontSize="xs">
|
||||
<Box>{t('support.wallet.Plan expired time')}:</Box>
|
||||
<Box>{t('common:support.wallet.Plan expired time')}:</Box>
|
||||
<Box ml={2}>{formatTime2YMD(standardPlan?.expiredTime)}</Box>
|
||||
</Flex>
|
||||
)}
|
||||
</Box>
|
||||
<Button onClick={() => router.push('/price')} w={'8rem'} size="sm">
|
||||
{t('support.wallet.subscription.Upgrade plan')}
|
||||
{t('common:support.wallet.subscription.Upgrade plan')}
|
||||
</Button>
|
||||
</Flex>
|
||||
<Box py={3} borderTopWidth={'1px'} borderTopColor={'borderColor.base'}>
|
||||
@@ -471,7 +471,7 @@ const PlanUsage = () => {
|
||||
<Flex alignItems={'center'}>
|
||||
<Flex alignItems={'center'}>
|
||||
<Box fontWeight={'bold'} color={'myGray.900'}>
|
||||
{t('support.user.team.Dataset usage')}
|
||||
{t('common:support.user.team.Dataset usage')}
|
||||
</Box>
|
||||
<Box color={'myGray.600'} ml={2}>
|
||||
{datasetUsageMap.usedSize}/{datasetUsageMap.maxSize}
|
||||
@@ -495,11 +495,11 @@ const PlanUsage = () => {
|
||||
<Flex alignItems={'center'}>
|
||||
<Flex alignItems={'center'}>
|
||||
<Box fontWeight={'bold'} color={'myGray.900'}>
|
||||
{t('support.wallet.subscription.AI points usage')}
|
||||
{t('common:support.wallet.subscription.AI points usage')}
|
||||
</Box>
|
||||
<QuestionTip
|
||||
ml={1}
|
||||
label={t('support.wallet.subscription.AI points usage tip')}
|
||||
label={t('common:support.wallet.subscription.AI points usage tip')}
|
||||
></QuestionTip>
|
||||
<Box color={'myGray.600'} ml={2}>
|
||||
{aiPointsUsageMap.used}/{aiPointsUsageMap.max}
|
||||
@@ -573,7 +573,7 @@ const Other = () => {
|
||||
>
|
||||
<MyIcon name={'common/courseLight'} w={'18px'} color={'myGray.600'} />
|
||||
<Box ml={2} flex={1}>
|
||||
{t('system.Help Document')}
|
||||
{t('common:system.Help Document')}
|
||||
</Box>
|
||||
</Link>
|
||||
)}
|
||||
@@ -595,7 +595,7 @@ const Other = () => {
|
||||
>
|
||||
<MyIcon name={'core/app/aiLight'} w={'18px'} />
|
||||
<Box ml={2} flex={1}>
|
||||
{t('common.system.Help Chatbot')}
|
||||
{t('common:common.system.Help Chatbot')}
|
||||
</Box>
|
||||
</Link>
|
||||
)}
|
||||
@@ -662,7 +662,7 @@ const Other = () => {
|
||||
h={'48px'}
|
||||
fontSize={'sm'}
|
||||
>
|
||||
{t('system.Concat us')}
|
||||
{t('common:system.Concat us')}
|
||||
</Button>
|
||||
)}
|
||||
</Grid>
|
||||
|
||||
@@ -59,7 +59,7 @@ const InformTable = () => {
|
||||
}
|
||||
}}
|
||||
>
|
||||
{t('support.inform.Read')}
|
||||
{t('common:support.inform.Read')}
|
||||
</Button>
|
||||
)}
|
||||
</Flex>
|
||||
|
||||
@@ -25,7 +25,7 @@ const OpenAIAccountModal = ({
|
||||
onSuccess(res) {
|
||||
onClose();
|
||||
},
|
||||
errorToast: t('user.Set OpenAI Account Failed')
|
||||
errorToast: t('common:user.Set OpenAI Account Failed')
|
||||
});
|
||||
|
||||
return (
|
||||
@@ -33,7 +33,7 @@ const OpenAIAccountModal = ({
|
||||
isOpen
|
||||
onClose={onClose}
|
||||
iconSrc="common/openai"
|
||||
title={t('user.OpenAI Account Setting')}
|
||||
title={t('common:user.OpenAI Account Setting')}
|
||||
>
|
||||
<ModalBody>
|
||||
<Box fontSize={'sm'} color={'myGray.500'}>
|
||||
|
||||
@@ -58,7 +58,12 @@ const PayModal = ({
|
||||
}, [subPlans?.standard]);
|
||||
|
||||
return (
|
||||
<MyModal isOpen={true} onClose={onClose} title={t('user.Pay')} iconSrc="/imgs/modal/pay.svg">
|
||||
<MyModal
|
||||
isOpen={true}
|
||||
onClose={onClose}
|
||||
title={t('common:user.Pay')}
|
||||
iconSrc="/imgs/modal/pay.svg"
|
||||
>
|
||||
<ModalBody px={0} display={'flex'} flexDirection={'column'}>
|
||||
<Box px={6} fontSize={'sm'} mb={2} py={2} maxW={'400px'}>
|
||||
该余额仅用于自动续费标准套餐。如需购买额外套餐,可
|
||||
@@ -93,7 +98,7 @@ const PayModal = ({
|
||||
|
||||
<ModalFooter>
|
||||
<Button variant={'whiteBase'} onClick={onClose}>
|
||||
{t('common.Close')}
|
||||
{t('common:common.Close')}
|
||||
</Button>
|
||||
<Button
|
||||
ml={3}
|
||||
|
||||
@@ -69,24 +69,24 @@ const Promotion = () => {
|
||||
<Flex flexDirection={'column'} py={[0, 5]} px={5} h={'100%'} position={'relative'}>
|
||||
<Grid gridTemplateColumns={['1fr 1fr', 'repeat(2,1fr)', 'repeat(4,1fr)']} gridGap={5}>
|
||||
<Box {...statisticsStyles}>
|
||||
<Box>{t('user.Amount of inviter')}</Box>
|
||||
<Box>{t('common:user.Amount of inviter')}</Box>
|
||||
<Box {...titleStyles}>{invitedAmount}</Box>
|
||||
</Box>
|
||||
<Box {...statisticsStyles}>
|
||||
<Box>{t('user.Amount of earnings')}</Box>
|
||||
<Box>{t('common:user.Amount of earnings')}</Box>
|
||||
<Box {...titleStyles}>{earningsAmount}</Box>
|
||||
</Box>
|
||||
<Box {...statisticsStyles}>
|
||||
<Flex alignItems={'center'} justifyContent={'center'}>
|
||||
<Box>{t('user.Promotion Rate')}</Box>
|
||||
<QuestionTip ml={1} label={t('user.Promotion rate tip')}></QuestionTip>
|
||||
<Box>{t('common:user.Promotion Rate')}</Box>
|
||||
<QuestionTip ml={1} label={t('common:user.Promotion rate tip')}></QuestionTip>
|
||||
</Flex>
|
||||
<Box {...titleStyles}>{userInfo?.promotionRate || 15}%</Box>
|
||||
</Box>
|
||||
<Box {...statisticsStyles}>
|
||||
<Flex alignItems={'center'} justifyContent={'center'}>
|
||||
<Box>{t('user.Invite Url')}</Box>
|
||||
<QuestionTip ml={1} label={t('user.Invite url tip')}></QuestionTip>
|
||||
<Box>{t('common:user.Invite Url')}</Box>
|
||||
<QuestionTip ml={1} label={t('common:user.Invite url tip')}></QuestionTip>
|
||||
</Flex>
|
||||
<Button
|
||||
mt={4}
|
||||
@@ -96,7 +96,7 @@ const Promotion = () => {
|
||||
copyData(`${location.origin}/?hiId=${userInfo?._id}`);
|
||||
}}
|
||||
>
|
||||
{t('user.Copy invite url')}
|
||||
{t('common:user.Copy invite url')}
|
||||
</Button>
|
||||
</Box>
|
||||
</Grid>
|
||||
|
||||
@@ -25,15 +25,15 @@ const UpdatePswModal = ({ onClose }: { onClose: () => void }) => {
|
||||
const { mutate: onSubmit, isLoading } = useRequest({
|
||||
mutationFn: (data: FormType) => {
|
||||
if (data.newPsw !== data.confirmPsw) {
|
||||
return Promise.reject(t('common.Password inconsistency'));
|
||||
return Promise.reject(t('common:common.Password inconsistency'));
|
||||
}
|
||||
return updatePasswordByOld(data);
|
||||
},
|
||||
onSuccess() {
|
||||
onClose();
|
||||
},
|
||||
successToast: t('user.Update password successful'),
|
||||
errorToast: t('user.Update password failed')
|
||||
successToast: t('common:user.Update password successful'),
|
||||
errorToast: t('common:user.Update password failed')
|
||||
});
|
||||
|
||||
return (
|
||||
@@ -41,7 +41,7 @@ const UpdatePswModal = ({ onClose }: { onClose: () => void }) => {
|
||||
isOpen
|
||||
onClose={onClose}
|
||||
iconSrc="/imgs/modal/password.svg"
|
||||
title={t('user.Update Password')}
|
||||
title={t('common:user.Update Password')}
|
||||
>
|
||||
<ModalBody>
|
||||
<Flex alignItems={'center'}>
|
||||
|
||||
@@ -63,44 +63,44 @@ const UsageDetail = ({ usage, onClose }: { usage: UsageItemType; onClose: () =>
|
||||
isOpen={true}
|
||||
onClose={onClose}
|
||||
iconSrc="/imgs/modal/bill.svg"
|
||||
title={t('support.wallet.usage.Usage Detail')}
|
||||
title={t('common:support.wallet.usage.Usage Detail')}
|
||||
maxW={['90vw', '700px']}
|
||||
>
|
||||
<ModalBody>
|
||||
<Flex alignItems={'center'} pb={4}>
|
||||
<FormLabel flex={'0 0 80px'}>{t('support.wallet.bill.Number')}:</FormLabel>
|
||||
<FormLabel flex={'0 0 80px'}>{t('common:support.wallet.bill.Number')}:</FormLabel>
|
||||
<Box>{usage.id}</Box>
|
||||
</Flex>
|
||||
<Flex alignItems={'center'} pb={4}>
|
||||
<FormLabel flex={'0 0 80px'}>{t('support.wallet.usage.Time')}:</FormLabel>
|
||||
<FormLabel flex={'0 0 80px'}>{t('common:support.wallet.usage.Time')}:</FormLabel>
|
||||
<Box>{dayjs(usage.time).format('YYYY/MM/DD HH:mm:ss')}</Box>
|
||||
</Flex>
|
||||
<Flex alignItems={'center'} pb={4}>
|
||||
<FormLabel flex={'0 0 80px'}>{t('support.wallet.usage.App name')}:</FormLabel>
|
||||
<FormLabel flex={'0 0 80px'}>{t('common:support.wallet.usage.App name')}:</FormLabel>
|
||||
<Box>{t(usage.appName) || '-'}</Box>
|
||||
</Flex>
|
||||
<Flex alignItems={'center'} pb={4}>
|
||||
<FormLabel flex={'0 0 80px'}>{t('support.wallet.usage.Source')}:</FormLabel>
|
||||
<FormLabel flex={'0 0 80px'}>{t('common:support.wallet.usage.Source')}:</FormLabel>
|
||||
<Box>{t(UsageSourceMap[usage.source]?.label)}</Box>
|
||||
</Flex>
|
||||
<Flex alignItems={'center'} pb={4}>
|
||||
<FormLabel flex={'0 0 80px'}>{t('support.wallet.usage.Total points')}:</FormLabel>
|
||||
<FormLabel flex={'0 0 80px'}>{t('common:support.wallet.usage.Total points')}:</FormLabel>
|
||||
<Box fontWeight={'bold'}>{formatNumber(usage.totalPoints)}</Box>
|
||||
</Flex>
|
||||
<Box pb={4}>
|
||||
<FormLabel flex={'0 0 80px'} mb={1}>
|
||||
{t('support.wallet.usage.Bill Module')}
|
||||
{t('common:support.wallet.usage.Bill Module')}
|
||||
</FormLabel>
|
||||
<TableContainer fontSize={'sm'}>
|
||||
<Table>
|
||||
<Thead>
|
||||
<Tr>
|
||||
<Th>{t('support.wallet.usage.Module name')}</Th>
|
||||
{hasModel && <Th>{t('support.wallet.usage.Ai model')}</Th>}
|
||||
{hasToken && <Th>{t('support.wallet.usage.Token Length')}</Th>}
|
||||
{hasCharsLen && <Th>{t('support.wallet.usage.Text Length')}</Th>}
|
||||
{hasDuration && <Th>{t('support.wallet.usage.Duration')}</Th>}
|
||||
<Th>{t('support.wallet.usage.Total points')}</Th>
|
||||
<Th>{t('common:support.wallet.usage.Module name')}</Th>
|
||||
{hasModel && <Th>{t('common:support.wallet.usage.Ai model')}</Th>}
|
||||
{hasToken && <Th>{t('common:support.wallet.usage.Token Length')}</Th>}
|
||||
{hasCharsLen && <Th>{t('common:support.wallet.usage.Text Length')}</Th>}
|
||||
{hasDuration && <Th>{t('common:support.wallet.usage.Duration')}</Th>}
|
||||
<Th>{t('common:support.wallet.usage.Total points')}</Th>
|
||||
</Tr>
|
||||
</Thead>
|
||||
<Tbody>
|
||||
|
||||
@@ -49,7 +49,7 @@ const UsageTable = () => {
|
||||
const sourceList = useMemo(
|
||||
() =>
|
||||
[
|
||||
{ label: t('common.All'), value: '' },
|
||||
{ label: t('common:common.All'), value: '' },
|
||||
...Object.entries(UsageSourceMap).map(([key, value]) => ({
|
||||
label: t(value.label),
|
||||
value: key
|
||||
@@ -113,7 +113,7 @@ const UsageTable = () => {
|
||||
{tmbList.length > 1 && userInfo?.team?.permission.hasWritePer && (
|
||||
<Flex alignItems={'center'}>
|
||||
<Box mr={2} flexShrink={0}>
|
||||
{t('support.user.team.member')}
|
||||
{t('common:support.user.team.member')}
|
||||
</Box>
|
||||
<MySelect
|
||||
size={'sm'}
|
||||
@@ -146,8 +146,8 @@ const UsageTable = () => {
|
||||
<Table>
|
||||
<Thead>
|
||||
<Tr>
|
||||
{/* <Th>{t('user.team.Member Name')}</Th> */}
|
||||
<Th>{t('user.Time')}</Th>
|
||||
{/* <Th>{t('common:user.team.Member Name')}</Th> */}
|
||||
<Th>{t('common:user.Time')}</Th>
|
||||
<Th>
|
||||
<MySelect<UsageSourceEnum | ''>
|
||||
list={sourceList}
|
||||
@@ -159,8 +159,8 @@ const UsageTable = () => {
|
||||
w={'130px'}
|
||||
></MySelect>
|
||||
</Th>
|
||||
<Th>{t('user.Application Name')}</Th>
|
||||
<Th>{t('support.wallet.usage.Total points')}</Th>
|
||||
<Th>{t('common:user.Application Name')}</Th>
|
||||
<Th>{t('common:support.wallet.usage.Total points')}</Th>
|
||||
<Th></Th>
|
||||
</Tr>
|
||||
</Thead>
|
||||
|
||||
@@ -32,7 +32,7 @@ const StandDetailModal = ({ onClose }: { onClose: () => void }) => {
|
||||
isOpen
|
||||
maxW={['90vw', '1200px']}
|
||||
iconSrc="modal/teamPlans"
|
||||
title={t('support.wallet.Standard Plan Detail')}
|
||||
title={t('common:support.wallet.Standard Plan Detail')}
|
||||
>
|
||||
<ModalCloseButton onClick={onClose} />
|
||||
<ModalBody>
|
||||
@@ -40,11 +40,11 @@ const StandDetailModal = ({ onClose }: { onClose: () => void }) => {
|
||||
<Table>
|
||||
<Thead>
|
||||
<Tr>
|
||||
<Th>{t('support.standard.type')}</Th>
|
||||
<Th>{t('support.standard.storage')}</Th>
|
||||
<Th>{t('support.standard.AI Bonus Points')}</Th>
|
||||
<Th>{t('support.standard.Start Time')}</Th>
|
||||
<Th>{t('support.standard.Expired Time')}</Th>
|
||||
<Th>{t('common:support.standard.type')}</Th>
|
||||
<Th>{t('common:support.standard.storage')}</Th>
|
||||
<Th>{t('common:support.standard.AI Bonus Points')}</Th>
|
||||
<Th>{t('common:support.standard.Start Time')}</Th>
|
||||
<Th>{t('common:support.standard.Expired Time')}</Th>
|
||||
</Tr>
|
||||
</Thead>
|
||||
<Tbody fontSize={'sm'}>
|
||||
|
||||
@@ -41,14 +41,14 @@ const Account = ({ currentTab }: { currentTab: TabEnum }) => {
|
||||
const tabList = [
|
||||
{
|
||||
icon: 'support/user/userLight',
|
||||
label: t('user.Personal Information'),
|
||||
label: t('common:user.Personal Information'),
|
||||
value: TabEnum.info
|
||||
},
|
||||
...(feConfigs?.isPlus
|
||||
? [
|
||||
{
|
||||
icon: 'support/usage/usageRecordLight',
|
||||
label: t('user.Usage Record'),
|
||||
label: t('common:user.Usage Record'),
|
||||
value: TabEnum.usage
|
||||
}
|
||||
]
|
||||
@@ -57,7 +57,7 @@ const Account = ({ currentTab }: { currentTab: TabEnum }) => {
|
||||
? [
|
||||
{
|
||||
icon: 'support/bill/payRecordLight',
|
||||
label: t('support.wallet.Bills'),
|
||||
label: t('common:support.wallet.Bills'),
|
||||
value: TabEnum.bill
|
||||
}
|
||||
]
|
||||
@@ -67,7 +67,7 @@ const Account = ({ currentTab }: { currentTab: TabEnum }) => {
|
||||
? [
|
||||
{
|
||||
icon: 'support/account/promotionLight',
|
||||
label: t('user.Promotion Record'),
|
||||
label: t('common:user.Promotion Record'),
|
||||
value: TabEnum.promotion
|
||||
}
|
||||
]
|
||||
@@ -76,21 +76,21 @@ const Account = ({ currentTab }: { currentTab: TabEnum }) => {
|
||||
? [
|
||||
{
|
||||
icon: 'support/outlink/apikeyLight',
|
||||
label: t('user.apikey.key'),
|
||||
label: t('common:user.apikey.key'),
|
||||
value: TabEnum.apikey
|
||||
}
|
||||
]
|
||||
: []),
|
||||
{
|
||||
icon: 'support/user/individuation',
|
||||
label: t('support.account.Individuation'),
|
||||
label: t('common:support.account.Individuation'),
|
||||
value: TabEnum.individuation
|
||||
},
|
||||
...(feConfigs.isPlus
|
||||
? [
|
||||
{
|
||||
icon: 'support/user/informLight',
|
||||
label: t('user.Notice'),
|
||||
label: t('common:user.Notice'),
|
||||
value: TabEnum.inform
|
||||
}
|
||||
]
|
||||
@@ -98,7 +98,7 @@ const Account = ({ currentTab }: { currentTab: TabEnum }) => {
|
||||
|
||||
{
|
||||
icon: 'support/account/loginoutLight',
|
||||
label: t('user.Sign Out'),
|
||||
label: t('common:user.Sign Out'),
|
||||
value: TabEnum.loginout
|
||||
}
|
||||
];
|
||||
|
||||
@@ -75,19 +75,19 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
|
||||
{
|
||||
onSuccess() {
|
||||
toast({
|
||||
title: t('common.Update Success'),
|
||||
title: t('common:common.Update Success'),
|
||||
status: 'success'
|
||||
});
|
||||
reloadApp();
|
||||
},
|
||||
errorToast: t('common.Update Failed')
|
||||
errorToast: t('common:common.Update Failed')
|
||||
}
|
||||
);
|
||||
|
||||
const saveSubmitError = useCallback(() => {
|
||||
// deep search message
|
||||
const deepSearch = (obj: any): string => {
|
||||
if (!obj) return t('common.Submit failed');
|
||||
if (!obj) return t('common:common.Submit failed');
|
||||
if (!!obj.message) {
|
||||
return obj.message;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
|
||||
setValue('avatar', src);
|
||||
} catch (err: any) {
|
||||
toast({
|
||||
title: getErrText(err, t('common.error.Select avatar failed')),
|
||||
title: getErrText(err, t('common:common.error.Select avatar failed')),
|
||||
status: 'warning'
|
||||
});
|
||||
}
|
||||
@@ -158,10 +158,10 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
|
||||
isOpen={true}
|
||||
onClose={onClose}
|
||||
iconSrc="/imgs/workflow/ai.svg"
|
||||
title={t('core.app.setting')}
|
||||
title={t('common:core.app.setting')}
|
||||
>
|
||||
<ModalBody>
|
||||
<Box fontSize={'sm'}>{t('core.app.Name and avatar')}</Box>
|
||||
<Box fontSize={'sm'}>{t('common:core.app.Name and avatar')}</Box>
|
||||
<Flex mt={2} alignItems={'center'}>
|
||||
<Avatar
|
||||
src={avatar}
|
||||
@@ -170,13 +170,13 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
|
||||
cursor={'pointer'}
|
||||
borderRadius={'md'}
|
||||
mr={4}
|
||||
title={t('common.Set Avatar')}
|
||||
title={t('common:common.Set Avatar')}
|
||||
onClick={() => onOpenSelectFile()}
|
||||
/>
|
||||
<FormControl>
|
||||
<Input
|
||||
bg={'myWhite.600'}
|
||||
placeholder={t('core.app.Set a name for your app')}
|
||||
placeholder={t('common:core.app.Set a name for your app')}
|
||||
{...register('name', {
|
||||
required: true
|
||||
})}
|
||||
@@ -184,12 +184,12 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
|
||||
</FormControl>
|
||||
</Flex>
|
||||
<Box mt={4} mb={1} fontSize={'sm'}>
|
||||
{t('core.app.App intro')}
|
||||
{t('common:core.app.App intro')}
|
||||
</Box>
|
||||
<Textarea
|
||||
rows={4}
|
||||
maxLength={500}
|
||||
placeholder={t('core.app.Make a brief introduction of your app')}
|
||||
placeholder={t('common:core.app.Make a brief introduction of your app')}
|
||||
bg={'myWhite.600'}
|
||||
{...register('intro')}
|
||||
/>
|
||||
@@ -203,7 +203,7 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
|
||||
</Box>
|
||||
)}
|
||||
<Box mt="4">
|
||||
<Box fontSize={'sm'}>{t('permission.Default permission')}</Box>
|
||||
<Box fontSize={'sm'}>{t('common:permission.Default permission')}</Box>
|
||||
<DefaultPermissionList
|
||||
mt="2"
|
||||
per={appDetail.defaultPermission}
|
||||
@@ -244,7 +244,7 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
|
||||
leftIcon={<MyIcon w="4" name="common/settingLight" />}
|
||||
onClick={onOpenManageModal}
|
||||
>
|
||||
{t('permission.Manage')}
|
||||
{t('common:permission.Manage')}
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
@@ -252,7 +252,7 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
|
||||
leftIcon={<MyIcon w="4" name="support/permission/collaborator" />}
|
||||
onClick={onOpenAddMember}
|
||||
>
|
||||
{t('common.Add')}
|
||||
{t('common:common.Add')}
|
||||
</Button>
|
||||
</Flex>
|
||||
</Flex>
|
||||
@@ -268,10 +268,10 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
|
||||
|
||||
<ModalFooter>
|
||||
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
|
||||
{t('common.Close')}
|
||||
{t('common:common.Close')}
|
||||
</Button>
|
||||
<Button isLoading={btnLoading} onClick={saveUpdateModel}>
|
||||
{t('common.Save')}
|
||||
{t('common:common.Save')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
|
||||
|
||||
@@ -97,10 +97,10 @@ const DetailLogsModal = ({
|
||||
>
|
||||
<LightRowTabs<PluginRunBoxTabEnum>
|
||||
list={[
|
||||
{ label: t('common.Input'), value: PluginRunBoxTabEnum.input },
|
||||
{ label: t('common:common.Input'), value: PluginRunBoxTabEnum.input },
|
||||
...(chatRecords.length > 0
|
||||
? [
|
||||
{ label: t('common.Output'), value: PluginRunBoxTabEnum.output },
|
||||
{ label: t('common:common.Output'), value: PluginRunBoxTabEnum.output },
|
||||
{ label: '完整结果', value: PluginRunBoxTabEnum.detail }
|
||||
]
|
||||
: [])
|
||||
|
||||
@@ -87,7 +87,7 @@ const Logs = () => {
|
||||
cursor={'pointer'}
|
||||
onClick={onOpenMarkDesc}
|
||||
>
|
||||
{t('core.chat.Read Mark Description')}
|
||||
{t('common:core.chat.Read Mark Description')}
|
||||
</Box>
|
||||
</Box>
|
||||
</>
|
||||
@@ -108,11 +108,11 @@ const Logs = () => {
|
||||
<Table variant={'simple'} fontSize={'sm'}>
|
||||
<Thead>
|
||||
<Tr>
|
||||
<Th>{t('core.app.logs.Source And Time')}</Th>
|
||||
<Th>{t('common:core.app.logs.Source And Time')}</Th>
|
||||
<Th>{appT('Logs Title')}</Th>
|
||||
<Th>{appT('Logs Message Total')}</Th>
|
||||
<Th>{appT('Feedback Count')}</Th>
|
||||
<Th>{t('core.app.feedback.Custom feedback')}</Th>
|
||||
<Th>{t('common:core.app.feedback.Custom feedback')}</Th>
|
||||
<Th>{appT('Mark Count')}</Th>
|
||||
</Tr>
|
||||
</Thead>
|
||||
@@ -210,9 +210,9 @@ const Logs = () => {
|
||||
<MyModal
|
||||
isOpen={isOpenMarkDesc}
|
||||
onClose={onCloseMarkDesc}
|
||||
title={t('core.chat.Mark Description Title')}
|
||||
title={t('common:core.chat.Mark Description Title')}
|
||||
>
|
||||
<ModalBody whiteSpace={'pre-wrap'}>{t('core.chat.Mark Description')}</ModalBody>
|
||||
<ModalBody whiteSpace={'pre-wrap'}>{t('common:core.chat.Mark Description')}</ModalBody>
|
||||
</MyModal>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -57,7 +57,7 @@ const Header = () => {
|
||||
// effect
|
||||
useBeforeunload({
|
||||
callback: onSaveWorkflow,
|
||||
tip: t('core.common.tip.leave page')
|
||||
tip: t('common:core.common.tip.leave page')
|
||||
});
|
||||
useInterval(() => {
|
||||
if (!appDetail._id) return;
|
||||
@@ -145,20 +145,20 @@ const Header = () => {
|
||||
}
|
||||
}}
|
||||
>
|
||||
{t('core.workflow.Debug')}
|
||||
{t('common:core.workflow.Debug')}
|
||||
</Button>
|
||||
|
||||
{!historiesDefaultData && (
|
||||
<PopoverConfirm
|
||||
showCancel
|
||||
content={t('core.app.Publish Confirm')}
|
||||
content={t('common:core.app.Publish Confirm')}
|
||||
Trigger={
|
||||
<Button
|
||||
ml={[2, 4]}
|
||||
size={'sm'}
|
||||
leftIcon={<MyIcon name={'common/publishFill'} w={['14px', '16px']} />}
|
||||
>
|
||||
{t('core.app.Publish')}
|
||||
{t('common:core.app.Publish')}
|
||||
</Button>
|
||||
}
|
||||
onConfirm={() => onclickPublish()}
|
||||
|
||||
@@ -45,14 +45,14 @@ const FeiShuEditModal = ({
|
||||
type: PublishChannelEnum.feishu
|
||||
});
|
||||
},
|
||||
errorToast: t('common.Create Failed'),
|
||||
errorToast: t('common:common.Create Failed'),
|
||||
onSuccess: onCreate
|
||||
});
|
||||
const { mutate: onclickUpdate, isLoading: updating } = useRequest({
|
||||
mutationFn: (e: OutLinkEditType<FeishuType>) => {
|
||||
return updateShareChat(e);
|
||||
},
|
||||
errorToast: t('common.Update Failed'),
|
||||
errorToast: t('common:common.Update Failed'),
|
||||
onSuccess: onEdit
|
||||
});
|
||||
|
||||
@@ -64,12 +64,12 @@ const FeiShuEditModal = ({
|
||||
>
|
||||
<ModalBody>
|
||||
<Flex alignItems={'center'}>
|
||||
<Box flex={'0 0 90px'}>{t('Name')}</Box>
|
||||
<Box flex={'0 0 90px'}>{t('common:Name')}</Box>
|
||||
<Input
|
||||
placeholder={publishT('Feishu name') || 'Link Name'} // TODO: i18n
|
||||
maxLength={20}
|
||||
{...register('name', {
|
||||
required: t('common.Name is empty') || 'Name is empty'
|
||||
required: t('common:common.Name is empty') || 'Name is empty'
|
||||
})}
|
||||
/>
|
||||
</Flex>
|
||||
@@ -90,8 +90,11 @@ const FeiShuEditModal = ({
|
||||
</Flex>
|
||||
<Flex alignItems={'center'} mt={4}>
|
||||
<Flex flex={'0 0 90px'} alignItems={'center'}>
|
||||
{t('support.outlink.Max usage points')}
|
||||
<QuestionTip ml={1} label={t('support.outlink.Max usage points tip')}></QuestionTip>
|
||||
{t('common:support.outlink.Max usage points')}
|
||||
<QuestionTip
|
||||
ml={1}
|
||||
label={t('common:support.outlink.Max usage points tip')}
|
||||
></QuestionTip>
|
||||
</Flex>
|
||||
<Input
|
||||
{...register('limit.maxUsagePoints', {
|
||||
@@ -104,7 +107,7 @@ const FeiShuEditModal = ({
|
||||
</Flex>
|
||||
<Flex alignItems={'center'} mt={4}>
|
||||
<Flex flex={'0 0 90px'} alignItems={'center'}>
|
||||
{t('common.Expired Time')}
|
||||
{t('common:common.Expired Time')}
|
||||
</Flex>
|
||||
<Input
|
||||
type="datetime-local"
|
||||
@@ -145,9 +148,9 @@ const FeiShuEditModal = ({
|
||||
/>
|
||||
</Flex>
|
||||
<Flex alignItems={'center'} mt={4}>
|
||||
<Box flex={'0 0 90px'}>{t('core.module.http.AppId')}</Box>
|
||||
<Box flex={'0 0 90px'}>{t('common:core.module.http.AppId')}</Box>
|
||||
<Input
|
||||
placeholder={t('core.module.http.appId') || 'Link Name'}
|
||||
placeholder={t('common:core.module.http.appId') || 'Link Name'}
|
||||
// maxLength={20}
|
||||
{...register('app.appId', {
|
||||
required: true
|
||||
@@ -155,12 +158,12 @@ const FeiShuEditModal = ({
|
||||
/>
|
||||
</Flex>
|
||||
<Flex alignItems={'center'} mt={4}>
|
||||
<Box flex={'0 0 90px'}>{t('core.module.http.AppSecret')}</Box>
|
||||
<Box flex={'0 0 90px'}>{t('common:core.module.http.AppSecret')}</Box>
|
||||
<Input
|
||||
placeholder={'App Secret'}
|
||||
// maxLength={20}
|
||||
{...register('app.appSecret', {
|
||||
required: t('common.Name is empty') || 'Name is empty'
|
||||
required: t('common:common.Name is empty') || 'Name is empty'
|
||||
})}
|
||||
/>
|
||||
</Flex>
|
||||
@@ -170,7 +173,7 @@ const FeiShuEditModal = ({
|
||||
placeholder="Encrypt Key"
|
||||
// maxLength={20}
|
||||
{...register('app.encryptKey', {
|
||||
required: t('common.Name is empty') || 'Name is empty'
|
||||
required: t('common:common.Name is empty') || 'Name is empty'
|
||||
})}
|
||||
/>
|
||||
</Flex>
|
||||
@@ -180,7 +183,7 @@ const FeiShuEditModal = ({
|
||||
placeholder="Verification Token"
|
||||
// maxLength={20}
|
||||
{...register('app.verificationToken', {
|
||||
required: t('common.Name is empty') || 'Name is empty'
|
||||
required: t('common:common.Name is empty') || 'Name is empty'
|
||||
})}
|
||||
/>
|
||||
</Flex>
|
||||
@@ -193,13 +196,13 @@ const FeiShuEditModal = ({
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
|
||||
{t('common.Close')}
|
||||
{t('common:common.Close')}
|
||||
</Button>
|
||||
<Button
|
||||
isLoading={creating || updating}
|
||||
onClick={submitShareChat((data) => (isEdit ? onclickUpdate(data) : onclickCreate(data)))}
|
||||
>
|
||||
{t('common.Confirm')}
|
||||
{t('common:common.Confirm')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
|
||||
@@ -49,7 +49,7 @@ const FeiShu = ({ appId }: { appId: string }) => {
|
||||
<Box position={'relative'} pt={3} px={5} minH={'50vh'}>
|
||||
<Flex justifyContent={'space-between'}>
|
||||
<Box fontWeight={'bold'} fontSize={['md', 'lg']}>
|
||||
{t('core.app.publish.Fei shu bot publish')}
|
||||
{t('common:core.app.publish.Fei shu bot publish')}
|
||||
</Box>
|
||||
<Button
|
||||
variant={'whitePrimary'}
|
||||
@@ -58,27 +58,27 @@ const FeiShu = ({ appId }: { appId: string }) => {
|
||||
{...(shareChatList.length >= 10
|
||||
? {
|
||||
isDisabled: true,
|
||||
title: t('core.app.share.Amount limit tip')
|
||||
title: t('common:core.app.share.Amount limit tip')
|
||||
}
|
||||
: {})}
|
||||
onClick={() => setEditFeiShuLinkData(defaultFeishuOutLinkForm)}
|
||||
>
|
||||
{t('core.app.share.Create link')}
|
||||
{t('common:core.app.share.Create link')}
|
||||
</Button>
|
||||
</Flex>
|
||||
<TableContainer mt={3}>
|
||||
<Table variant={'simple'} w={'100%'} overflowX={'auto'} fontSize={'sm'}>
|
||||
<Thead>
|
||||
<Tr>
|
||||
<Th>{t('common.Name')}</Th>
|
||||
<Th>{t('support.outlink.Usage points')}</Th>
|
||||
<Th>{t('common:common.Name')}</Th>
|
||||
<Th>{t('common:support.outlink.Usage points')}</Th>
|
||||
{feConfigs?.isPlus && (
|
||||
<>
|
||||
<Th>{t('core.app.share.Ip limit title')}</Th>
|
||||
<Th>{t('common.Expired Time')}</Th>
|
||||
<Th>{t('common:core.app.share.Ip limit title')}</Th>
|
||||
<Th>{t('common:common.Expired Time')}</Th>
|
||||
</>
|
||||
)}
|
||||
<Th>{t('common.Last use time')}</Th>
|
||||
<Th>{t('common:common.Last use time')}</Th>
|
||||
<Th></Th>
|
||||
</Tr>
|
||||
</Thead>
|
||||
@@ -92,7 +92,7 @@ const FeiShu = ({ appId }: { appId: string }) => {
|
||||
? `${
|
||||
item.limit?.maxUsagePoints && item.limit.maxUsagePoints > -1
|
||||
? ` / ${item.limit.maxUsagePoints}`
|
||||
: ` / ${t('common.Unlimited')}`
|
||||
: ` / ${t('common:common.Unlimited')}`
|
||||
}`
|
||||
: ''}
|
||||
</Td>
|
||||
@@ -107,7 +107,9 @@ const FeiShu = ({ appId }: { appId: string }) => {
|
||||
</>
|
||||
)}
|
||||
<Td>
|
||||
{item.lastTime ? t(formatTimeToChatTime(item.lastTime)) : t('common.Un used')}
|
||||
{item.lastTime
|
||||
? t(formatTimeToChatTime(item.lastTime))
|
||||
: t('common:common.Un used')}
|
||||
</Td>
|
||||
<Td display={'flex'} alignItems={'center'}>
|
||||
<MyMenu
|
||||
@@ -125,7 +127,7 @@ const FeiShu = ({ appId }: { appId: string }) => {
|
||||
{
|
||||
children: [
|
||||
{
|
||||
label: t('common.Edit'),
|
||||
label: t('common:common.Edit'),
|
||||
icon: 'edit',
|
||||
onClick: () =>
|
||||
setEditFeiShuLinkData({
|
||||
@@ -139,7 +141,7 @@ const FeiShu = ({ appId }: { appId: string }) => {
|
||||
})
|
||||
},
|
||||
{
|
||||
label: t('common.Delete'),
|
||||
label: t('common:common.Delete'),
|
||||
icon: 'delete',
|
||||
onClick: async () => {
|
||||
setIsLoading(true);
|
||||
@@ -174,7 +176,7 @@ const FeiShu = ({ appId }: { appId: string }) => {
|
||||
onEdit={() => {
|
||||
toast({
|
||||
status: 'success',
|
||||
title: t('common.Update Successful')
|
||||
title: t('common:common.Update Successful')
|
||||
});
|
||||
refetchShareChatList();
|
||||
setEditFeiShuLinkData(undefined);
|
||||
@@ -183,7 +185,7 @@ const FeiShu = ({ appId }: { appId: string }) => {
|
||||
/>
|
||||
)}
|
||||
{shareChatList.length === 0 && !isFetching && (
|
||||
<EmptyTip text={t('core.app.share.Not share link')}></EmptyTip>
|
||||
<EmptyTip text={t('common:core.app.share.Not share link')}></EmptyTip>
|
||||
)}
|
||||
<Loading loading={isFetching} fixed={false} />
|
||||
</Box>
|
||||
|
||||
@@ -79,11 +79,11 @@ const SelectUsingWayModal = ({ share, onClose }: { share: OutLinkSchema; onClose
|
||||
|
||||
const wayMap = {
|
||||
[UsingWayEnum.link]: {
|
||||
blockTitle: t('core.app.outLink.Link block title'),
|
||||
blockTitle: t('common:core.app.outLink.Link block title'),
|
||||
code: linkUrl
|
||||
},
|
||||
[UsingWayEnum.iframe]: {
|
||||
blockTitle: t('core.app.outLink.Iframe block title'),
|
||||
blockTitle: t('common:core.app.outLink.Iframe block title'),
|
||||
code: `<iframe
|
||||
src="${linkUrl}"
|
||||
style="width: 100%; height: 100%;"
|
||||
@@ -92,7 +92,7 @@ const SelectUsingWayModal = ({ share, onClose }: { share: OutLinkSchema; onClose
|
||||
/>`
|
||||
},
|
||||
[UsingWayEnum.script]: {
|
||||
blockTitle: t('core.app.outLink.Script block title'),
|
||||
blockTitle: t('common:core.app.outLink.Script block title'),
|
||||
code: `<script
|
||||
src="${baseUrl}/js/iframe.js"
|
||||
id="chatbot-iframe"
|
||||
@@ -121,7 +121,7 @@ console.log("Chat box loaded")
|
||||
<MyModal
|
||||
isOpen
|
||||
iconSrc="/imgs/modal/usingWay.svg"
|
||||
title={t('core.app.outLink.Select Using Way')}
|
||||
title={t('common:core.app.outLink.Select Using Way')}
|
||||
onClose={onClose}
|
||||
maxW={['90vw', '700px']}
|
||||
>
|
||||
@@ -146,21 +146,21 @@ console.log("Chat box loaded")
|
||||
fontSize={'sm'}
|
||||
>
|
||||
<Flex {...gridItemStyle}>
|
||||
<Box flex={1}>{t('core.app.outLink.Show History')}</Box>
|
||||
<Box flex={1}>{t('common:core.app.outLink.Show History')}</Box>
|
||||
<Switch {...register('showHistory')} />
|
||||
</Flex>
|
||||
{getValues('usingWay') === UsingWayEnum.script && (
|
||||
<>
|
||||
<Flex {...gridItemStyle}>
|
||||
<Box flex={1}>{t('core.app.outLink.Can Drag')}</Box>
|
||||
<Box flex={1}>{t('common:core.app.outLink.Can Drag')}</Box>
|
||||
<Switch {...register('scriptIconCanDrag')} />
|
||||
</Flex>
|
||||
<Flex {...gridItemStyle}>
|
||||
<Box flex={1}>{t('core.app.outLink.Default open')}</Box>
|
||||
<Box flex={1}>{t('common:core.app.outLink.Default open')}</Box>
|
||||
<Switch {...register('scriptDefaultOpen')} />
|
||||
</Flex>
|
||||
<Flex {...gridItemStyle}>
|
||||
<Box flex={1}>{t('core.app.outLink.Script Open Icon')}</Box>
|
||||
<Box flex={1}>{t('common:core.app.outLink.Script Open Icon')}</Box>
|
||||
<Image
|
||||
src={getValues('scriptOpenIcon')}
|
||||
alt={''}
|
||||
@@ -171,7 +171,7 @@ console.log("Chat box loaded")
|
||||
/>
|
||||
</Flex>
|
||||
<Flex {...gridItemStyle}>
|
||||
<Box flex={1}>{t('core.app.outLink.Script Close Icon')}</Box>
|
||||
<Box flex={1}>{t('common:core.app.outLink.Script Close Icon')}</Box>
|
||||
<Image
|
||||
src={getValues('scriptCloseIcon')}
|
||||
alt={''}
|
||||
|
||||
@@ -60,7 +60,7 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => {
|
||||
const [selectedLinkData, setSelectedLinkData] = useState<OutLinkSchema>();
|
||||
const { toast } = useToast();
|
||||
const { ConfirmModal, openConfirm } = useConfirm({
|
||||
content: t('support.outlink.Delete link tip'),
|
||||
content: t('common:support.outlink.Delete link tip'),
|
||||
type: 'delete'
|
||||
});
|
||||
|
||||
@@ -77,9 +77,9 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => {
|
||||
<Flex justifyContent={'space-between'}>
|
||||
<HStack>
|
||||
<Box color={'myGray.900'} fontSize={'lg'}>
|
||||
{t('core.app.Share link')}
|
||||
{t('common:core.app.Share link')}
|
||||
</Box>
|
||||
<QuestionTip label={t('core.app.Share link desc detail')} />
|
||||
<QuestionTip label={t('common:core.app.Share link desc detail')} />
|
||||
</HStack>
|
||||
<Button
|
||||
variant={'whitePrimary'}
|
||||
@@ -88,33 +88,33 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => {
|
||||
{...(shareChatList.length >= 10
|
||||
? {
|
||||
isDisabled: true,
|
||||
title: t('core.app.share.Amount limit tip')
|
||||
title: t('common:core.app.share.Amount limit tip')
|
||||
}
|
||||
: {})}
|
||||
onClick={() => setEditLinkData(defaultOutLinkForm)}
|
||||
>
|
||||
{t('core.app.share.Create link')}
|
||||
{t('common:core.app.share.Create link')}
|
||||
</Button>
|
||||
</Flex>
|
||||
<TableContainer mt={3}>
|
||||
<Table variant={'simple'} w={'100%'} overflowX={'auto'} fontSize={'sm'}>
|
||||
<Thead>
|
||||
<Tr>
|
||||
<Th>{t('common.Name')}</Th>
|
||||
<Th>{t('common:common.Name')}</Th>
|
||||
{feConfigs?.isPlus && (
|
||||
<>
|
||||
<Th>{t('common.Expired Time')}</Th>
|
||||
<Th>{t('common:common.Expired Time')}</Th>
|
||||
</>
|
||||
)}
|
||||
<Th>{t('support.outlink.Usage points')}</Th>
|
||||
<Th>{t('core.app.share.Is response quote')}</Th>
|
||||
<Th>{t('common:support.outlink.Usage points')}</Th>
|
||||
<Th>{t('common:core.app.share.Is response quote')}</Th>
|
||||
{feConfigs?.isPlus && (
|
||||
<>
|
||||
<Th>{t('core.app.share.Ip limit title')}</Th>
|
||||
<Th>{t('core.app.share.Role check')}</Th>
|
||||
<Th>{t('common:core.app.share.Ip limit title')}</Th>
|
||||
<Th>{t('common:core.app.share.Role check')}</Th>
|
||||
</>
|
||||
)}
|
||||
<Th>{t('common.Last use time')}</Th>
|
||||
<Th>{t('common:common.Last use time')}</Th>
|
||||
<Th></Th>
|
||||
</Tr>
|
||||
</Thead>
|
||||
@@ -137,7 +137,7 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => {
|
||||
? `${
|
||||
item.limit?.maxUsagePoints && item.limit.maxUsagePoints > -1
|
||||
? ` / ${item.limit.maxUsagePoints}`
|
||||
: ` / ${t('common.Unlimited')}`
|
||||
: ` / ${t('common:common.Unlimited')}`
|
||||
}`
|
||||
: ''}
|
||||
</Td>
|
||||
@@ -149,7 +149,9 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => {
|
||||
<Th>{item?.limit?.hookUrl ? '✔' : '✖'}</Th>
|
||||
</>
|
||||
)}
|
||||
<Td>{item.lastTime ? formatTimeToChatTime(item.lastTime) : t('common.Un used')}</Td>
|
||||
<Td>
|
||||
{item.lastTime ? formatTimeToChatTime(item.lastTime) : t('common:common.Un used')}
|
||||
</Td>
|
||||
<Td display={'flex'} alignItems={'center'}>
|
||||
<Button
|
||||
onClick={() => setSelectedLinkData(item as OutLinkSchema)}
|
||||
@@ -157,7 +159,7 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => {
|
||||
mr={3}
|
||||
variant={'whitePrimary'}
|
||||
>
|
||||
{t('core.app.outLink.Select Mode')}
|
||||
{t('common:core.app.outLink.Select Mode')}
|
||||
</Button>
|
||||
<MyMenu
|
||||
Button={
|
||||
@@ -173,7 +175,7 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => {
|
||||
{
|
||||
children: [
|
||||
{
|
||||
label: t('common.Edit'),
|
||||
label: t('common:common.Edit'),
|
||||
icon: 'edit',
|
||||
onClick: () =>
|
||||
setEditLinkData({
|
||||
@@ -184,7 +186,7 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => {
|
||||
})
|
||||
},
|
||||
{
|
||||
label: t('common.Delete'),
|
||||
label: t('common:common.Delete'),
|
||||
icon: 'delete',
|
||||
type: 'danger',
|
||||
onClick: () =>
|
||||
@@ -211,7 +213,7 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => {
|
||||
</TableContainer>
|
||||
|
||||
{shareChatList.length === 0 && !isFetching && (
|
||||
<EmptyTip text={t('core.app.share.Not share link')} />
|
||||
<EmptyTip text={t('common:core.app.share.Not share link')} />
|
||||
)}
|
||||
{!!editLinkData && (
|
||||
<EditLinkModal
|
||||
@@ -220,14 +222,14 @@ const Share = ({ appId }: { appId: string; type: PublishChannelEnum }) => {
|
||||
defaultData={editLinkData}
|
||||
onCreate={(id) => {
|
||||
const url = `${location.origin}/chat/share?shareId=${id}`;
|
||||
copyData(url, t('core.app.share.Create link tip'));
|
||||
copyData(url, t('common:core.app.share.Create link tip'));
|
||||
refetchShareChatList();
|
||||
setEditLinkData(undefined);
|
||||
}}
|
||||
onEdit={() => {
|
||||
toast({
|
||||
status: 'success',
|
||||
title: t('common.Update Successful')
|
||||
title: t('common:common.Update Successful')
|
||||
});
|
||||
refetchShareChatList();
|
||||
setEditLinkData(undefined);
|
||||
@@ -282,14 +284,14 @@ function EditLinkModal({
|
||||
appId,
|
||||
type
|
||||
}),
|
||||
errorToast: t('common.Create Failed'),
|
||||
errorToast: t('common:common.Create Failed'),
|
||||
onSuccess: onCreate
|
||||
});
|
||||
const { mutate: onclickUpdate, isLoading: updating } = useRequest({
|
||||
mutationFn: (e: OutLinkEditType) => {
|
||||
return putShareChat(e);
|
||||
},
|
||||
errorToast: t('common.Update Failed'),
|
||||
errorToast: t('common:common.Update Failed'),
|
||||
onSuccess: onEdit
|
||||
});
|
||||
|
||||
@@ -301,12 +303,12 @@ function EditLinkModal({
|
||||
>
|
||||
<ModalBody>
|
||||
<Flex alignItems={'center'}>
|
||||
<FormLabel flex={'0 0 90px'}>{t('Name')}</FormLabel>
|
||||
<FormLabel flex={'0 0 90px'}>{t('common:Name')}</FormLabel>
|
||||
<Input
|
||||
placeholder={publishT('Link Name')}
|
||||
maxLength={20}
|
||||
{...register('name', {
|
||||
required: t('common.Name is empty') || 'Name is empty'
|
||||
required: t('common:common.Name is empty') || 'Name is empty'
|
||||
})}
|
||||
/>
|
||||
</Flex>
|
||||
@@ -314,7 +316,7 @@ function EditLinkModal({
|
||||
<>
|
||||
<Flex alignItems={'center'} mt={4}>
|
||||
<FormLabel flex={'0 0 90px'} alignItems={'center'}>
|
||||
{t('common.Expired Time')}
|
||||
{t('common:common.Expired Time')}
|
||||
</FormLabel>
|
||||
<Input
|
||||
type="datetime-local"
|
||||
@@ -345,8 +347,11 @@ function EditLinkModal({
|
||||
</Flex>
|
||||
<Flex alignItems={'center'} mt={4}>
|
||||
<Flex flex={'0 0 90px'} alignItems={'center'}>
|
||||
<FormLabel>{t('support.outlink.Max usage points')}</FormLabel>
|
||||
<QuestionTip ml={1} label={t('support.outlink.Max usage points tip')}></QuestionTip>
|
||||
<FormLabel>{t('common:support.outlink.Max usage points')}</FormLabel>
|
||||
<QuestionTip
|
||||
ml={1}
|
||||
label={t('common:support.outlink.Max usage points tip')}
|
||||
></QuestionTip>
|
||||
</Flex>
|
||||
<Input
|
||||
{...register('limit.maxUsagePoints', {
|
||||
@@ -382,7 +387,7 @@ function EditLinkModal({
|
||||
|
||||
<Flex alignItems={'center'} mt={4}>
|
||||
<Flex flex={'0 0 90px'} alignItems={'center'}>
|
||||
<FormLabel>{t('support.outlink.share.Response Quote')}</FormLabel>
|
||||
<FormLabel>{t('common:support.outlink.share.Response Quote')}</FormLabel>
|
||||
<QuestionTip
|
||||
ml={1}
|
||||
label={t('support.outlink.share.Response Quote tips' || '')}
|
||||
@@ -394,13 +399,13 @@ function EditLinkModal({
|
||||
|
||||
<ModalFooter>
|
||||
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
|
||||
{t('common.Close')}
|
||||
{t('common:common.Close')}
|
||||
</Button>
|
||||
<Button
|
||||
isLoading={creating || updating}
|
||||
onClick={submitShareChat((data) => (isEdit ? onclickUpdate(data) : onclickCreate(data)))}
|
||||
>
|
||||
{t('common.Confirm')}
|
||||
{t('common:common.Confirm')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
|
||||
@@ -24,20 +24,20 @@ const OutLink = () => {
|
||||
const publishList = useRef([
|
||||
{
|
||||
icon: '/imgs/modal/shareFill.svg',
|
||||
title: t('core.app.Share link'),
|
||||
desc: t('core.app.Share link desc'),
|
||||
title: t('common:core.app.Share link'),
|
||||
desc: t('common:core.app.Share link desc'),
|
||||
value: PublishChannelEnum.share
|
||||
},
|
||||
{
|
||||
icon: 'support/outlink/apikeyFill',
|
||||
title: t('core.app.Api request'),
|
||||
desc: t('core.app.Api request desc'),
|
||||
title: t('common:core.app.Api request'),
|
||||
desc: t('common:core.app.Api request desc'),
|
||||
value: PublishChannelEnum.apikey
|
||||
}
|
||||
// {
|
||||
// icon: 'core/app/publish/lark',
|
||||
// title: t('core.app.publish.Fei shu bot'),
|
||||
// desc: t('core.app.publish.Fei Shu Bot Desc'),
|
||||
// title: t('common:core.app.publish.Fei shu bot'),
|
||||
// desc: t('common:core.app.publish.Fei Shu Bot Desc'),
|
||||
// value: PublishChannelEnum.feishu
|
||||
// }
|
||||
]);
|
||||
|
||||
@@ -109,7 +109,7 @@ const PublishHistoriesSlider = ({
|
||||
})
|
||||
}
|
||||
iconSrc="core/workflow/versionHistories"
|
||||
title={t('core.workflow.publish.histories')}
|
||||
title={t('common:core.workflow.publish.histories')}
|
||||
maxW={'300px'}
|
||||
px={0}
|
||||
showMask={false}
|
||||
@@ -178,11 +178,11 @@ const PublishHistoriesSlider = ({
|
||||
{item._id === selectedHistoryId && (
|
||||
<PopoverConfirm
|
||||
showCancel
|
||||
content={t('core.workflow.publish.OnRevert version confirm')}
|
||||
content={t('common:core.workflow.publish.OnRevert version confirm')}
|
||||
onConfirm={() => onRevert(item)}
|
||||
Trigger={
|
||||
<Box>
|
||||
<MyTooltip label={t('core.workflow.publish.OnRevert version')}>
|
||||
<MyTooltip label={t('common:core.workflow.publish.OnRevert version')}>
|
||||
<MyIcon
|
||||
name={'core/workflow/revertVersion'}
|
||||
w={'20px'}
|
||||
|
||||
@@ -62,7 +62,7 @@ const AppCard = () => {
|
||||
}));
|
||||
}
|
||||
},
|
||||
successToast: t('common.Success')
|
||||
successToast: t('common:common.Success')
|
||||
}
|
||||
);
|
||||
|
||||
@@ -86,7 +86,7 @@ const AppCard = () => {
|
||||
fontSize={'xs'}
|
||||
minH={'46px'}
|
||||
>
|
||||
{appDetail.intro || t('core.app.tip.Add a intro to app')}
|
||||
{appDetail.intro || t('common:core.app.tip.Add a intro to app')}
|
||||
</Box>
|
||||
<HStack alignItems={'flex-end'}>
|
||||
<Button
|
||||
@@ -95,7 +95,7 @@ const AppCard = () => {
|
||||
leftIcon={<MyIcon name={'core/chat/chatLight'} w={'16px'} />}
|
||||
onClick={() => router.push(`/chat?appId=${appId}`)}
|
||||
>
|
||||
{t('core.Chat')}
|
||||
{t('common:core.Chat')}
|
||||
</Button>
|
||||
{appDetail.permission.hasManagePer && (
|
||||
<Button
|
||||
@@ -104,7 +104,7 @@ const AppCard = () => {
|
||||
leftIcon={<MyIcon name={'common/settingLight'} w={'16px'} />}
|
||||
onClick={onOpenInfoEdit}
|
||||
>
|
||||
{t('common.Setting')}
|
||||
{t('common:common.Setting')}
|
||||
</Button>
|
||||
)}
|
||||
{appDetail.permission.isOwner && (
|
||||
@@ -129,7 +129,7 @@ const AppCard = () => {
|
||||
? [
|
||||
{
|
||||
icon: 'core/chat/fileSelect',
|
||||
label: t('common.Team Tags Set'),
|
||||
label: t('common:common.Team Tags Set'),
|
||||
onClick: () => setTeamTagsSet(appDetail)
|
||||
}
|
||||
]
|
||||
@@ -141,7 +141,7 @@ const AppCard = () => {
|
||||
{
|
||||
icon: 'delete',
|
||||
type: 'danger',
|
||||
label: t('common.Delete'),
|
||||
label: t('common:common.Delete'),
|
||||
onClick: onDelApp
|
||||
}
|
||||
]
|
||||
@@ -173,10 +173,10 @@ const AppCard = () => {
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button variant={'whiteBase'} onClick={() => setTransitionCreateNew(undefined)} mr={3}>
|
||||
{t('common.Close')}
|
||||
{t('common:common.Close')}
|
||||
</Button>
|
||||
<Button variant={'dangerFill'} isLoading={transiting} onClick={() => onTransition()}>
|
||||
{t('common.Confirm')}
|
||||
{t('common:common.Confirm')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
|
||||
@@ -38,7 +38,7 @@ const ChatTest = ({ appForm }: { appForm: AppSimpleEditFormType }) => {
|
||||
<Box fontSize={['md', 'lg']} fontWeight={'bold'} flex={1} color={'myGray.900'}>
|
||||
{appT('Chat Debug')}
|
||||
</Box>
|
||||
<MyTooltip label={t('core.chat.Restart')}>
|
||||
<MyTooltip label={t('common:core.chat.Restart')}>
|
||||
<IconButton
|
||||
className="chat"
|
||||
size={'smSquare'}
|
||||
|
||||
@@ -129,7 +129,7 @@ const EditForm = ({
|
||||
</FormLabel>
|
||||
</Flex>
|
||||
<Flex alignItems={'center'} mt={5}>
|
||||
<Box {...LabelStyles}>{t('core.ai.Model')}</Box>
|
||||
<Box {...LabelStyles}>{t('common:core.ai.Model')}</Box>
|
||||
<Box flex={'1 0 0'}>
|
||||
<SettingLLMModel
|
||||
llmModelType={'all'}
|
||||
@@ -157,8 +157,8 @@ const EditForm = ({
|
||||
|
||||
<Box mt={3}>
|
||||
<HStack {...LabelStyles}>
|
||||
<Box>{t('core.ai.Prompt')}</Box>
|
||||
<QuestionTip label={t('core.app.tip.chatNodeSystemPromptTip')} />
|
||||
<Box>{t('common:core.ai.Prompt')}</Box>
|
||||
<QuestionTip label={t('common:core.app.tip.chatNodeSystemPromptTip')} />
|
||||
</HStack>
|
||||
<Box mt={1}>
|
||||
<PromptEditor
|
||||
@@ -175,8 +175,8 @@ const EditForm = ({
|
||||
});
|
||||
}}
|
||||
variables={formatVariables}
|
||||
placeholder={t('core.app.tip.chatNodeSystemPromptTip')}
|
||||
title={t('core.ai.Prompt')}
|
||||
placeholder={t('common:core.app.tip.chatNodeSystemPromptTip')}
|
||||
title={t('common:core.ai.Prompt')}
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
@@ -187,7 +187,7 @@ const EditForm = ({
|
||||
<Flex alignItems={'center'}>
|
||||
<Flex alignItems={'center'} flex={1}>
|
||||
<MyIcon name={'core/app/simpleMode/dataset'} w={'20px'} />
|
||||
<FormLabel ml={2}>{t('core.dataset.Choose Dataset')}</FormLabel>
|
||||
<FormLabel ml={2}>{t('common:core.dataset.Choose Dataset')}</FormLabel>
|
||||
</Flex>
|
||||
<Button
|
||||
variant={'transparentBase'}
|
||||
@@ -197,7 +197,7 @@ const EditForm = ({
|
||||
fontSize={'sm'}
|
||||
onClick={onOpenKbSelect}
|
||||
>
|
||||
{t('common.Choose')}
|
||||
{t('common:common.Choose')}
|
||||
</Button>
|
||||
<Button
|
||||
variant={'transparentBase'}
|
||||
@@ -207,7 +207,7 @@ const EditForm = ({
|
||||
fontSize={'sm'}
|
||||
onClick={onOpenDatasetParams}
|
||||
>
|
||||
{t('common.Params')}
|
||||
{t('common:common.Params')}
|
||||
</Button>
|
||||
</Flex>
|
||||
{appForm.dataset.datasets?.length > 0 && (
|
||||
@@ -223,7 +223,7 @@ const EditForm = ({
|
||||
)}
|
||||
<Grid gridTemplateColumns={'repeat(2, minmax(0, 1fr))'} gridGap={[2, 4]}>
|
||||
{selectDatasets.map((item) => (
|
||||
<MyTooltip key={item._id} label={t('core.dataset.Read Dataset')}>
|
||||
<MyTooltip key={item._id} label={t('common:core.dataset.Read Dataset')}>
|
||||
<Flex
|
||||
overflow={'hidden'}
|
||||
alignItems={'center'}
|
||||
@@ -269,7 +269,7 @@ const EditForm = ({
|
||||
fontSize={'sm'}
|
||||
onClick={onOpenToolsSelect}
|
||||
>
|
||||
{t('common.Choose')}
|
||||
{t('common:common.Choose')}
|
||||
</Button>
|
||||
</Flex>
|
||||
<Grid
|
||||
|
||||
@@ -138,11 +138,11 @@ const Header = ({
|
||||
/>
|
||||
<PopoverConfirm
|
||||
showCancel
|
||||
content={t('core.app.Publish Confirm')}
|
||||
content={t('common:core.app.Publish Confirm')}
|
||||
Trigger={
|
||||
<Box>
|
||||
<MyTooltip label={t('core.app.Publish app tip')}>
|
||||
<Button isDisabled={isPublished}>{t('core.app.Publish')}</Button>
|
||||
<MyTooltip label={t('common:core.app.Publish app tip')}>
|
||||
<Button isDisabled={isPublished}>{t('common:core.app.Publish')}</Button>
|
||||
</MyTooltip>
|
||||
</Box>
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ const ToolSelectModal = ({ onClose, ...props }: Props & { onClose: () => void })
|
||||
manual: false,
|
||||
throttleWait: 300,
|
||||
refreshDeps: [templateType, searchKey, parentId],
|
||||
errorToast: t('core.module.templates.Load plugin error')
|
||||
errorToast: t('common:core.module.templates.Load plugin error')
|
||||
}
|
||||
);
|
||||
|
||||
@@ -90,7 +90,7 @@ const ToolSelectModal = ({ onClose, ...props }: Props & { onClose: () => void })
|
||||
return (
|
||||
<MyModal
|
||||
isOpen
|
||||
title={t('core.app.Tool call')}
|
||||
title={t('common:core.app.Tool call')}
|
||||
iconSrc="core/app/toolCall"
|
||||
onClose={onClose}
|
||||
maxW={['90vw', '700px']}
|
||||
@@ -103,12 +103,12 @@ const ToolSelectModal = ({ onClose, ...props }: Props & { onClose: () => void })
|
||||
list={[
|
||||
{
|
||||
icon: 'core/modules/teamPlugin',
|
||||
label: t('core.app.ToolCall.Team'),
|
||||
label: t('common:core.app.ToolCall.Team'),
|
||||
value: TemplateTypeEnum.teamPlugin
|
||||
},
|
||||
{
|
||||
icon: 'core/modules/systemPlugin',
|
||||
label: t('core.app.ToolCall.System'),
|
||||
label: t('common:core.app.ToolCall.System'),
|
||||
value: TemplateTypeEnum.systemPlugin
|
||||
}
|
||||
]}
|
||||
@@ -123,7 +123,7 @@ const ToolSelectModal = ({ onClose, ...props }: Props & { onClose: () => void })
|
||||
</InputLeftElement>
|
||||
<Input
|
||||
bg={'myGray.50'}
|
||||
placeholder={t('plugin.Search plugin')}
|
||||
placeholder={t('common:plugin.Search plugin')}
|
||||
onChange={(e) => setSearchKey(e.target.value)}
|
||||
/>
|
||||
</InputGroup>
|
||||
@@ -184,11 +184,11 @@ const RenderList = React.memo(function RenderList({
|
||||
setConfigTool(res);
|
||||
}
|
||||
},
|
||||
errorToast: t('core.module.templates.Load plugin error')
|
||||
errorToast: t('common:core.module.templates.Load plugin error')
|
||||
});
|
||||
|
||||
return templates.length === 0 && !isLoadingData ? (
|
||||
<EmptyTip text={t('core.app.ToolCall.No plugin')} />
|
||||
<EmptyTip text={t('common:core.app.ToolCall.No plugin')} />
|
||||
) : (
|
||||
<MyBox>
|
||||
{templates.map((item, i) => {
|
||||
@@ -228,11 +228,11 @@ const RenderList = React.memo(function RenderList({
|
||||
leftIcon={<MyIcon name={'delete'} w={'14px'} />}
|
||||
onClick={() => onRemoveTool(item)}
|
||||
>
|
||||
{t('common.Remove')}
|
||||
{t('common:common.Remove')}
|
||||
</Button>
|
||||
) : item.isFolder ? (
|
||||
<Button size={'sm'} variant={'whiteBase'} onClick={() => setParentId(item.id)}>
|
||||
{t('common.Open')}
|
||||
{t('common:common.Open')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
@@ -242,7 +242,7 @@ const RenderList = React.memo(function RenderList({
|
||||
isLoading={isLoading}
|
||||
onClick={() => onClickAdd(item)}
|
||||
>
|
||||
{t('common.Add')}
|
||||
{t('common:common.Add')}
|
||||
</Button>
|
||||
)}
|
||||
</Flex>
|
||||
@@ -251,7 +251,7 @@ const RenderList = React.memo(function RenderList({
|
||||
{!!configTool && (
|
||||
<MyModal
|
||||
isOpen
|
||||
title={t('core.app.ToolCall.Parameter setting')}
|
||||
title={t('common:core.app.ToolCall.Parameter setting')}
|
||||
iconSrc="core/app/toolCall"
|
||||
overflow={'auto'}
|
||||
>
|
||||
@@ -323,7 +323,7 @@ const RenderList = React.memo(function RenderList({
|
||||
</ModalBody>
|
||||
<ModalFooter gap={6}>
|
||||
<Button onClick={onCloseConfigTool} variant={'whiteBase'}>
|
||||
{t('common.Cancel')}
|
||||
{t('common:common.Cancel')}
|
||||
</Button>
|
||||
<Button
|
||||
variant={'primary'}
|
||||
@@ -338,7 +338,7 @@ const RenderList = React.memo(function RenderList({
|
||||
onCloseConfigTool();
|
||||
})}
|
||||
>
|
||||
{t('common.Confirm')}
|
||||
{t('common:common.Confirm')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
|
||||
@@ -20,7 +20,7 @@ const SimpleEdit = () => {
|
||||
const [appForm, setAppForm] = useState(getDefaultAppForm());
|
||||
|
||||
useBeforeunload({
|
||||
tip: t('core.common.tip.leave page')
|
||||
tip: t('common:core.common.tip.leave page')
|
||||
});
|
||||
|
||||
return (
|
||||
|
||||
@@ -41,11 +41,11 @@ const TagsEditModal = ({ onClose }: { onClose: () => void }) => {
|
||||
onSuccess() {
|
||||
onClose();
|
||||
toast({
|
||||
title: t('common.Update Success'),
|
||||
title: t('common:common.Update Success'),
|
||||
status: 'success'
|
||||
});
|
||||
},
|
||||
errorToast: t('common.Update Failed')
|
||||
errorToast: t('common:common.Update Failed')
|
||||
});
|
||||
|
||||
const { data: teamTags = [] } = useQuery(['getTeamsTags'], getTeamsTags);
|
||||
@@ -60,11 +60,11 @@ const TagsEditModal = ({ onClose }: { onClose: () => void }) => {
|
||||
isOpen
|
||||
onClose={onClose}
|
||||
iconSrc="/imgs/workflow/ai.svg"
|
||||
title={t('core.app.Team tags')}
|
||||
title={t('common:core.app.Team tags')}
|
||||
>
|
||||
<ModalBody>
|
||||
<Box mb={3} fontWeight="semibold">
|
||||
{t('团队标签')}
|
||||
{t('common:团队标签')}
|
||||
</Box>
|
||||
<Menu closeOnSelect={false}>
|
||||
<MenuButton className="menu-btn" maxHeight={'250'} w={'100%'}>
|
||||
@@ -96,7 +96,7 @@ const TagsEditModal = ({ onClose }: { onClose: () => void }) => {
|
||||
<Box px={2}>
|
||||
<Input
|
||||
m={'auto'}
|
||||
placeholder={t('core.app.Search team tags')}
|
||||
placeholder={t('common:core.app.Search team tags')}
|
||||
value={searchKey}
|
||||
onChange={(e) => {
|
||||
setSearchKey(e.target.value);
|
||||
@@ -131,10 +131,10 @@ const TagsEditModal = ({ onClose }: { onClose: () => void }) => {
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
|
||||
{t('common.Close')}
|
||||
{t('common:common.Close')}
|
||||
</Button>
|
||||
<Button isLoading={btnLoading} onClick={(e) => saveSubmitSuccess(e)}>
|
||||
{t('common.Save')}
|
||||
{t('common:common.Save')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
|
||||
@@ -59,7 +59,7 @@ const Header = () => {
|
||||
// effect
|
||||
useBeforeunload({
|
||||
callback: onSaveWorkflow,
|
||||
tip: t('core.common.tip.leave page')
|
||||
tip: t('common:core.common.tip.leave page')
|
||||
});
|
||||
useInterval(() => {
|
||||
if (!appDetail._id) return;
|
||||
@@ -147,21 +147,21 @@ const Header = () => {
|
||||
}
|
||||
}}
|
||||
>
|
||||
{t('core.workflow.Debug')}
|
||||
{t('common:core.workflow.Debug')}
|
||||
</Button>
|
||||
|
||||
{!historiesDefaultData && (
|
||||
<PopoverConfirm
|
||||
showCancel
|
||||
content={t('core.app.Publish Confirm')}
|
||||
content={t('common:core.app.Publish Confirm')}
|
||||
Trigger={
|
||||
<Box>
|
||||
<MyTooltip label={t('core.app.Publish app tip')}>
|
||||
<MyTooltip label={t('common:core.app.Publish app tip')}>
|
||||
<Button
|
||||
size={'sm'}
|
||||
leftIcon={<MyIcon name={'common/publishFill'} w={['14px', '16px']} />}
|
||||
>
|
||||
{t('core.app.Publish')}
|
||||
{t('common:core.app.Publish')}
|
||||
</Button>
|
||||
</MyTooltip>
|
||||
</Box>
|
||||
|
||||
@@ -85,7 +85,7 @@ const AppCard = ({ showSaveStatus }: { showSaveStatus: boolean }) => {
|
||||
},
|
||||
{
|
||||
icon: 'support/team/key',
|
||||
label: t('common.Role'),
|
||||
label: t('common:common.Role'),
|
||||
onClick: onOpenInfoEdit
|
||||
}
|
||||
]
|
||||
@@ -114,7 +114,7 @@ const AppCard = ({ showSaveStatus }: { showSaveStatus: boolean }) => {
|
||||
children: [
|
||||
{
|
||||
icon: 'support/team/memberLight',
|
||||
label: t('common.Team Tags Set'),
|
||||
label: t('common:common.Team Tags Set'),
|
||||
onClick: onOpenTeamTagModal
|
||||
}
|
||||
]
|
||||
@@ -128,7 +128,7 @@ const AppCard = ({ showSaveStatus }: { showSaveStatus: boolean }) => {
|
||||
{
|
||||
type: 'danger' as 'danger',
|
||||
icon: 'delete',
|
||||
label: t('common.Delete'),
|
||||
label: t('common:common.Delete'),
|
||||
onClick: onDelApp
|
||||
}
|
||||
]
|
||||
@@ -169,7 +169,7 @@ const AppCard = ({ showSaveStatus }: { showSaveStatus: boolean }) => {
|
||||
</HStack>
|
||||
</InfoMenu>
|
||||
{showSaveStatus && (
|
||||
<MyTooltip label={t('core.app.Onclick to save')}>
|
||||
<MyTooltip label={t('common:core.app.Onclick to save')}>
|
||||
<Flex
|
||||
alignItems={'center'}
|
||||
h={'20px'}
|
||||
|
||||
@@ -73,10 +73,10 @@ const ChatTest = ({
|
||||
>
|
||||
<LightRowTabs<PluginRunBoxTabEnum>
|
||||
list={[
|
||||
{ label: t('common.Input'), value: PluginRunBoxTabEnum.input },
|
||||
{ label: t('common:common.Input'), value: PluginRunBoxTabEnum.input },
|
||||
...(chatRecords.length > 0
|
||||
? [
|
||||
{ label: t('common.Output'), value: PluginRunBoxTabEnum.output },
|
||||
{ label: t('common:common.Output'), value: PluginRunBoxTabEnum.output },
|
||||
{ label: '完整结果', value: PluginRunBoxTabEnum.detail }
|
||||
]
|
||||
: [])
|
||||
@@ -100,9 +100,9 @@ const ChatTest = ({
|
||||
borderBottom={isPlugin ? '1px solid #F4F4F7' : ''}
|
||||
>
|
||||
<Box fontSize={'lg'} fontWeight={'bold'} flex={1}>
|
||||
{t('core.chat.Debug test')}
|
||||
{t('common:core.chat.Debug test')}
|
||||
</Box>
|
||||
<MyTooltip label={t('core.chat.Restart')}>
|
||||
<MyTooltip label={t('common:core.chat.Restart')}>
|
||||
<IconButton
|
||||
className="chat"
|
||||
size={'smSquare'}
|
||||
@@ -113,7 +113,7 @@ const ChatTest = ({
|
||||
onClick={restartChat}
|
||||
/>
|
||||
</MyTooltip>
|
||||
<MyTooltip label={t('common.Close')}>
|
||||
<MyTooltip label={t('common:common.Close')}>
|
||||
<IconButton
|
||||
ml={4}
|
||||
icon={<SmallCloseIcon fontSize={'22px'} />}
|
||||
|
||||
@@ -182,17 +182,17 @@ const NodeTemplatesModal = ({ isOpen, onClose }: ModuleTemplateListProps) => {
|
||||
list={[
|
||||
{
|
||||
icon: 'core/modules/basicNode',
|
||||
label: t('core.module.template.Basic Node'),
|
||||
label: t('common:core.module.template.Basic Node'),
|
||||
value: TemplateTypeEnum.basic
|
||||
},
|
||||
{
|
||||
icon: 'core/modules/systemPlugin',
|
||||
label: t('core.module.template.System Plugin'),
|
||||
label: t('common:core.module.template.System Plugin'),
|
||||
value: TemplateTypeEnum.systemPlugin
|
||||
},
|
||||
{
|
||||
icon: 'core/modules/teamPlugin',
|
||||
label: t('core.module.template.Team Plugin'),
|
||||
label: t('common:core.module.template.Team Plugin'),
|
||||
value: TemplateTypeEnum.teamPlugin
|
||||
}
|
||||
]}
|
||||
@@ -219,7 +219,7 @@ const NodeTemplatesModal = ({ isOpen, onClose }: ModuleTemplateListProps) => {
|
||||
<Input
|
||||
h={'full'}
|
||||
bg={'myGray.50'}
|
||||
placeholder={t('plugin.Search plugin')}
|
||||
placeholder={t('common:plugin.Search plugin')}
|
||||
onChange={(e) => setSearchKey(e.target.value)}
|
||||
/>
|
||||
</InputGroup>
|
||||
@@ -318,7 +318,7 @@ const RenderList = React.memo(function RenderList({
|
||||
} catch (e) {
|
||||
toast({
|
||||
status: 'error',
|
||||
title: getErrText(e, t('core.plugin.Get Plugin Module Detail Failed'))
|
||||
title: getErrText(e, t('common:core.plugin.Get Plugin Module Detail Failed'))
|
||||
});
|
||||
setLoading(false);
|
||||
return Promise.reject(e);
|
||||
@@ -398,7 +398,7 @@ const RenderList = React.memo(function RenderList({
|
||||
</Box>
|
||||
</Flex>
|
||||
<Box mt={2} color={'myGray.500'}>
|
||||
{t(template.intro) || t('core.workflow.Not intro')}
|
||||
{t(template.intro) || t('common:core.workflow.Not intro')}
|
||||
</Box>
|
||||
</Box>
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ const SelectAppModal = ({
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button variant={'whiteBase'} onClick={onClose}>
|
||||
{t('common.Cancel')}
|
||||
{t('common:common.Cancel')}
|
||||
</Button>
|
||||
<Button
|
||||
ml={2}
|
||||
@@ -73,7 +73,7 @@ const SelectAppModal = ({
|
||||
onClose();
|
||||
}}
|
||||
>
|
||||
{t('common.Confirm')}
|
||||
{t('common:common.Confirm')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
|
||||
@@ -60,7 +60,7 @@ export const useDebug = () => {
|
||||
|
||||
toast({
|
||||
status: 'warning',
|
||||
title: t('core.workflow.Check Failed')
|
||||
title: t('common:core.workflow.Check Failed')
|
||||
});
|
||||
return Promise.reject();
|
||||
}
|
||||
@@ -178,7 +178,7 @@ export const useDebug = () => {
|
||||
<MyRightDrawer
|
||||
onClose={onClose}
|
||||
iconSrc="core/workflow/debugBlue"
|
||||
title={t('core.workflow.Debug Node')}
|
||||
title={t('common:core.workflow.Debug Node')}
|
||||
maxW={['90vw', '35vw']}
|
||||
px={0}
|
||||
>
|
||||
|
||||
@@ -37,7 +37,7 @@ export const useKeyboard = () => {
|
||||
(node) => node.selected && !node.data?.isError && node.data?.unique !== true
|
||||
);
|
||||
if (selectedNodes.length === 0) return;
|
||||
copyData(JSON.stringify(selectedNodes), t('core.workflow.Copy node'));
|
||||
copyData(JSON.stringify(selectedNodes), t('common:core.workflow.Copy node'));
|
||||
}, [copyData, hasInputtingElement, t]);
|
||||
|
||||
const onParse = useCallback(async () => {
|
||||
|
||||
@@ -13,7 +13,7 @@ export const useWorkflow = () => {
|
||||
const { toast } = useToast();
|
||||
const { t } = useTranslation();
|
||||
const { openConfirm: onOpenConfirmDeleteNode, ConfirmModal: ConfirmDeleteModal } = useConfirm({
|
||||
content: t('core.module.Confirm Delete Node'),
|
||||
content: t('common:core.module.Confirm Delete Node'),
|
||||
type: 'delete'
|
||||
});
|
||||
|
||||
@@ -30,7 +30,7 @@ export const useWorkflow = () => {
|
||||
if (node && node.data.forbidDelete) {
|
||||
return toast({
|
||||
status: 'warning',
|
||||
title: t('core.workflow.Can not delete node')
|
||||
title: t('common:core.workflow.Can not delete node')
|
||||
});
|
||||
} else {
|
||||
return onOpenConfirmDeleteNode(() => {
|
||||
@@ -88,7 +88,7 @@ export const useWorkflow = () => {
|
||||
if (connect.source === connect.target) {
|
||||
return toast({
|
||||
status: 'warning',
|
||||
title: t('core.module.Can not connect self')
|
||||
title: t('common:core.module.Can not connect self')
|
||||
});
|
||||
}
|
||||
onConnect({
|
||||
|
||||
@@ -35,7 +35,7 @@ const NodeCQNode = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
||||
{agents.map((item, i) => (
|
||||
<Box key={item.key} mb={4}>
|
||||
<Flex alignItems={'center'}>
|
||||
<MyTooltip label={t('common.Delete')}>
|
||||
<MyTooltip label={t('common:common.Delete')}>
|
||||
<MyIcon
|
||||
mt={1}
|
||||
mr={2}
|
||||
@@ -121,7 +121,7 @@ const NodeCQNode = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t('core.module.Add question type')}
|
||||
{t('common:core.module.Add question type')}
|
||||
</Button>
|
||||
</Box>
|
||||
);
|
||||
|
||||
@@ -85,7 +85,7 @@ const NodeCode = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
||||
</>
|
||||
)}
|
||||
<Container>
|
||||
<IOTitle text={t('common.Input')} />
|
||||
<IOTitle text={t('common:common.Input')} />
|
||||
<RenderInput
|
||||
nodeId={nodeId}
|
||||
flowInputList={commonInputs}
|
||||
@@ -93,7 +93,7 @@ const NodeCode = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
||||
/>
|
||||
</Container>
|
||||
<Container>
|
||||
<IOTitle text={t('common.Output')} />
|
||||
<IOTitle text={t('common:common.Output')} />
|
||||
<RenderOutput nodeId={nodeId} flowOutputList={outputs} />
|
||||
</Container>
|
||||
<ConfirmModal />
|
||||
|
||||
@@ -89,7 +89,7 @@ const NodeDatasetConcat = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
||||
<>
|
||||
<HStack className="nodrag" cursor={'default'} position={'relative'}>
|
||||
<HStack spacing={1} position={'relative'} fontWeight={'medium'} color={'myGray.600'}>
|
||||
<Box>{t('core.workflow.Dataset quote')}</Box>
|
||||
<Box>{t('common:core.workflow.Dataset quote')}</Box>
|
||||
</HStack>
|
||||
<Box flex={'1 0 0'} />
|
||||
<Button
|
||||
@@ -105,7 +105,7 @@ const NodeDatasetConcat = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t('common.Add New')}
|
||||
{t('common:common.Add New')}
|
||||
</Button>
|
||||
</HStack>
|
||||
<Box mt={2}>
|
||||
@@ -128,7 +128,7 @@ const NodeDatasetConcat = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
||||
{/* {RenderQuoteList} */}
|
||||
</Container>
|
||||
<Container>
|
||||
<IOTitle text={t('common.Output')} />
|
||||
<IOTitle text={t('common:common.Output')} />
|
||||
<RenderOutput nodeId={nodeId} flowOutputList={outputs} />
|
||||
</Container>
|
||||
</NodeCard>
|
||||
|
||||
@@ -48,31 +48,38 @@ const ExtractFieldModal = ({
|
||||
<MyModal
|
||||
isOpen={true}
|
||||
iconSrc="/imgs/workflow/extract.png"
|
||||
title={t('core.module.extract.Field Setting Title')}
|
||||
title={t('common:core.module.extract.Field Setting Title')}
|
||||
onClose={onClose}
|
||||
w={['90vw', '500px']}
|
||||
>
|
||||
<ModalBody>
|
||||
<Flex mt={2} alignItems={'center'}>
|
||||
<Flex alignItems={'center'} flex={['1 0 80px', '1 0 100px']}>
|
||||
<FormLabel>{t('core.module.extract.Required')}</FormLabel>
|
||||
<QuestionTip ml={1} label={t('core.module.extract.Required Description')}></QuestionTip>
|
||||
<FormLabel>{t('common:core.module.extract.Required')}</FormLabel>
|
||||
<QuestionTip
|
||||
ml={1}
|
||||
label={t('common:core.module.extract.Required Description')}
|
||||
></QuestionTip>
|
||||
</Flex>
|
||||
<Switch {...register('required')} />
|
||||
</Flex>
|
||||
{required && (
|
||||
<Flex mt={5} alignItems={'center'}>
|
||||
<FormLabel flex={['0 0 80px', '0 0 100px']}>{t('core.module.Default value')}</FormLabel>
|
||||
<FormLabel flex={['0 0 80px', '0 0 100px']}>
|
||||
{t('common:core.module.Default value')}
|
||||
</FormLabel>
|
||||
<Input
|
||||
bg={'myGray.50'}
|
||||
placeholder={t('core.module.Default value placeholder')}
|
||||
placeholder={t('common:core.module.Default value placeholder')}
|
||||
{...register('defaultValue')}
|
||||
/>
|
||||
</Flex>
|
||||
)}
|
||||
|
||||
<Flex alignItems={'center'} mt={5}>
|
||||
<FormLabel flex={['0 0 80px', '0 0 100px']}>{t('core.module.Data Type')}</FormLabel>
|
||||
<FormLabel flex={['0 0 80px', '0 0 100px']}>
|
||||
{t('common:core.module.Data Type')}
|
||||
</FormLabel>
|
||||
<Box flex={'1 0 0'}>
|
||||
<MySelect<string>
|
||||
list={fnValueTypeSelect}
|
||||
@@ -85,7 +92,7 @@ const ExtractFieldModal = ({
|
||||
</Flex>
|
||||
|
||||
<Flex mt={5} alignItems={'center'}>
|
||||
<FormLabel flex={['0 0 80px', '0 0 100px']}>{t('Field name')}</FormLabel>
|
||||
<FormLabel flex={['0 0 80px', '0 0 100px']}>{t('common:Field name')}</FormLabel>
|
||||
<Input
|
||||
bg={'myGray.50'}
|
||||
placeholder="name/age/sql"
|
||||
@@ -94,11 +101,11 @@ const ExtractFieldModal = ({
|
||||
</Flex>
|
||||
<Flex mt={5} alignItems={'center'}>
|
||||
<FormLabel flex={['0 0 80px', '0 0 100px']}>
|
||||
{t('core.module.Field Description')}
|
||||
{t('common:core.module.Field Description')}
|
||||
</FormLabel>
|
||||
<Input
|
||||
bg={'myGray.50'}
|
||||
placeholder={t('core.module.extract.Field Description Placeholder')}
|
||||
placeholder={t('common:core.module.extract.Field Description Placeholder')}
|
||||
{...register('desc', { required: true })}
|
||||
/>
|
||||
</Flex>
|
||||
@@ -106,9 +113,12 @@ const ExtractFieldModal = ({
|
||||
<Box mt={5}>
|
||||
<Flex alignItems={'center'}>
|
||||
<FormLabel>
|
||||
{t('core.module.extract.Enum Value')}({t('common.choosable')})
|
||||
{t('common:core.module.extract.Enum Value')}({t('common:common.choosable')})
|
||||
</FormLabel>
|
||||
<QuestionTip ml={1} label={t('core.module.extract.Enum Description')}></QuestionTip>
|
||||
<QuestionTip
|
||||
ml={1}
|
||||
label={t('common:core.module.extract.Enum Description')}
|
||||
></QuestionTip>
|
||||
</Flex>
|
||||
|
||||
<Textarea
|
||||
@@ -122,7 +132,7 @@ const ExtractFieldModal = ({
|
||||
</ModalBody>
|
||||
|
||||
<ModalFooter>
|
||||
<Button onClick={handleSubmit(onSubmit)}>{t('common.Confirm')}</Button>
|
||||
<Button onClick={handleSubmit(onSubmit)}>{t('common:common.Confirm')}</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
);
|
||||
|
||||
@@ -56,7 +56,7 @@ const NodeExtract = ({ data }: NodeProps<FlowNodeItemType>) => {
|
||||
<Box>
|
||||
<Flex alignItems={'center'}>
|
||||
<Box flex={'1 0 0'} fontWeight={'medium'} color={'myGray.600'}>
|
||||
{t('core.module.extract.Target field')}
|
||||
{t('common:core.module.extract.Target field')}
|
||||
</Box>
|
||||
<Button
|
||||
size={'sm'}
|
||||
@@ -64,7 +64,7 @@ const NodeExtract = ({ data }: NodeProps<FlowNodeItemType>) => {
|
||||
leftIcon={<AddIcon fontSize={'10px'} />}
|
||||
onClick={() => setEditExtractField(defaultField)}
|
||||
>
|
||||
{t('core.module.extract.Add field')}
|
||||
{t('common:core.module.extract.Add field')}
|
||||
</Button>
|
||||
</Flex>
|
||||
<Box
|
||||
@@ -153,7 +153,7 @@ const NodeExtract = ({ data }: NodeProps<FlowNodeItemType>) => {
|
||||
)}
|
||||
<>
|
||||
<Container>
|
||||
<IOTitle text={t('common.Input')} />
|
||||
<IOTitle text={t('common:common.Input')} />
|
||||
<RenderInput
|
||||
nodeId={nodeId}
|
||||
flowInputList={commonInputs}
|
||||
@@ -163,7 +163,7 @@ const NodeExtract = ({ data }: NodeProps<FlowNodeItemType>) => {
|
||||
</>
|
||||
<>
|
||||
<Container>
|
||||
<IOTitle text={t('common.Output')} />
|
||||
<IOTitle text={t('common:common.Output')} />
|
||||
<RenderOutput nodeId={nodeId} flowOutputList={outputs} />
|
||||
</Container>
|
||||
</>
|
||||
|
||||
@@ -119,12 +119,12 @@ const CurlImportModal = ({
|
||||
onClose();
|
||||
|
||||
toast({
|
||||
title: t('common.Import success'),
|
||||
title: t('common:common.Import success'),
|
||||
status: 'success'
|
||||
});
|
||||
} catch (error: any) {
|
||||
toast({
|
||||
title: t('common.Import failed'),
|
||||
title: t('common:common.Import failed'),
|
||||
description: error.message,
|
||||
status: 'error'
|
||||
});
|
||||
@@ -137,7 +137,7 @@ const CurlImportModal = ({
|
||||
isOpen
|
||||
onClose={onClose}
|
||||
iconSrc="modal/edit"
|
||||
title={t('core.module.http.curl import')}
|
||||
title={t('common:core.module.http.curl import')}
|
||||
w={600}
|
||||
>
|
||||
<ModalBody>
|
||||
@@ -145,12 +145,12 @@ const CurlImportModal = ({
|
||||
rows={20}
|
||||
mt={2}
|
||||
{...register('curlContent')}
|
||||
placeholder={t('core.module.http.curl import placeholder')}
|
||||
placeholder={t('common:core.module.http.curl import placeholder')}
|
||||
/>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button onClick={handleSubmit((data) => handleFileProcessing(data.curlContent))}>
|
||||
{t('common.Confirm')}
|
||||
{t('common:common.Confirm')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
|
||||
@@ -171,7 +171,7 @@ const RenderHttpMethodAndUrl = React.memo(function RenderHttpMethodAndUrl({
|
||||
|
||||
toast({
|
||||
status: 'success',
|
||||
title: t('core.module.http.Url and params have been split')
|
||||
title: t('common:core.module.http.Url and params have been split')
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -180,10 +180,10 @@ const RenderHttpMethodAndUrl = React.memo(function RenderHttpMethodAndUrl({
|
||||
<Box>
|
||||
<Box mb={2} display={'flex'} justifyContent={'space-between'}>
|
||||
<Box fontWeight={'medium'} color={'myGray.600'}>
|
||||
{t('core.module.Http request settings')}
|
||||
{t('common:core.module.Http request settings')}
|
||||
</Box>
|
||||
<Button variant={'link'} onClick={onOpenCurl}>
|
||||
{t('core.module.http.curl import')}
|
||||
{t('common:core.module.http.curl import')}
|
||||
</Button>
|
||||
</Box>
|
||||
<Flex alignItems={'center'} className="nodrag">
|
||||
@@ -233,7 +233,7 @@ const RenderHttpMethodAndUrl = React.memo(function RenderHttpMethodAndUrl({
|
||||
h={'34px'}
|
||||
bg={'white'}
|
||||
value={requestUrl?.value || ''}
|
||||
placeholder={t('core.module.input.label.Http Request Url')}
|
||||
placeholder={t('common:core.module.input.label.Http Request Url')}
|
||||
fontSize={'xs'}
|
||||
onChange={onChangeUrl}
|
||||
onBlur={onBlurUrl}
|
||||
@@ -302,7 +302,7 @@ export function RenderHttpProps({
|
||||
return (
|
||||
<Box>
|
||||
<Flex alignItems={'center'} mb={2} fontWeight={'medium'} color={'myGray.600'}>
|
||||
{t('core.module.Http request props')}
|
||||
{t('common:core.module.Http request props')}
|
||||
<QuestionTip
|
||||
ml={1}
|
||||
label={t('core.module.http.Props tip', { variable: variableText })}
|
||||
@@ -424,7 +424,7 @@ const RenderForm = ({
|
||||
setUpdateTrigger((prev) => !prev);
|
||||
toast({
|
||||
status: 'warning',
|
||||
title: t('core.module.http.Key cannot be empty')
|
||||
title: t('common:core.module.http.Key cannot be empty')
|
||||
});
|
||||
return prevList;
|
||||
}
|
||||
@@ -433,7 +433,7 @@ const RenderForm = ({
|
||||
setUpdateTrigger((prev) => !prev);
|
||||
toast({
|
||||
status: 'warning',
|
||||
title: t('core.module.http.Key already exists')
|
||||
title: t('common:core.module.http.Key already exists')
|
||||
});
|
||||
return prevList;
|
||||
}
|
||||
@@ -456,7 +456,7 @@ const RenderForm = ({
|
||||
setUpdateTrigger((prev) => !prev);
|
||||
toast({
|
||||
status: 'warning',
|
||||
title: t('core.module.http.Key already exists')
|
||||
title: t('common:core.module.http.Key already exists')
|
||||
});
|
||||
return prevList;
|
||||
}
|
||||
@@ -476,10 +476,10 @@ const RenderForm = ({
|
||||
<Thead>
|
||||
<Tr>
|
||||
<Th px={2} borderBottomLeftRadius={'none !important'}>
|
||||
{t('core.module.http.Props name')}
|
||||
{t('common:core.module.http.Props name')}
|
||||
</Th>
|
||||
<Th px={2} borderBottomRadius={'none !important'}>
|
||||
{t('core.module.http.Props value')}
|
||||
{t('common:core.module.http.Props value')}
|
||||
</Th>
|
||||
</Tr>
|
||||
</Thead>
|
||||
@@ -494,7 +494,7 @@ const RenderForm = ({
|
||||
handleKeyChange(index, value);
|
||||
setUpdateTrigger((prev) => !prev);
|
||||
}}
|
||||
placeholder={t('core.module.http.Props name')}
|
||||
placeholder={t('common:core.module.http.Props name')}
|
||||
value={item.key}
|
||||
variables={leftVariables}
|
||||
onBlur={(val) => {
|
||||
@@ -506,7 +506,7 @@ const RenderForm = ({
|
||||
<Td p={0}>
|
||||
<Box display={'flex'} alignItems={'center'}>
|
||||
<HttpInput
|
||||
placeholder={t('core.module.http.Props value')}
|
||||
placeholder={t('common:core.module.http.Props value')}
|
||||
value={item.value}
|
||||
variables={variables}
|
||||
onBlur={(val) => {
|
||||
@@ -541,7 +541,7 @@ const RenderForm = ({
|
||||
handleAddNewProps(val);
|
||||
setUpdateTrigger((prev) => !prev);
|
||||
}}
|
||||
placeholder={t('core.module.http.Add props')}
|
||||
placeholder={t('common:core.module.http.Add props')}
|
||||
value={''}
|
||||
variables={leftVariables}
|
||||
updateTrigger={updateTrigger}
|
||||
@@ -597,7 +597,7 @@ const RenderJson = ({
|
||||
defaultHeight={200}
|
||||
resize
|
||||
value={input.value}
|
||||
placeholder={t('core.module.template.http body placeholder')}
|
||||
placeholder={t('common:core.module.template.http body placeholder')}
|
||||
onChange={(e) => {
|
||||
startSts(() => {
|
||||
onChangeNode({
|
||||
@@ -661,7 +661,7 @@ const NodeHttp = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
||||
)}
|
||||
<>
|
||||
<Container>
|
||||
<IOTitle text={t('common.Input')} />
|
||||
<IOTitle text={t('common:common.Input')} />
|
||||
<RenderInput
|
||||
nodeId={nodeId}
|
||||
flowInputList={commonInputs}
|
||||
@@ -671,7 +671,7 @@ const NodeHttp = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
||||
</>
|
||||
<>
|
||||
<Container>
|
||||
<IOTitle text={t('common.Output')} />
|
||||
<IOTitle text={t('common:common.Output')} />
|
||||
<RenderOutput flowOutputList={outputs} nodeId={nodeId} />
|
||||
</Container>
|
||||
</>
|
||||
|
||||
@@ -258,7 +258,7 @@ const ListItem = ({
|
||||
my={3}
|
||||
color={'primary.600'}
|
||||
>
|
||||
{t('core.module.input.add')}
|
||||
{t('common:core.module.input.add')}
|
||||
</Button>
|
||||
</Container>
|
||||
{!snapshot.isDragging && (
|
||||
@@ -321,7 +321,7 @@ const Reference = ({
|
||||
|
||||
return (
|
||||
<ReferSelector
|
||||
placeholder={t('选择引用变量')}
|
||||
placeholder={t('common:选择引用变量')}
|
||||
list={referenceList}
|
||||
value={formatValue}
|
||||
onSelect={onSelect}
|
||||
|
||||
@@ -128,7 +128,7 @@ const NodeIfElse = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
||||
]);
|
||||
}}
|
||||
>
|
||||
{t('core.module.input.Add Branch')}
|
||||
{t('common:core.module.input.Add Branch')}
|
||||
</Button>
|
||||
</Box>
|
||||
</NodeCard>
|
||||
|
||||
@@ -213,7 +213,7 @@ const NodeLaf = (props: NodeProps<FlowNodeItemType>) => {
|
||||
});
|
||||
},
|
||||
{
|
||||
successToast: t('common.Sync success')
|
||||
successToast: t('common:common.Sync success')
|
||||
}
|
||||
);
|
||||
|
||||
@@ -232,7 +232,7 @@ const NodeLaf = (props: NodeProps<FlowNodeItemType>) => {
|
||||
<MySelect
|
||||
isLoading={isLoadingFunctions}
|
||||
list={lafFunctionSelectList}
|
||||
placeholder={t('core.module.laf.Select laf function')}
|
||||
placeholder={t('common:core.module.laf.Select laf function')}
|
||||
onchange={(e) => {
|
||||
onChangeNode({
|
||||
nodeId,
|
||||
@@ -250,7 +250,7 @@ const NodeLaf = (props: NodeProps<FlowNodeItemType>) => {
|
||||
{!!selectedFunction && (
|
||||
<Flex justifyContent={'flex-end'} mt={2} gap={2}>
|
||||
<Button isLoading={isSyncing} variant={'grayBase'} size={'sm'} onClick={onSyncParams}>
|
||||
{t('core.module.Laf sync params')}
|
||||
{t('common:core.module.Laf sync params')}
|
||||
</Button>
|
||||
<Button
|
||||
variant={'grayBase'}
|
||||
@@ -265,7 +265,7 @@ const NodeLaf = (props: NodeProps<FlowNodeItemType>) => {
|
||||
window.open(url, '_blank');
|
||||
}}
|
||||
>
|
||||
{t('plugin.go to laf')}
|
||||
{t('common:plugin.go to laf')}
|
||||
</Button>
|
||||
</Flex>
|
||||
)}
|
||||
@@ -290,7 +290,7 @@ const ConfigLaf = () => {
|
||||
return !!feConfigs?.lafEnv ? (
|
||||
<Center minH={150}>
|
||||
<Button onClick={onOpenLafConfig} variant={'whitePrimary'}>
|
||||
{t('plugin.Please bind laf accout first')} <ChevronRightIcon />
|
||||
{t('common:plugin.Please bind laf accout first')} <ChevronRightIcon />
|
||||
</Button>
|
||||
|
||||
{isOpenLafConfig && feConfigs?.lafEnv && (
|
||||
@@ -319,13 +319,13 @@ const RenderIO = ({ data }: NodeProps<FlowNodeItemType>) => {
|
||||
)}
|
||||
<>
|
||||
<Container>
|
||||
<IOTitle text={t('common.Input')} />
|
||||
<IOTitle text={t('common:common.Input')} />
|
||||
<RenderInput nodeId={nodeId} flowInputList={commonInputs} />
|
||||
</Container>
|
||||
</>
|
||||
<>
|
||||
<Container>
|
||||
<IOTitle text={t('common.Output')} />
|
||||
<IOTitle text={t('common:common.Output')} />
|
||||
<RenderOutput flowOutputList={outputs} nodeId={nodeId} />
|
||||
</Container>
|
||||
</>
|
||||
|
||||
@@ -62,47 +62,47 @@ const FieldEditModal = ({
|
||||
const inputTypeList = useMemo(
|
||||
() => [
|
||||
{
|
||||
label: t('core.workflow.inputType.Reference'),
|
||||
label: t('common:core.workflow.inputType.Reference'),
|
||||
value: FlowNodeInputTypeEnum.reference,
|
||||
defaultValueType: WorkflowIOValueTypeEnum.string
|
||||
},
|
||||
{
|
||||
label: t('core.workflow.inputType.input'),
|
||||
label: t('common:core.workflow.inputType.input'),
|
||||
value: FlowNodeInputTypeEnum.input,
|
||||
defaultValueType: WorkflowIOValueTypeEnum.string
|
||||
},
|
||||
{
|
||||
label: t('core.workflow.inputType.textarea'),
|
||||
label: t('common:core.workflow.inputType.textarea'),
|
||||
value: FlowNodeInputTypeEnum.textarea,
|
||||
defaultValueType: WorkflowIOValueTypeEnum.string
|
||||
},
|
||||
{
|
||||
label: t('core.workflow.inputType.JSON Editor'),
|
||||
label: t('common:core.workflow.inputType.JSON Editor'),
|
||||
value: FlowNodeInputTypeEnum.JSONEditor,
|
||||
defaultValueType: WorkflowIOValueTypeEnum.string
|
||||
},
|
||||
{
|
||||
label: t('core.workflow.inputType.number input'),
|
||||
label: t('common:core.workflow.inputType.number input'),
|
||||
value: FlowNodeInputTypeEnum.numberInput,
|
||||
defaultValueType: WorkflowIOValueTypeEnum.number
|
||||
},
|
||||
{
|
||||
label: t('core.workflow.inputType.switch'),
|
||||
label: t('common:core.workflow.inputType.switch'),
|
||||
value: FlowNodeInputTypeEnum.switch,
|
||||
defaultValueType: WorkflowIOValueTypeEnum.boolean
|
||||
},
|
||||
{
|
||||
label: t('core.workflow.inputType.selectApp'),
|
||||
label: t('common:core.workflow.inputType.selectApp'),
|
||||
value: FlowNodeInputTypeEnum.selectApp,
|
||||
defaultValueType: WorkflowIOValueTypeEnum.selectApp
|
||||
},
|
||||
{
|
||||
label: t('core.workflow.inputType.selectLLMModel'),
|
||||
label: t('common:core.workflow.inputType.selectLLMModel'),
|
||||
value: FlowNodeInputTypeEnum.selectLLMModel,
|
||||
defaultValueType: WorkflowIOValueTypeEnum.string
|
||||
},
|
||||
{
|
||||
label: t('core.workflow.inputType.selectDataset'),
|
||||
label: t('common:core.workflow.inputType.selectDataset'),
|
||||
value: FlowNodeInputTypeEnum.selectDataset,
|
||||
defaultValueType: WorkflowIOValueTypeEnum.selectDataset
|
||||
},
|
||||
@@ -110,7 +110,7 @@ const FieldEditModal = ({
|
||||
? []
|
||||
: [
|
||||
{
|
||||
label: t('core.workflow.inputType.dynamicTargetInput'),
|
||||
label: t('common:core.workflow.inputType.dynamicTargetInput'),
|
||||
value: FlowNodeInputTypeEnum.addInputParam,
|
||||
defaultValueType: WorkflowIOValueTypeEnum.dynamic
|
||||
}
|
||||
@@ -177,7 +177,7 @@ const FieldEditModal = ({
|
||||
if (!data.key) {
|
||||
return toast({
|
||||
status: 'warning',
|
||||
title: t('core.module.edit.Field Name Cannot Be Empty')
|
||||
title: t('common:core.module.edit.Field Name Cannot Be Empty')
|
||||
});
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ const FieldEditModal = ({
|
||||
<ModalBody display={'flex'} gap={8} flexDirection={['column', 'row']}>
|
||||
<Stack flex={1} gap={5}>
|
||||
<Flex alignItems={'center'}>
|
||||
<FormLabel flex={'0 0 70px'}>{t('core.module.Input Type')}</FormLabel>
|
||||
<FormLabel flex={'0 0 70px'}>{t('common:core.module.Input Type')}</FormLabel>
|
||||
<Box flex={1}>
|
||||
<MySelect<FlowNodeInputTypeEnum>
|
||||
list={inputTypeList}
|
||||
@@ -260,7 +260,7 @@ const FieldEditModal = ({
|
||||
</Box>
|
||||
</Flex>
|
||||
<Flex alignItems={'center'}>
|
||||
<FormLabel flex={'0 0 70px'}>{t('core.module.Field Name')}</FormLabel>
|
||||
<FormLabel flex={'0 0 70px'}>{t('common:core.module.Field Name')}</FormLabel>
|
||||
<Input
|
||||
bg={'myGray.50'}
|
||||
placeholder="appointment/sql"
|
||||
@@ -285,7 +285,7 @@ const FieldEditModal = ({
|
||||
<Stack flex={1} gap={5}>
|
||||
{/* value type */}
|
||||
<Flex alignItems={'center'}>
|
||||
<FormLabel flex={'0 0 70px'}>{t('core.module.Data Type')}</FormLabel>
|
||||
<FormLabel flex={'0 0 70px'}>{t('common:core.module.Data Type')}</FormLabel>
|
||||
{showValueTypeSelect ? (
|
||||
<Box flex={1}>
|
||||
<MySelect<WorkflowIOValueTypeEnum>
|
||||
@@ -325,11 +325,11 @@ const FieldEditModal = ({
|
||||
|
||||
{showMaxLenInput && (
|
||||
<Flex alignItems={'center'}>
|
||||
<FormLabel flex={'0 0 70px'}>{t('core.module.Max Length')}</FormLabel>
|
||||
<FormLabel flex={'0 0 70px'}>{t('common:core.module.Max Length')}</FormLabel>
|
||||
<MyNumberInput
|
||||
flex={'1 0 0'}
|
||||
bg={'myGray.50'}
|
||||
placeholder={t('core.module.Max Length placeholder')}
|
||||
placeholder={t('common:core.module.Max Length placeholder')}
|
||||
value={maxLength}
|
||||
onChange={(e) => {
|
||||
// @ts-ignore
|
||||
@@ -342,7 +342,7 @@ const FieldEditModal = ({
|
||||
{showMinMaxInput && (
|
||||
<>
|
||||
<Flex alignItems={'center'}>
|
||||
<FormLabel flex={'0 0 70px'}>{t('core.module.Max Value')}</FormLabel>
|
||||
<FormLabel flex={'0 0 70px'}>{t('common:core.module.Max Value')}</FormLabel>
|
||||
<MyNumberInput
|
||||
flex={'1 0 0'}
|
||||
bg={'myGray.50'}
|
||||
@@ -354,7 +354,7 @@ const FieldEditModal = ({
|
||||
/>
|
||||
</Flex>
|
||||
<Flex alignItems={'center'}>
|
||||
<FormLabel flex={'0 0 70px'}>{t('core.module.Min Value')}</FormLabel>
|
||||
<FormLabel flex={'0 0 70px'}>{t('common:core.module.Min Value')}</FormLabel>
|
||||
<MyNumberInput
|
||||
flex={'1 0 0'}
|
||||
bg={'myGray.50'}
|
||||
@@ -371,7 +371,7 @@ const FieldEditModal = ({
|
||||
{showDefaultValue && (
|
||||
<Flex alignItems={'center'} minH={'40px'}>
|
||||
<FormLabel flex={inputType === FlowNodeInputTypeEnum.switch ? 1 : '0 0 70px'}>
|
||||
{t('core.module.Default Value')}
|
||||
{t('common:core.module.Default Value')}
|
||||
</FormLabel>
|
||||
{inputType === FlowNodeInputTypeEnum.numberInput && (
|
||||
<Input
|
||||
@@ -408,7 +408,7 @@ const FieldEditModal = ({
|
||||
{inputType === FlowNodeInputTypeEnum.addInputParam && (
|
||||
<>
|
||||
<Flex alignItems={'center'}>
|
||||
<FormLabel flex={'0 0 70px'}>{t('core.module.Input Type')}</FormLabel>
|
||||
<FormLabel flex={'0 0 70px'}>{t('common:core.module.Input Type')}</FormLabel>
|
||||
<Box flex={1} fontWeight={'bold'}>
|
||||
{workflowT('Only the Reference type is supported')}
|
||||
</Box>
|
||||
@@ -434,10 +434,10 @@ const FieldEditModal = ({
|
||||
|
||||
<ModalFooter>
|
||||
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
|
||||
{t('common.Close')}
|
||||
{t('common:common.Close')}
|
||||
</Button>
|
||||
<Button onClick={handleSubmit(onSubmitSuccess, onSubmitError)}>
|
||||
{t('common.Confirm')}
|
||||
{t('common:common.Confirm')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
|
||||
@@ -99,7 +99,7 @@ const NodePluginInput = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
||||
>
|
||||
<Container mt={1}>
|
||||
<HStack className="nodrag" cursor={'default'} mb={3}>
|
||||
<IOTitle text={t('core.workflow.Custom inputs')} mb={0} />
|
||||
<IOTitle text={t('common:core.workflow.Custom inputs')} mb={0} />
|
||||
<Box flex={'1 0 0'} />
|
||||
<Button
|
||||
variant={'whitePrimary'}
|
||||
@@ -108,7 +108,7 @@ const NodePluginInput = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
||||
size={'sm'}
|
||||
onClick={() => setEditField(defaultInput)}
|
||||
>
|
||||
{t('common.Add New')}
|
||||
{t('common:common.Add New')}
|
||||
</Button>
|
||||
</HStack>
|
||||
<VariableTable
|
||||
|
||||
@@ -56,7 +56,7 @@ const NodePluginOutput = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
||||
>
|
||||
<Container mt={1}>
|
||||
<Flex className="nodrag" cursor={'default'} alignItems={'center'} position={'relative'}>
|
||||
<IOTitle mb={0} text={t('core.workflow.Custom outputs')}></IOTitle>
|
||||
<IOTitle mb={0} text={t('common:core.workflow.Custom outputs')}></IOTitle>
|
||||
<Box flex={'1 0 0'} />
|
||||
<Button
|
||||
variant={'whitePrimary'}
|
||||
@@ -65,7 +65,7 @@ const NodePluginOutput = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
||||
size={'sm'}
|
||||
onClick={() => setEditField(defaultInput)}
|
||||
>
|
||||
{t('common.Add New')}
|
||||
{t('common:common.Add New')}
|
||||
</Button>
|
||||
</Flex>
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@ const VariableTable = ({
|
||||
<Thead>
|
||||
<Tr>
|
||||
<Th borderBottomLeftRadius={'none !important'}>
|
||||
{t('core.module.variable.variable name')}
|
||||
{t('common:core.module.variable.variable name')}
|
||||
</Th>
|
||||
<Th>{t('core.workflow.Value type')}</Th>
|
||||
<Th>{t('common:core.workflow.Value type')}</Th>
|
||||
{showToolColumn && <Th>{workflowT('Tool input')}</Th>}
|
||||
<Th borderBottomRightRadius={'none !important'}></Th>
|
||||
</Tr>
|
||||
|
||||
@@ -37,7 +37,7 @@ const NodeSimple = ({
|
||||
{filterHiddenInputs.length > 0 && (
|
||||
<>
|
||||
<Container>
|
||||
<IOTitle text={t('common.Input')} />
|
||||
<IOTitle text={t('common:common.Input')} />
|
||||
<RenderInput nodeId={nodeId} flowInputList={commonInputs} />
|
||||
</Container>
|
||||
</>
|
||||
@@ -45,7 +45,7 @@ const NodeSimple = ({
|
||||
{outputs.filter((output) => output.type !== FlowNodeOutputTypeEnum.hidden).length > 0 && (
|
||||
<>
|
||||
<Container>
|
||||
<IOTitle text={t('common.Output')} />
|
||||
<IOTitle text={t('common:common.Output')} />
|
||||
<RenderOutput nodeId={nodeId} flowOutputList={outputs} />
|
||||
</Container>
|
||||
</>
|
||||
|
||||
@@ -19,11 +19,11 @@ const NodeTools = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
||||
return (
|
||||
<NodeCard minW={'350px'} selected={selected} {...data}>
|
||||
<Container>
|
||||
<IOTitle text={t('common.Input')} />
|
||||
<IOTitle text={t('common:common.Input')} />
|
||||
<RenderInput nodeId={nodeId} flowInputList={inputs} />
|
||||
</Container>
|
||||
<Container>
|
||||
<IOTitle text={t('common.Output')} />
|
||||
<IOTitle text={t('common:common.Output')} />
|
||||
<RenderOutput nodeId={nodeId} flowOutputList={outputs} />
|
||||
</Container>
|
||||
<Box position={'relative'}>
|
||||
@@ -31,7 +31,7 @@ const NodeTools = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
||||
<Divider
|
||||
showBorderBottom={false}
|
||||
icon={<MyIcon name="phoneTabbar/tool" w={'16px'} h={'16px'} />}
|
||||
text={t('core.workflow.tool.Select Tool')}
|
||||
text={t('common:core.workflow.tool.Select Tool')}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
|
||||
@@ -72,12 +72,12 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps<FlowNodeItemType>) =>
|
||||
{
|
||||
renderType: FlowNodeInputTypeEnum.input,
|
||||
icon: FlowNodeInputMap[FlowNodeInputTypeEnum.input].icon,
|
||||
label: t('core.workflow.inputType.Manual input')
|
||||
label: t('common:core.workflow.inputType.Manual input')
|
||||
},
|
||||
{
|
||||
renderType: FlowNodeInputTypeEnum.reference,
|
||||
icon: FlowNodeInputMap[FlowNodeInputTypeEnum.reference].icon,
|
||||
label: t('core.workflow.inputType.Reference')
|
||||
label: t('common:core.workflow.inputType.Reference')
|
||||
}
|
||||
];
|
||||
|
||||
@@ -111,7 +111,7 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps<FlowNodeItemType>) =>
|
||||
return (
|
||||
<Container key={index} mt={4} w={'full'} mx={0}>
|
||||
<Flex alignItems={'center'}>
|
||||
<Flex w={'60px'}>{t('core.workflow.variable')}</Flex>
|
||||
<Flex w={'60px'}>{t('common:core.workflow.variable')}</Flex>
|
||||
<Reference
|
||||
nodeId={nodeId}
|
||||
variable={updateItem.variable}
|
||||
@@ -151,7 +151,7 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps<FlowNodeItemType>) =>
|
||||
</Flex>
|
||||
<Flex mt={2} w={'full'} alignItems={'center'} className="nodrag">
|
||||
<Flex w={'60px'}>
|
||||
<Box>{t('core.workflow.value')}</Box>
|
||||
<Box>{t('common:core.workflow.value')}</Box>
|
||||
<MyTooltip
|
||||
label={
|
||||
menuList.find((item) => item.renderType === updateItem.renderType)?.label
|
||||
@@ -272,7 +272,7 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps<FlowNodeItemType>) =>
|
||||
]);
|
||||
}}
|
||||
>
|
||||
{t('common.Add New')}
|
||||
{t('common:common.Add New')}
|
||||
</Button>
|
||||
</Flex>
|
||||
</Box>
|
||||
@@ -302,7 +302,7 @@ const Reference = ({
|
||||
|
||||
return (
|
||||
<ReferSelector
|
||||
placeholder={t('选择引用变量')}
|
||||
placeholder={t('common:选择引用变量')}
|
||||
list={referenceList}
|
||||
value={formatValue}
|
||||
onSelect={onSelect}
|
||||
|
||||
@@ -50,11 +50,11 @@ const NodeStart = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
||||
{...data}
|
||||
>
|
||||
<Container>
|
||||
<IOTitle text={t('common.Output')} />
|
||||
<IOTitle text={t('common:common.Output')} />
|
||||
<RenderOutput nodeId={nodeId} flowOutputList={outputs} />
|
||||
</Container>
|
||||
<Container>
|
||||
<IOTitle text={t('core.module.Variable')} />
|
||||
<IOTitle text={t('common:core.module.Variable')} />
|
||||
<RenderOutput nodeId={nodeId} flowOutputList={variablesOutputs} />
|
||||
</Container>
|
||||
</NodeCard>
|
||||
|
||||
@@ -29,7 +29,7 @@ export const ToolTargetHandle = ({ nodeId }: ToolHandleProps) => {
|
||||
|
||||
const Render = useMemo(() => {
|
||||
return hidden ? null : (
|
||||
<MyTooltip label={t('core.workflow.tool.Handle')} shouldWrapChildren={false}>
|
||||
<MyTooltip label={t('common:core.workflow.tool.Handle')} shouldWrapChildren={false}>
|
||||
<Handle
|
||||
style={{
|
||||
borderRadius: '0',
|
||||
@@ -79,7 +79,7 @@ export const ToolSourceHandle = ({ nodeId }: ToolHandleProps) => {
|
||||
|
||||
const Render = useMemo(() => {
|
||||
return (
|
||||
<MyTooltip label={t('core.workflow.tool.Handle')} shouldWrapChildren={false}>
|
||||
<MyTooltip label={t('common:core.workflow.tool.Handle')} shouldWrapChildren={false}>
|
||||
<Handle
|
||||
style={{
|
||||
borderRadius: '0',
|
||||
|
||||
@@ -49,7 +49,7 @@ const NodeCard = (props: Props) => {
|
||||
const {
|
||||
children,
|
||||
avatar = LOGO_ICON,
|
||||
name = t('core.module.template.UnKnow Module'),
|
||||
name = t('common:core.module.template.UnKnow Module'),
|
||||
intro,
|
||||
minW = '300px',
|
||||
maxW = '600px',
|
||||
@@ -69,7 +69,7 @@ const NodeCard = (props: Props) => {
|
||||
|
||||
// custom title edit
|
||||
const { onOpenModal: onOpenCustomTitleModal, EditModal: EditTitleModal } = useEditTitle({
|
||||
title: t('common.Custom Title'),
|
||||
title: t('common:common.Custom Title'),
|
||||
placeholder: appT('module.Custom Title Tip') || ''
|
||||
});
|
||||
|
||||
@@ -273,7 +273,7 @@ const MenuRender = React.memo(function MenuRender({
|
||||
const { openDebugNode, DebugInputModal } = useDebug();
|
||||
|
||||
const { openConfirm: onOpenConfirmDeleteNode, ConfirmModal: ConfirmDeleteModal } = useConfirm({
|
||||
content: t('core.module.Confirm Delete Node'),
|
||||
content: t('common:core.module.Confirm Delete Node'),
|
||||
type: 'delete'
|
||||
});
|
||||
|
||||
@@ -338,7 +338,7 @@ const MenuRender = React.memo(function MenuRender({
|
||||
: [
|
||||
{
|
||||
icon: 'core/workflow/debug',
|
||||
label: t('core.workflow.Debug'),
|
||||
label: t('common:core.workflow.Debug'),
|
||||
variant: 'whiteBase',
|
||||
onClick: () => openDebugNode({ entryNodeId: nodeId })
|
||||
}
|
||||
@@ -348,7 +348,7 @@ const MenuRender = React.memo(function MenuRender({
|
||||
: [
|
||||
{
|
||||
icon: 'copy',
|
||||
label: t('common.Copy'),
|
||||
label: t('common:common.Copy'),
|
||||
variant: 'whiteBase',
|
||||
onClick: () => onCopyNode(nodeId)
|
||||
}
|
||||
@@ -358,7 +358,7 @@ const MenuRender = React.memo(function MenuRender({
|
||||
: [
|
||||
{
|
||||
icon: 'delete',
|
||||
label: t('common.Delete'),
|
||||
label: t('common:common.Delete'),
|
||||
variant: 'whiteDanger',
|
||||
onClick: onOpenConfirmDeleteNode(() => onDelNode(nodeId))
|
||||
}
|
||||
@@ -433,7 +433,7 @@ const NodeIntro = React.memo(function NodeIntro({
|
||||
|
||||
// edit intro
|
||||
const { onOpenModal: onOpenIntroModal, EditModal: EditIntroModal } = useEditTextarea({
|
||||
title: t('core.module.Edit intro'),
|
||||
title: t('common:core.module.Edit intro'),
|
||||
tip: '调整该模块会对工具调用时机有影响。\n你可以通过精确的描述该模块功能,引导模型进行工具调用。',
|
||||
canEmpty: false
|
||||
});
|
||||
@@ -463,7 +463,7 @@ const NodeIntro = React.memo(function NodeIntro({
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t('core.module.Edit intro')}
|
||||
{t('common:core.module.Edit intro')}
|
||||
</Button>
|
||||
)}
|
||||
</Flex>
|
||||
@@ -490,29 +490,29 @@ const NodeDebugResponse = React.memo(function NodeDebugResponse({
|
||||
const workflowDebugData = useContextSelector(WorkflowContext, (v) => v.workflowDebugData);
|
||||
|
||||
const { openConfirm, ConfirmModal } = useConfirm({
|
||||
content: t('core.workflow.Confirm stop debug')
|
||||
content: t('common:core.workflow.Confirm stop debug')
|
||||
});
|
||||
|
||||
const RenderStatus = useMemo(() => {
|
||||
const map = {
|
||||
running: {
|
||||
bg: 'primary.50',
|
||||
text: t('core.workflow.Running'),
|
||||
text: t('common:core.workflow.Running'),
|
||||
icon: 'core/workflow/running'
|
||||
},
|
||||
success: {
|
||||
bg: 'green.50',
|
||||
text: t('core.workflow.Success'),
|
||||
text: t('common:core.workflow.Success'),
|
||||
icon: 'core/workflow/runSuccess'
|
||||
},
|
||||
failed: {
|
||||
bg: 'red.50',
|
||||
text: t('core.workflow.Failed'),
|
||||
text: t('common:core.workflow.Failed'),
|
||||
icon: 'core/workflow/runError'
|
||||
},
|
||||
skipped: {
|
||||
bg: 'myGray.50',
|
||||
text: t('core.workflow.Skipped'),
|
||||
text: t('common:core.workflow.Skipped'),
|
||||
icon: 'core/workflow/runSkip'
|
||||
}
|
||||
};
|
||||
@@ -550,8 +550,8 @@ const NodeDebugResponse = React.memo(function NodeDebugResponse({
|
||||
}
|
||||
>
|
||||
{debugResult.showResult
|
||||
? t('core.workflow.debug.Hide result')
|
||||
: t('core.workflow.debug.Show result')}
|
||||
? t('common:core.workflow.debug.Hide result')
|
||||
: t('common:core.workflow.debug.Show result')}
|
||||
</Box>
|
||||
)}
|
||||
</Flex>
|
||||
@@ -572,7 +572,7 @@ const NodeDebugResponse = React.memo(function NodeDebugResponse({
|
||||
<Flex h={'54x'} px={4} mb={1} py={3} alignItems={'center'} borderBottom={'base'}>
|
||||
<MyIcon mr={1} name={'core/workflow/debugResult'} w={'20px'} color={'primary.600'} />
|
||||
<Box fontWeight={'bold'} flex={'1'}>
|
||||
{t('core.workflow.debug.Run result')}
|
||||
{t('common:core.workflow.debug.Run result')}
|
||||
</Box>
|
||||
{workflowDebugData?.nextRunNodes.length !== 0 && (
|
||||
<Button
|
||||
@@ -581,7 +581,7 @@ const NodeDebugResponse = React.memo(function NodeDebugResponse({
|
||||
variant={'whiteDanger'}
|
||||
onClick={onStop}
|
||||
>
|
||||
{t('core.workflow.Stop debug')}
|
||||
{t('common:core.workflow.Stop debug')}
|
||||
</Button>
|
||||
)}
|
||||
{(debugResult.status === 'success' || debugResult.status === 'skipped') &&
|
||||
@@ -595,19 +595,19 @@ const NodeDebugResponse = React.memo(function NodeDebugResponse({
|
||||
variant={'primary'}
|
||||
onClick={() => onNextNodeDebug()}
|
||||
>
|
||||
{t('common.Next Step')}
|
||||
{t('common:common.Next Step')}
|
||||
</Button>
|
||||
)}
|
||||
{workflowDebugData?.nextRunNodes && workflowDebugData?.nextRunNodes.length === 0 && (
|
||||
<Button ml={2} size={'sm'} variant={'primary'} onClick={onStopNodeDebug}>
|
||||
{t('core.workflow.debug.Done')}
|
||||
{t('common:core.workflow.debug.Done')}
|
||||
</Button>
|
||||
)}
|
||||
</Flex>
|
||||
{/* Show result */}
|
||||
<Box maxH={'calc(100%-54px)'} overflow={'auto'}>
|
||||
{!debugResult.message && !response && (
|
||||
<EmptyTip text={t('core.workflow.debug.Not result')} pt={2} pb={5} />
|
||||
<EmptyTip text={t('common:core.workflow.debug.Not result')} pt={2} pb={5} />
|
||||
)}
|
||||
{debugResult.message && (
|
||||
<Box color={'red.600'} px={3} py={4}>
|
||||
|
||||
@@ -149,7 +149,7 @@ const FieldModal = ({
|
||||
{/* key */}
|
||||
<Flex mt={3} alignItems={'center'}>
|
||||
<FormLabel flex={'0 0 70px'} required>
|
||||
{t('core.module.Field Name')}
|
||||
{t('common:core.module.Field Name')}
|
||||
</FormLabel>
|
||||
<Input
|
||||
bg={'myGray.50'}
|
||||
|
||||
@@ -74,7 +74,7 @@ const DynamicInputs = (props: RenderInputProps) => {
|
||||
})
|
||||
}
|
||||
>
|
||||
{t('common.Add New')}
|
||||
{t('common:common.Add New')}
|
||||
</Button>
|
||||
</HStack>
|
||||
{/* field render */}
|
||||
|
||||
@@ -51,7 +51,7 @@ const SelectAppRender = ({ item, nodeId }: RenderInputProps) => {
|
||||
<Box onClick={onOpenSelectApp}>
|
||||
{!value ? (
|
||||
<Button variant={'whiteFlow'} w={'100%'}>
|
||||
{t('core.module.Select app')}
|
||||
{t('common:core.module.Select app')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
|
||||
@@ -73,7 +73,7 @@ const SelectDatasetRender = ({ inputs = [], item, nodeId }: RenderInputProps) =>
|
||||
leftIcon={<MyIcon name={'common/selectLight'} w={'14px'} />}
|
||||
onClick={onOpenDatasetSelect}
|
||||
>
|
||||
{t('common.Choose')}
|
||||
{t('common:common.Choose')}
|
||||
</Button>
|
||||
{selectedDatasets.map((item) => (
|
||||
<Flex
|
||||
|
||||
@@ -65,7 +65,7 @@ const SelectDatasetParam = ({ inputs = [], nodeId }: RenderInputProps) => {
|
||||
<>
|
||||
{/* label */}
|
||||
<Flex alignItems={'center'} mb={3} fontWeight={'medium'} color={'myGray.600'}>
|
||||
{t('core.dataset.search.Params Setting')}
|
||||
{t('common:core.dataset.search.Params Setting')}
|
||||
<MyIcon
|
||||
name={'common/settingLight'}
|
||||
ml={2}
|
||||
|
||||
@@ -78,17 +78,17 @@ const SettingQuotePrompt = (props: RenderInputProps) => {
|
||||
},
|
||||
{
|
||||
key: 'source',
|
||||
label: t('core.dataset.search.Source name'),
|
||||
label: t('common:core.dataset.search.Source name'),
|
||||
icon: 'core/app/simpleMode/variable'
|
||||
},
|
||||
{
|
||||
key: 'sourceId',
|
||||
label: t('core.dataset.search.Source id'),
|
||||
label: t('common:core.dataset.search.Source id'),
|
||||
icon: 'core/app/simpleMode/variable'
|
||||
},
|
||||
{
|
||||
key: 'index',
|
||||
label: t('core.dataset.search.Quote index'),
|
||||
label: t('common:core.dataset.search.Quote index'),
|
||||
icon: 'core/app/simpleMode/variable'
|
||||
},
|
||||
...variables
|
||||
@@ -99,12 +99,12 @@ const SettingQuotePrompt = (props: RenderInputProps) => {
|
||||
() => [
|
||||
{
|
||||
key: 'quote',
|
||||
label: t('core.app.Quote templates'),
|
||||
label: t('common:core.app.Quote templates'),
|
||||
icon: 'core/app/simpleMode/variable'
|
||||
},
|
||||
{
|
||||
key: 'question',
|
||||
label: t('core.module.input.label.user question'),
|
||||
label: t('common:core.module.input.label.user question'),
|
||||
icon: 'core/app/simpleMode/variable'
|
||||
},
|
||||
...variables
|
||||
@@ -152,11 +152,11 @@ const SettingQuotePrompt = (props: RenderInputProps) => {
|
||||
<>
|
||||
<Flex className="nodrag" cursor={'default'} alignItems={'center'} position={'relative'}>
|
||||
<Box position={'relative'} color={'myGray.600'} fontWeight={'medium'}>
|
||||
{t('core.module.Dataset quote.label')}
|
||||
{t('common:core.module.Dataset quote.label')}
|
||||
</Box>
|
||||
<ValueTypeLabel valueType={WorkflowIOValueTypeEnum.datasetQuote} />
|
||||
|
||||
<MyTooltip label={t('core.module.Setting quote prompt')}>
|
||||
<MyTooltip label={t('common:core.module.Setting quote prompt')}>
|
||||
<MyIcon
|
||||
ml={1}
|
||||
name={'common/settingLight'}
|
||||
@@ -173,13 +173,13 @@ const SettingQuotePrompt = (props: RenderInputProps) => {
|
||||
<MyModal
|
||||
isOpen={isOpen}
|
||||
iconSrc={'modal/edit'}
|
||||
title={t('core.module.Quote prompt setting')}
|
||||
title={t('common:core.module.Quote prompt setting')}
|
||||
w={'600px'}
|
||||
>
|
||||
<ModalBody>
|
||||
<Box>
|
||||
<Flex {...LabelStyles} mb={1}>
|
||||
<FormLabel>{t('core.app.Quote templates')}</FormLabel>
|
||||
<FormLabel>{t('common:core.app.Quote templates')}</FormLabel>
|
||||
<QuestionTip
|
||||
ml={1}
|
||||
label={t('template.Quote Content Tip', {
|
||||
@@ -192,19 +192,19 @@ const SettingQuotePrompt = (props: RenderInputProps) => {
|
||||
fontSize={'sm'}
|
||||
onClick={() =>
|
||||
setSelectTemplateData({
|
||||
title: t('core.app.Select quote template'),
|
||||
title: t('common:core.app.Select quote template'),
|
||||
templates: Prompt_QuoteTemplateList
|
||||
})
|
||||
}
|
||||
>
|
||||
{t('common.Select template')}
|
||||
{t('common:common.Select template')}
|
||||
</Box>
|
||||
</Flex>
|
||||
|
||||
<PromptEditor
|
||||
variables={quoteTemplateVariables}
|
||||
h={160}
|
||||
title={t('core.app.Quote templates')}
|
||||
title={t('common:core.app.Quote templates')}
|
||||
placeholder={t('template.Quote Content Tip', {
|
||||
default: Prompt_QuoteTemplateList[0].value
|
||||
})}
|
||||
@@ -216,7 +216,7 @@ const SettingQuotePrompt = (props: RenderInputProps) => {
|
||||
</Box>
|
||||
<Box mt={4}>
|
||||
<Flex {...LabelStyles} mb={1}>
|
||||
<FormLabel>{t('core.app.Quote prompt')}</FormLabel>
|
||||
<FormLabel>{t('common:core.app.Quote prompt')}</FormLabel>
|
||||
<QuestionTip
|
||||
ml={1}
|
||||
label={t('template.Quote Prompt Tip', {
|
||||
@@ -226,7 +226,7 @@ const SettingQuotePrompt = (props: RenderInputProps) => {
|
||||
</Flex>
|
||||
<PromptEditor
|
||||
variables={quotePromptVariables}
|
||||
title={t('core.app.Quote prompt')}
|
||||
title={t('common:core.app.Quote prompt')}
|
||||
h={280}
|
||||
placeholder={t('template.Quote Prompt Tip', {
|
||||
default: Prompt_QuotePromptList[0].value
|
||||
@@ -240,9 +240,9 @@ const SettingQuotePrompt = (props: RenderInputProps) => {
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button variant={'whiteBase'} mr={2} onClick={onClose}>
|
||||
{t('common.Close')}
|
||||
{t('common:common.Close')}
|
||||
</Button>
|
||||
<Button onClick={handleSubmit(onSubmit)}>{t('common.Confirm')}</Button>
|
||||
<Button onClick={handleSubmit(onSubmit)}>{t('common:common.Confirm')}</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
{!!selectTemplateData && (
|
||||
|
||||
@@ -144,7 +144,7 @@ const FieldModal = ({
|
||||
{/* key */}
|
||||
<Flex mt={3} alignItems={'center'}>
|
||||
<FormLabel flex={'0 0 70px'} required>
|
||||
{t('core.module.Field Name')}
|
||||
{t('common:core.module.Field Name')}
|
||||
</FormLabel>
|
||||
<Input
|
||||
bg={'myGray.50'}
|
||||
|
||||
@@ -78,7 +78,7 @@ const RenderOutput = ({
|
||||
position={'relative'}
|
||||
>
|
||||
<Box position={'relative'} fontWeight={'medium'}>
|
||||
{t('core.workflow.Custom outputs')}
|
||||
{t('common:core.workflow.Custom outputs')}
|
||||
</Box>
|
||||
{addOutput.description && <QuestionTip ml={1} label={addOutput.description} />}
|
||||
<Box flex={'1 0 0'} />
|
||||
@@ -91,7 +91,7 @@ const RenderOutput = ({
|
||||
setEditField(defaultOutput);
|
||||
}}
|
||||
>
|
||||
{t('common.Add New')}
|
||||
{t('common:common.Add New')}
|
||||
</Button>
|
||||
</Flex>
|
||||
<VariableTable
|
||||
|
||||
@@ -88,11 +88,11 @@ const EditFieldModal = ({
|
||||
<MyModal isOpen iconSrc="modal/edit" title={'工具字段参数配置'} onClose={onClose}>
|
||||
<ModalBody>
|
||||
<Flex alignItems={'center'} mb={5}>
|
||||
<Box flex={'0 0 80px'}>{t('common.Require Input')}</Box>
|
||||
<Box flex={'0 0 80px'}>{t('common:common.Require Input')}</Box>
|
||||
<Switch {...register('required')} />
|
||||
</Flex>
|
||||
<Flex alignItems={'center'} mb={5}>
|
||||
<Box flex={'0 0 80px'}>{t('core.module.Data Type')}</Box>
|
||||
<Box flex={'0 0 80px'}>{t('common:core.module.Data Type')}</Box>
|
||||
<Box flex={'1 0 0'}>
|
||||
<MySelect
|
||||
list={fnValueTypeSelect}
|
||||
@@ -104,7 +104,7 @@ const EditFieldModal = ({
|
||||
</Box>
|
||||
</Flex>
|
||||
<Flex alignItems={'center'} mb={5}>
|
||||
<Box flex={'0 0 80px'}>{t('core.module.Field Name')}</Box>
|
||||
<Box flex={'0 0 80px'}>{t('common:core.module.Field Name')}</Box>
|
||||
<Input
|
||||
bg={'myGray.50'}
|
||||
{...register('key', {
|
||||
@@ -117,7 +117,7 @@ const EditFieldModal = ({
|
||||
/>
|
||||
</Flex>
|
||||
<Box mb={5}>
|
||||
<Box flex={'0 0 80px'}>{t('core.module.Field Description')}</Box>
|
||||
<Box flex={'0 0 80px'}>{t('common:core.module.Field Description')}</Box>
|
||||
<Textarea
|
||||
bg={'myGray.50'}
|
||||
rows={5}
|
||||
@@ -129,10 +129,10 @@ const EditFieldModal = ({
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button variant={'whiteBase'} mr={2} onClick={onClose}>
|
||||
{t('common.Close')}
|
||||
{t('common:common.Close')}
|
||||
</Button>
|
||||
<Button onClick={handleSubmit((data) => onclickSubmit(data), onclickSubmitError)}>
|
||||
{t('common.Confirm')}
|
||||
{t('common:common.Confirm')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
|
||||
@@ -45,7 +45,7 @@ const RenderToolInput = ({
|
||||
return (
|
||||
<>
|
||||
<HStack mb={2} justifyContent={'space-between'}>
|
||||
<IOTitle text={t('core.module.tool.Tool input')} mb={0} />
|
||||
<IOTitle text={t('common:core.module.tool.Tool input')} mb={0} />
|
||||
{dynamicInput && (
|
||||
<Button
|
||||
variant={'whiteBase'}
|
||||
@@ -54,7 +54,7 @@ const RenderToolInput = ({
|
||||
size={'sm'}
|
||||
onClick={() => setEditField(defaultEditFormData)}
|
||||
>
|
||||
{t('Add new')}
|
||||
{t('common:Add new')}
|
||||
</Button>
|
||||
)}
|
||||
</HStack>
|
||||
|
||||
@@ -502,13 +502,13 @@ const WorkflowContextProvider = ({
|
||||
checkResults.forEach((nodeId) => onUpdateNodeError(nodeId, true));
|
||||
toast({
|
||||
status: 'warning',
|
||||
title: t('core.workflow.Check Failed')
|
||||
title: t('common:core.workflow.Check Failed')
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
/* save workflow */
|
||||
const [saveLabel, setSaveLabel] = useState(t('core.app.Onclick to save'));
|
||||
const [saveLabel, setSaveLabel] = useState(t('common:core.app.Onclick to save'));
|
||||
const { runAsync: onSaveWorkflow, loading: isSaving } = useRequest2(async () => {
|
||||
const { nodes } = await getWorkflowStore();
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ const AppContextProvider = ({ children }: { children: ReactNode }) => {
|
||||
{
|
||||
manual: false,
|
||||
refreshDeps: [appId],
|
||||
errorToast: t('core.app.error.Get app failed'),
|
||||
errorToast: t('common:core.app.error.Get app failed'),
|
||||
onError(err: any) {
|
||||
router.replace('/app/list');
|
||||
},
|
||||
@@ -180,8 +180,8 @@ const AppContextProvider = ({ children }: { children: ReactNode }) => {
|
||||
onSuccess() {
|
||||
router.replace(`/app/list`);
|
||||
},
|
||||
successToast: t('common.Delete Success'),
|
||||
errorToast: t('common.Delete Failed')
|
||||
successToast: t('common:common.Delete Success'),
|
||||
errorToast: t('common:common.Delete Failed')
|
||||
}
|
||||
);
|
||||
const onDelApp = useCallback(() => openConfirmDel(deleteApp)(), [deleteApp, openConfirmDel]);
|
||||
|
||||
@@ -98,7 +98,7 @@ const CreateModal = ({ onClose, type }: { type: CreateAppType; onClose: () => vo
|
||||
setValue('avatar', src);
|
||||
} catch (err: any) {
|
||||
toast({
|
||||
title: getErrText(err, t('common.error.Select avatar failed')),
|
||||
title: getErrText(err, t('common:common.error.Select avatar failed')),
|
||||
status: 'warning'
|
||||
});
|
||||
}
|
||||
@@ -110,7 +110,7 @@ const CreateModal = ({ onClose, type }: { type: CreateAppType; onClose: () => vo
|
||||
mutationFn: async (data: FormType) => {
|
||||
const template = typeData.templates.find((item) => item.id === data.templateId);
|
||||
if (!template) {
|
||||
return Promise.reject(t('core.dataset.error.Template does not exist'));
|
||||
return Promise.reject(t('common:core.dataset.error.Template does not exist'));
|
||||
}
|
||||
return postCreateApp({
|
||||
parentId,
|
||||
@@ -126,8 +126,8 @@ const CreateModal = ({ onClose, type }: { type: CreateAppType; onClose: () => vo
|
||||
loadMyApps();
|
||||
onClose();
|
||||
},
|
||||
successToast: t('common.Create Success'),
|
||||
errorToast: t('common.Create Failed')
|
||||
successToast: t('common:common.Create Success'),
|
||||
errorToast: t('common:common.Create Failed')
|
||||
});
|
||||
|
||||
return (
|
||||
@@ -140,10 +140,10 @@ const CreateModal = ({ onClose, type }: { type: CreateAppType; onClose: () => vo
|
||||
>
|
||||
<ModalBody>
|
||||
<Box color={'myGray.800'} fontWeight={'bold'}>
|
||||
{t('common.Set Name')}
|
||||
{t('common:common.Set Name')}
|
||||
</Box>
|
||||
<Flex mt={2} alignItems={'center'}>
|
||||
<MyTooltip label={t('common.Set Avatar')}>
|
||||
<MyTooltip label={t('common:common.Set Avatar')}>
|
||||
<Avatar
|
||||
flexShrink={0}
|
||||
src={avatar}
|
||||
@@ -160,12 +160,12 @@ const CreateModal = ({ onClose, type }: { type: CreateAppType; onClose: () => vo
|
||||
autoFocus
|
||||
bg={'myWhite.600'}
|
||||
{...register('name', {
|
||||
required: t('core.app.error.App name can not be empty')
|
||||
required: t('common:core.app.error.App name can not be empty')
|
||||
})}
|
||||
/>
|
||||
</Flex>
|
||||
<Box mt={[4, 7]} mb={[0, 3]} color={'myGray.800'} fontWeight={'bold'}>
|
||||
{t('core.app.Select app from template')}
|
||||
{t('common:core.app.Select app from template')}
|
||||
</Box>
|
||||
<Grid
|
||||
userSelect={'none'}
|
||||
@@ -210,10 +210,10 @@ const CreateModal = ({ onClose, type }: { type: CreateAppType; onClose: () => vo
|
||||
|
||||
<ModalFooter>
|
||||
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
|
||||
{t('common.Close')}
|
||||
{t('common:common.Close')}
|
||||
</Button>
|
||||
<Button px={6} isLoading={creating} onClick={handleSubmit((data) => onclickCreate(data))}>
|
||||
{t('common.Confirm Create')}
|
||||
{t('common:common.Confirm Create')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
|
||||
|
||||
@@ -101,8 +101,8 @@ const HttpPluginEditModal = ({
|
||||
loadMyApps();
|
||||
onClose();
|
||||
},
|
||||
successToast: t('common.Create Success'),
|
||||
errorToast: t('common.Create Failed')
|
||||
successToast: t('common:common.Create Success'),
|
||||
errorToast: t('common:common.Create Failed')
|
||||
});
|
||||
|
||||
const { mutate: updatePlugins, isLoading: isUpdating } = useRequest({
|
||||
@@ -121,8 +121,8 @@ const HttpPluginEditModal = ({
|
||||
loadMyApps();
|
||||
onClose();
|
||||
},
|
||||
successToast: t('common.Update Success'),
|
||||
errorToast: t('common.Update Failed')
|
||||
successToast: t('common:common.Update Success'),
|
||||
errorToast: t('common:common.Update Failed')
|
||||
});
|
||||
|
||||
const { File, onOpen: onOpenSelectFile } = useSelectFile({
|
||||
@@ -144,7 +144,7 @@ const HttpPluginEditModal = ({
|
||||
setValue('avatar', src);
|
||||
} catch (err: any) {
|
||||
toast({
|
||||
title: getErrText(err, t('common.Select File Failed')),
|
||||
title: getErrText(err, t('common:common.Select File Failed')),
|
||||
status: 'warning'
|
||||
});
|
||||
}
|
||||
@@ -157,7 +157,7 @@ const HttpPluginEditModal = ({
|
||||
mutationFn: async () => {
|
||||
if (!schemaUrl || !schemaUrl.startsWith('https://')) {
|
||||
return toast({
|
||||
title: t('plugin.Invalid URL'),
|
||||
title: t('common:plugin.Invalid URL'),
|
||||
status: 'warning'
|
||||
});
|
||||
}
|
||||
@@ -165,7 +165,7 @@ const HttpPluginEditModal = ({
|
||||
const schema = await getApiSchemaByUrl(schemaUrl);
|
||||
setValue('pluginData.apiSchemaStr', JSON.stringify(schema, null, 2));
|
||||
},
|
||||
errorToast: t('plugin.Invalid Schema')
|
||||
errorToast: t('common:plugin.Invalid Schema')
|
||||
});
|
||||
|
||||
const leftVariables = useMemo(
|
||||
@@ -187,7 +187,7 @@ const HttpPluginEditModal = ({
|
||||
} catch (err) {
|
||||
toast({
|
||||
status: 'warning',
|
||||
title: t('plugin.Invalid Schema')
|
||||
title: t('common:plugin.Invalid Schema')
|
||||
});
|
||||
setApiData({ pathData: [], serverPath: '' });
|
||||
}
|
||||
@@ -200,7 +200,7 @@ const HttpPluginEditModal = ({
|
||||
isOpen
|
||||
onClose={onClose}
|
||||
iconSrc="core/app/type/httpPluginFill"
|
||||
title={isEdit ? t('plugin.Edit Http Plugin') : t('plugin.Import Plugin')}
|
||||
title={isEdit ? t('common:plugin.Edit Http Plugin') : t('common:plugin.Import Plugin')}
|
||||
w={['90vw', '600px']}
|
||||
h={['90vh', '80vh']}
|
||||
position={'relative'}
|
||||
@@ -208,10 +208,10 @@ const HttpPluginEditModal = ({
|
||||
<ModalBody flex={'1 0 0'} overflow={'auto'}>
|
||||
<>
|
||||
<Box color={'myGray.800'} fontWeight={'bold'}>
|
||||
{t('plugin.Set Name')}
|
||||
{t('common:plugin.Set Name')}
|
||||
</Box>
|
||||
<Flex mt={3} alignItems={'center'}>
|
||||
<MyTooltip label={t('common.Set Avatar')}>
|
||||
<MyTooltip label={t('common:common.Set Avatar')}>
|
||||
<Avatar
|
||||
flexShrink={0}
|
||||
src={avatar}
|
||||
@@ -233,14 +233,14 @@ const HttpPluginEditModal = ({
|
||||
</Flex>
|
||||
<>
|
||||
<Box color={'myGray.800'} fontWeight={'bold'} mt={3}>
|
||||
{t('plugin.Intro')}
|
||||
{t('common:plugin.Intro')}
|
||||
</Box>
|
||||
<Textarea
|
||||
{...register('intro')}
|
||||
bg={'myWhite.600'}
|
||||
rows={3}
|
||||
mt={3}
|
||||
placeholder={t('core.plugin.Http plugin intro placeholder')}
|
||||
placeholder={t('common:core.plugin.Http plugin intro placeholder')}
|
||||
/>
|
||||
</>
|
||||
</>
|
||||
@@ -258,7 +258,7 @@ const HttpPluginEditModal = ({
|
||||
<Flex alignItems={'center'}>
|
||||
<Input
|
||||
mr={2}
|
||||
placeholder={t('plugin.Import from URL')}
|
||||
placeholder={t('common:plugin.Import from URL')}
|
||||
h={'30px'}
|
||||
w={['150px', '250px']}
|
||||
fontSize={'sm'}
|
||||
@@ -270,7 +270,7 @@ const HttpPluginEditModal = ({
|
||||
isLoading={isLoadingUrlApi}
|
||||
onClick={onClickUrlLoadApi}
|
||||
>
|
||||
{t('common.Import')}
|
||||
{t('common:common.Import')}
|
||||
</Button>
|
||||
</Flex>
|
||||
</Box>
|
||||
@@ -289,7 +289,7 @@ const HttpPluginEditModal = ({
|
||||
</Box>
|
||||
<>
|
||||
<Box color={'myGray.800'} fontWeight={'bold'} mt={3}>
|
||||
{t('core.plugin.Custom headers')}
|
||||
{t('common:core.plugin.Custom headers')}
|
||||
</Box>
|
||||
<Box
|
||||
mt={1}
|
||||
@@ -303,10 +303,10 @@ const HttpPluginEditModal = ({
|
||||
<Thead>
|
||||
<Tr>
|
||||
<Th px={2} borderRadius="none !important">
|
||||
{t('core.module.http.Props name')}
|
||||
{t('common:core.module.http.Props name')}
|
||||
</Th>
|
||||
<Th px={2} borderRadius="none !important">
|
||||
{t('core.module.http.Props value')}
|
||||
{t('common:core.module.http.Props value')}
|
||||
</Th>
|
||||
</Tr>
|
||||
</Thead>
|
||||
@@ -334,7 +334,7 @@ const HttpPluginEditModal = ({
|
||||
});
|
||||
setUpdateTrigger((prev) => !prev);
|
||||
}}
|
||||
placeholder={t('core.module.http.Props name')}
|
||||
placeholder={t('common:core.module.http.Props name')}
|
||||
value={item.key}
|
||||
variables={leftVariables}
|
||||
onBlur={(val) => {
|
||||
@@ -359,7 +359,7 @@ const HttpPluginEditModal = ({
|
||||
<Td p={0}>
|
||||
<Box display={'flex'} alignItems={'center'}>
|
||||
<HttpInput
|
||||
placeholder={t('core.module.http.Props value')}
|
||||
placeholder={t('common:core.module.http.Props value')}
|
||||
hasVariablePlugin={false}
|
||||
value={item.value}
|
||||
onBlur={(val) =>
|
||||
@@ -423,7 +423,7 @@ const HttpPluginEditModal = ({
|
||||
});
|
||||
setUpdateTrigger((prev) => !prev);
|
||||
}}
|
||||
placeholder={t('core.module.http.Add props')}
|
||||
placeholder={t('common:core.module.http.Add props')}
|
||||
value={''}
|
||||
variables={leftVariables}
|
||||
updateTrigger={updateTrigger}
|
||||
@@ -458,7 +458,7 @@ const HttpPluginEditModal = ({
|
||||
</>
|
||||
<>
|
||||
<Box color={'myGray.800'} fontWeight={'bold'} mt={3}>
|
||||
{t('plugin.Plugin List')}
|
||||
{t('common:plugin.Plugin List')}
|
||||
</Box>
|
||||
<Box
|
||||
mt={3}
|
||||
@@ -470,10 +470,10 @@ const HttpPluginEditModal = ({
|
||||
<TableContainer maxH={400} overflowY={'auto'}>
|
||||
<Table bg={'white'}>
|
||||
<Thead bg={'myGray.50'}>
|
||||
<Th>{t('Name')}</Th>
|
||||
<Th>{t('plugin.Description')}</Th>
|
||||
<Th>{t('plugin.Method')}</Th>
|
||||
<Th>{t('plugin.Path')}</Th>
|
||||
<Th>{t('common:Name')}</Th>
|
||||
<Th>{t('common:plugin.Description')}</Th>
|
||||
<Th>{t('common:plugin.Method')}</Th>
|
||||
<Th>{t('common:plugin.Path')}</Th>
|
||||
</Thead>
|
||||
<Tbody>
|
||||
{apiData.pathData?.map((item, index) => (
|
||||
@@ -501,7 +501,7 @@ const HttpPluginEditModal = ({
|
||||
|
||||
<ModalFooter>
|
||||
<Button variant={'whiteBase'} mr={3} onClick={onClose}>
|
||||
{t('common.Close')}
|
||||
{t('common:common.Close')}
|
||||
</Button>
|
||||
{!isEdit ? (
|
||||
<Button
|
||||
@@ -509,7 +509,7 @@ const HttpPluginEditModal = ({
|
||||
onClick={handleSubmit((data) => onCreate(data))}
|
||||
isLoading={isCreating}
|
||||
>
|
||||
{t('common.Confirm Create')}
|
||||
{t('common:common.Confirm Create')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
@@ -517,7 +517,7 @@ const HttpPluginEditModal = ({
|
||||
isLoading={isUpdating}
|
||||
onClick={handleSubmit((data) => updatePlugins(data))}
|
||||
>
|
||||
{t('common.Confirm Update')}
|
||||
{t('common:common.Confirm Update')}
|
||||
</Button>
|
||||
)}
|
||||
</ModalFooter>
|
||||
|
||||
@@ -89,8 +89,8 @@ const ListItem = () => {
|
||||
onSuccess() {
|
||||
loadMyApps();
|
||||
},
|
||||
successToast: t('common.Delete Success'),
|
||||
errorToast: t('common.Delete Failed')
|
||||
successToast: t('common:common.Delete Success'),
|
||||
errorToast: t('common:common.Delete Failed')
|
||||
}
|
||||
);
|
||||
|
||||
@@ -142,7 +142,7 @@ const ListItem = () => {
|
||||
h="100%"
|
||||
label={
|
||||
app.type === AppTypeEnum.folder
|
||||
? t('common.folder.Open folder')
|
||||
? t('common:common.folder.Open folder')
|
||||
: app.permission.hasWritePer
|
||||
? appT('Edit app')
|
||||
: appT('Go to chat')
|
||||
@@ -315,7 +315,7 @@ const ListItem = () => {
|
||||
: [
|
||||
{
|
||||
icon: 'common/file/move',
|
||||
label: t('common.folder.Move to'),
|
||||
label: t('common:common.folder.Move to'),
|
||||
onClick: () => setMoveAppId(app._id)
|
||||
}
|
||||
]),
|
||||
@@ -323,7 +323,7 @@ const ListItem = () => {
|
||||
? [
|
||||
{
|
||||
icon: 'support/team/key',
|
||||
label: t('permission.Permission'),
|
||||
label: t('common:permission.Permission'),
|
||||
onClick: () => setEditPerAppIndex(index)
|
||||
}
|
||||
]
|
||||
@@ -352,7 +352,7 @@ const ListItem = () => {
|
||||
{
|
||||
type: 'danger' as 'danger',
|
||||
icon: 'delete',
|
||||
label: t('common.Delete'),
|
||||
label: t('common:common.Delete'),
|
||||
onClick: () =>
|
||||
openConfirmDel(
|
||||
() => onclickDelApp(app._id),
|
||||
|
||||
@@ -186,7 +186,7 @@ const MyApps = () => {
|
||||
iconSize="1.5rem"
|
||||
Button={
|
||||
<Button variant={'primary'} leftIcon={<AddIcon />}>
|
||||
<Box>{t('common.Create New')}</Box>
|
||||
<Box>{t('common:common.Create New')}</Box>
|
||||
</Button>
|
||||
}
|
||||
menuList={[
|
||||
@@ -222,7 +222,7 @@ const MyApps = () => {
|
||||
children: [
|
||||
{
|
||||
icon: FolderIcon,
|
||||
label: t('Folder'),
|
||||
label: t('common:Folder'),
|
||||
onClick: () => setEditFolder({})
|
||||
}
|
||||
]
|
||||
|
||||
@@ -52,7 +52,7 @@ const ChatHeader = ({
|
||||
<MyIcon name={'history'} w={'14px'} />
|
||||
<Box ml={1}>
|
||||
{history.length === 0
|
||||
? t('core.chat.New Chat')
|
||||
? t('common:core.chat.New Chat')
|
||||
: t('core.chat.History Amount', { amount: history.length })}
|
||||
</Box>
|
||||
</MyTag>
|
||||
|
||||
@@ -86,7 +86,7 @@ const ChatHistorySlider = ({
|
||||
customTitle: item.customTitle,
|
||||
top: item.top
|
||||
}));
|
||||
const newChat: HistoryItemType = { id: activeChatId, title: t('core.chat.New Chat') };
|
||||
const newChat: HistoryItemType = { id: activeChatId, title: t('common:core.chat.New Chat') };
|
||||
const activeChat = histories.find((item) => item.chatId === activeChatId);
|
||||
|
||||
return !activeChat ? [newChat].concat(formatHistories) : formatHistories;
|
||||
@@ -94,8 +94,8 @@ const ChatHistorySlider = ({
|
||||
|
||||
// custom title edit
|
||||
const { onOpenModal, EditModal: EditTitleModal } = useEditTitle({
|
||||
title: t('core.chat.Custom History Title'),
|
||||
placeholder: t('core.chat.Custom History Title Description')
|
||||
title: t('common:core.chat.Custom History Title'),
|
||||
placeholder: t('common:core.chat.Custom History Title Description')
|
||||
});
|
||||
const { openConfirm, ConfirmModal } = useConfirm({
|
||||
content: confirmClearText
|
||||
@@ -164,12 +164,12 @@ const ChatHistorySlider = ({
|
||||
}}
|
||||
list={[
|
||||
...(isTeamChat
|
||||
? [{ label: t('App'), value: TabEnum.recently }]
|
||||
? [{ label: t('common:App'), value: TabEnum.recently }]
|
||||
: [
|
||||
{ label: t('core.chat.Recent use'), value: TabEnum.recently },
|
||||
{ label: t('App'), value: TabEnum.app }
|
||||
{ label: t('common:core.chat.Recent use'), value: TabEnum.recently },
|
||||
{ label: t('common:App'), value: TabEnum.app }
|
||||
]),
|
||||
{ label: t('core.chat.History'), value: TabEnum.history }
|
||||
{ label: t('common:core.chat.History'), value: TabEnum.history }
|
||||
]}
|
||||
value={currentTab}
|
||||
onChange={setCurrentTab}
|
||||
@@ -186,7 +186,7 @@ const ChatHistorySlider = ({
|
||||
overflow={'hidden'}
|
||||
onClick={() => onChangeChatId()}
|
||||
>
|
||||
{t('core.chat.New Chat')}
|
||||
{t('common:core.chat.New Chat')}
|
||||
</Button>
|
||||
{/* Clear */}
|
||||
{isPc && (
|
||||
@@ -266,7 +266,9 @@ const ChatHistorySlider = ({
|
||||
...(onSetHistoryTop
|
||||
? [
|
||||
{
|
||||
label: item.top ? t('core.chat.Unpin') : t('core.chat.Pin'),
|
||||
label: item.top
|
||||
? t('common:core.chat.Unpin')
|
||||
: t('common:core.chat.Pin'),
|
||||
icon: 'core/chat/setTopLight',
|
||||
onClick: () => {
|
||||
onSetHistoryTop({ chatId: item.id, top: !item.top });
|
||||
@@ -277,7 +279,7 @@ const ChatHistorySlider = ({
|
||||
...(onSetCustomTitle
|
||||
? [
|
||||
{
|
||||
label: t('common.Custom Title'),
|
||||
label: t('common:common.Custom Title'),
|
||||
icon: 'common/customTitleLight',
|
||||
onClick: () => {
|
||||
onOpenModal({
|
||||
@@ -293,7 +295,7 @@ const ChatHistorySlider = ({
|
||||
]
|
||||
: []),
|
||||
{
|
||||
label: t('common.Delete'),
|
||||
label: t('common:common.Delete'),
|
||||
icon: 'delete',
|
||||
onClick: () => {
|
||||
onDelHistory({ chatId: item.id });
|
||||
@@ -374,7 +376,7 @@ const ChatHistorySlider = ({
|
||||
borderRadius={'50%'}
|
||||
aria-label={''}
|
||||
/>
|
||||
{t('core.chat.Exit Chat')}
|
||||
{t('common:core.chat.Exit Chat')}
|
||||
</Flex>
|
||||
)}
|
||||
<EditTitleModal />
|
||||
|
||||
@@ -22,7 +22,7 @@ const CustomPluginRunBox = (props: PluginRunBoxProps) => {
|
||||
<Grid gridTemplateColumns={'450px 1fr'} h={'100%'}>
|
||||
<Box px={3} py={4} borderRight={'base'} h={'100%'} overflowY={'auto'} w={'100%'}>
|
||||
<Box color={'myGray.900'} mb={5}>
|
||||
{t('common.Input')}
|
||||
{t('common:common.Input')}
|
||||
</Box>
|
||||
<PluginRunBox {...props} tab={PluginRunBoxTabEnum.input} />
|
||||
</Box>
|
||||
@@ -30,7 +30,7 @@ const CustomPluginRunBox = (props: PluginRunBoxProps) => {
|
||||
<Box display={'inline-block'} mb={5}>
|
||||
<LightRowTabs<PluginRunBoxTabEnum>
|
||||
list={[
|
||||
{ label: t('common.Output'), value: PluginRunBoxTabEnum.output },
|
||||
{ label: t('common:common.Output'), value: PluginRunBoxTabEnum.output },
|
||||
{ label: '完整结果', value: PluginRunBoxTabEnum.detail }
|
||||
]}
|
||||
value={tab}
|
||||
@@ -50,8 +50,8 @@ const CustomPluginRunBox = (props: PluginRunBoxProps) => {
|
||||
<Stack py={2} px={4} h={'100%'}>
|
||||
<LightRowTabs<PluginRunBoxTabEnum>
|
||||
list={[
|
||||
{ label: t('common.Input'), value: PluginRunBoxTabEnum.input },
|
||||
{ label: t('common.Output'), value: PluginRunBoxTabEnum.output },
|
||||
{ label: t('common:common.Input'), value: PluginRunBoxTabEnum.input },
|
||||
{ label: t('common:common.Output'), value: PluginRunBoxTabEnum.output },
|
||||
{ label: '完整结果', value: PluginRunBoxTabEnum.detail }
|
||||
]}
|
||||
value={tab}
|
||||
|
||||
@@ -71,7 +71,7 @@ const SliderApps = ({ apps, activeAppId }: { apps: AppListItemType[]; activeAppI
|
||||
borderRadius={'50%'}
|
||||
aria-label={''}
|
||||
/>
|
||||
{t('core.chat.Exit Chat')}
|
||||
{t('common:core.chat.Exit Chat')}
|
||||
</Flex>
|
||||
)}
|
||||
</Box>
|
||||
@@ -86,7 +86,7 @@ const SliderApps = ({ apps, activeAppId }: { apps: AppListItemType[]; activeAppI
|
||||
fontSize={'sm'}
|
||||
justifyContent={'space-between'}
|
||||
>
|
||||
<Box>{t('core.chat.Recent use')}</Box>
|
||||
<Box>{t('common:core.chat.Recent use')}</Box>
|
||||
<MyPopover
|
||||
placement="bottom-end"
|
||||
offset={[20, 10]}
|
||||
@@ -104,7 +104,7 @@ const SliderApps = ({ apps, activeAppId }: { apps: AppListItemType[]; activeAppI
|
||||
bg: 'myGray.200'
|
||||
}}
|
||||
>
|
||||
<Box>{t('common.More')}</Box>
|
||||
<Box>{t('common:common.More')}</Box>
|
||||
<MyIcon name={'common/select'} w={'1rem'} />
|
||||
</HStack>
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ const ToolMenu = ({ history }: { history: ChatItemType[] }) => {
|
||||
children: [
|
||||
{
|
||||
icon: 'core/chat/chatLight',
|
||||
label: t('core.chat.New Chat'),
|
||||
label: t('common:core.chat.New Chat'),
|
||||
onClick: () => {
|
||||
router.replace({
|
||||
query: {
|
||||
@@ -43,17 +43,17 @@ const ToolMenu = ({ history }: { history: ChatItemType[] }) => {
|
||||
children: [
|
||||
// {
|
||||
// icon: 'core/app/appApiLight',
|
||||
// label: `HTML ${t('Export')}`,
|
||||
// label: `HTML ${t('common:Export')}`,
|
||||
// onClick: () => onExportChat({ type: 'html', history })
|
||||
// },
|
||||
{
|
||||
icon: 'file/markdown',
|
||||
label: `Markdown ${t('Export')}`,
|
||||
label: `Markdown ${t('common:Export')}`,
|
||||
onClick: () => onExportChat({ type: 'md', history })
|
||||
}
|
||||
// {
|
||||
// icon: 'core/chat/export/pdf',
|
||||
// label: `PDF ${t('Export')}`,
|
||||
// label: `PDF ${t('common:Export')}`,
|
||||
// onClick: () => onExportChat({ type: 'pdf', history })
|
||||
// }
|
||||
]
|
||||
|
||||
@@ -196,7 +196,7 @@ const Chat = ({
|
||||
})(
|
||||
<ChatHistorySlider
|
||||
apps={myApps}
|
||||
confirmClearText={t('core.chat.Confirm to clear history')}
|
||||
confirmClearText={t('common:core.chat.Confirm to clear history')}
|
||||
appId={appId}
|
||||
appName={chatData.app.name}
|
||||
appAvatar={chatData.app.avatar}
|
||||
@@ -313,7 +313,7 @@ const Render = (props: Props) => {
|
||||
if (apps.length === 0) {
|
||||
toast({
|
||||
status: 'error',
|
||||
title: t('core.chat.You need to a chat app')
|
||||
title: t('common:core.chat.You need to a chat app')
|
||||
});
|
||||
router.replace('/app/list');
|
||||
} else {
|
||||
|
||||
@@ -253,7 +253,7 @@ const OutLink = ({ appName, appIntro, appAvatar }: Props) => {
|
||||
<ChatHistorySlider
|
||||
appName={chatData.app.name}
|
||||
appAvatar={chatData.app.avatar}
|
||||
confirmClearText={t('core.chat.Confirm to clear share chat history')}
|
||||
confirmClearText={t('common:core.chat.Confirm to clear share chat history')}
|
||||
onDelHistory={({ chatId }) =>
|
||||
onDelHistory({ appId: chatData.appId, chatId, shareId, outLinkUid })
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ const Chat = ({ myApps }: { myApps: AppListItemType[] }) => {
|
||||
refreshDeps: [teamId, teamToken, appId, chatId],
|
||||
onError(e: any) {
|
||||
toast({
|
||||
title: getErrText(e, t('core.chat.Failed to initialize chat')),
|
||||
title: getErrText(e, t('common:core.chat.Failed to initialize chat')),
|
||||
status: 'error'
|
||||
});
|
||||
if (chatId) {
|
||||
@@ -202,7 +202,7 @@ const Chat = ({ myApps }: { myApps: AppListItemType[] }) => {
|
||||
apps={myApps}
|
||||
appName={chatData.app.name}
|
||||
appAvatar={chatData.app.avatar}
|
||||
confirmClearText={t('core.chat.Confirm to clear history')}
|
||||
confirmClearText={t('common:core.chat.Confirm to clear history')}
|
||||
onDelHistory={(e) => onDelHistory({ ...e, appId, teamId, teamToken })}
|
||||
onClearHistory={() => {
|
||||
onClearHistories({ appId, teamId, teamToken });
|
||||
|
||||
@@ -22,10 +22,10 @@ const EditFolderModal = ({
|
||||
() =>
|
||||
isEdit
|
||||
? {
|
||||
title: t('dataset.Edit Folder')
|
||||
title: t('common:dataset.Edit Folder')
|
||||
}
|
||||
: {
|
||||
title: t('dataset.Create Folder')
|
||||
title: t('common:dataset.Create Folder')
|
||||
},
|
||||
[isEdit, t]
|
||||
);
|
||||
@@ -47,14 +47,14 @@ const EditFolderModal = ({
|
||||
<Input
|
||||
ref={inputRef}
|
||||
defaultValue={name}
|
||||
placeholder={t('dataset.Folder Name') || ''}
|
||||
placeholder={t('common:dataset.Folder Name') || ''}
|
||||
autoFocus
|
||||
maxLength={20}
|
||||
/>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button isLoading={isLoading} onClick={onSave}>
|
||||
{t('common.Confirm')}
|
||||
{t('common:common.Confirm')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
|
||||
@@ -22,7 +22,7 @@ function MemberManager({ managePer }: { managePer: MemberManagerInputPropsType }
|
||||
leftIcon={<MyIcon w="4" name="common/settingLight" />}
|
||||
onClick={onOpenManageModal}
|
||||
>
|
||||
{t('permission.Manage')}
|
||||
{t('common:permission.Manage')}
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
@@ -30,7 +30,7 @@ function MemberManager({ managePer }: { managePer: MemberManagerInputPropsType }
|
||||
leftIcon={<MyIcon w="4" name="support/permission/collaborator" />}
|
||||
onClick={onOpenAddMember}
|
||||
>
|
||||
{t('common.Add')}
|
||||
{t('common:common.Add')}
|
||||
</Button>
|
||||
</Flex>
|
||||
</Flex>
|
||||
|
||||
@@ -67,7 +67,7 @@ const CollectionPageContextProvider = ({ children }: { children: ReactNode }) =>
|
||||
|
||||
// website config
|
||||
const { openConfirm: openWebSyncConfirm, ConfirmModal: ConfirmWebSyncModal } = useConfirm({
|
||||
content: t('core.dataset.collection.Start Sync Tip')
|
||||
content: t('common:core.dataset.collection.Start Sync Tip')
|
||||
});
|
||||
const {
|
||||
isOpen: isOpenWebsiteModal,
|
||||
@@ -84,14 +84,14 @@ const CollectionPageContextProvider = ({ children }: { children: ReactNode }) =>
|
||||
status: DatasetStatusEnum.syncing
|
||||
});
|
||||
const billId = await postCreateTrainingUsage({
|
||||
name: t('core.dataset.training.Website Sync'),
|
||||
name: t('common:core.dataset.training.Website Sync'),
|
||||
datasetId: datasetId
|
||||
});
|
||||
await postWebsiteSync({ datasetId: datasetId, billId });
|
||||
|
||||
return;
|
||||
},
|
||||
errorToast: t('common.Update Failed')
|
||||
errorToast: t('common:common.Update Failed')
|
||||
});
|
||||
|
||||
// collection list
|
||||
|
||||
@@ -16,31 +16,31 @@ const EmptyCollectionTip = () => {
|
||||
<>
|
||||
{(datasetDetail.type === DatasetTypeEnum.dataset ||
|
||||
datasetDetail.type === DatasetTypeEnum.externalFile) && (
|
||||
<EmptyTip text={t('core.dataset.collection.Empty Tip')} />
|
||||
<EmptyTip text={t('common:core.dataset.collection.Empty Tip')} />
|
||||
)}
|
||||
{datasetDetail.type === DatasetTypeEnum.websiteDataset && (
|
||||
<EmptyTip
|
||||
text={
|
||||
<Flex>
|
||||
{datasetDetail.status === DatasetStatusEnum.syncing && (
|
||||
<>{t('core.dataset.status.syncing')}</>
|
||||
<>{t('common:core.dataset.status.syncing')}</>
|
||||
)}
|
||||
{datasetDetail.status === DatasetStatusEnum.active && (
|
||||
<>
|
||||
{!datasetDetail?.websiteConfig?.url ? (
|
||||
<>
|
||||
{t('core.dataset.collection.Website Empty Tip')}
|
||||
{t('common:core.dataset.collection.Website Empty Tip')}
|
||||
{', '}
|
||||
<Box
|
||||
textDecoration={'underline'}
|
||||
cursor={'pointer'}
|
||||
onClick={onOpenWebsiteModal}
|
||||
>
|
||||
{t('core.dataset.collection.Click top config website')}
|
||||
{t('common:core.dataset.collection.Click top config website')}
|
||||
</Box>
|
||||
</>
|
||||
) : (
|
||||
<>{t('core.dataset.website.UnValid Website Tip')}</>
|
||||
<>{t('common:core.dataset.website.UnValid Website Tip')}</>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -65,8 +65,8 @@ const Header = ({}: {}) => {
|
||||
const { editFolderData, setEditFolderData } = useEditFolder();
|
||||
const { onOpenModal: onOpenCreateVirtualFileModal, EditModal: EditCreateVirtualFileModal } =
|
||||
useEditTitle({
|
||||
title: t('dataset.Create manual collection'),
|
||||
tip: t('dataset.Manual collection Tip'),
|
||||
title: t('common:dataset.Create manual collection'),
|
||||
tip: t('common:dataset.Manual collection Tip'),
|
||||
canEmpty: false
|
||||
});
|
||||
const {
|
||||
@@ -106,8 +106,8 @@ const Header = ({}: {}) => {
|
||||
setLoading(false);
|
||||
},
|
||||
|
||||
successToast: t('common.Create Success'),
|
||||
errorToast: t('common.Create Failed')
|
||||
successToast: t('common:common.Create Success'),
|
||||
errorToast: t('common:common.Create Failed')
|
||||
});
|
||||
|
||||
return (
|
||||
@@ -125,7 +125,7 @@ const Header = ({}: {}) => {
|
||||
</Box>
|
||||
{datasetDetail?.websiteConfig?.url && (
|
||||
<Flex fontSize={'sm'}>
|
||||
{t('core.dataset.website.Base Url')}:
|
||||
{t('common:core.dataset.website.Base Url')}:
|
||||
<Link
|
||||
href={datasetDetail.websiteConfig.url}
|
||||
target="_blank"
|
||||
@@ -158,7 +158,7 @@ const Header = ({}: {}) => {
|
||||
w={['100%', '250px']}
|
||||
size={'sm'}
|
||||
h={'36px'}
|
||||
placeholder={t('common.Search') || ''}
|
||||
placeholder={t('common:common.Search') || ''}
|
||||
value={searchText}
|
||||
leftIcon={
|
||||
<MyIcon
|
||||
@@ -211,7 +211,7 @@ const Header = ({}: {}) => {
|
||||
h={['28px', '35px']}
|
||||
>
|
||||
<MyIcon name={'common/importLight'} mr={2} w={'14px'} />
|
||||
<Box>{t('dataset.collections.Create And Import')}</Box>
|
||||
<Box>{t('common:dataset.collections.Create And Import')}</Box>
|
||||
</Flex>
|
||||
</MenuButton>
|
||||
}
|
||||
@@ -222,7 +222,7 @@ const Header = ({}: {}) => {
|
||||
label: (
|
||||
<Flex>
|
||||
<MyIcon name={'common/folderFill'} w={'20px'} mr={2} />
|
||||
{t('Folder')}
|
||||
{t('common:Folder')}
|
||||
</Flex>
|
||||
),
|
||||
onClick: () => setEditFolderData({})
|
||||
@@ -231,7 +231,7 @@ const Header = ({}: {}) => {
|
||||
label: (
|
||||
<Flex>
|
||||
<MyIcon name={'core/dataset/manualCollection'} mr={2} w={'20px'} />
|
||||
{t('core.dataset.Manual collection')}
|
||||
{t('common:core.dataset.Manual collection')}
|
||||
</Flex>
|
||||
),
|
||||
onClick: () => {
|
||||
@@ -247,7 +247,7 @@ const Header = ({}: {}) => {
|
||||
label: (
|
||||
<Flex>
|
||||
<MyIcon name={'core/dataset/fileCollection'} mr={2} w={'20px'} />
|
||||
{t('core.dataset.Text collection')}
|
||||
{t('common:core.dataset.Text collection')}
|
||||
</Flex>
|
||||
),
|
||||
onClick: onOpenFileSourceSelector
|
||||
@@ -256,7 +256,7 @@ const Header = ({}: {}) => {
|
||||
label: (
|
||||
<Flex>
|
||||
<MyIcon name={'core/dataset/tableCollection'} mr={2} w={'20px'} />
|
||||
{t('core.dataset.Table collection')}
|
||||
{t('common:core.dataset.Table collection')}
|
||||
</Flex>
|
||||
),
|
||||
onClick: () =>
|
||||
@@ -278,7 +278,7 @@ const Header = ({}: {}) => {
|
||||
{datasetDetail?.websiteConfig?.url ? (
|
||||
<Flex alignItems={'center'}>
|
||||
{datasetDetail.status === DatasetStatusEnum.active && (
|
||||
<Button onClick={onOpenWebsiteModal}>{t('common.Config')}</Button>
|
||||
<Button onClick={onOpenWebsiteModal}>{t('common:common.Config')}</Button>
|
||||
)}
|
||||
{datasetDetail.status === DatasetStatusEnum.syncing && (
|
||||
<Flex
|
||||
@@ -298,13 +298,15 @@ const Header = ({}: {}) => {
|
||||
mt={'1px'}
|
||||
></Box>
|
||||
<Box ml={2} color={'myGray.600'}>
|
||||
{t('core.dataset.status.syncing')}
|
||||
{t('common:core.dataset.status.syncing')}
|
||||
</Box>
|
||||
</Flex>
|
||||
)}
|
||||
</Flex>
|
||||
) : (
|
||||
<Button onClick={onOpenWebsiteModal}>{t('core.dataset.Set Website Config')}</Button>
|
||||
<Button onClick={onOpenWebsiteModal}>
|
||||
{t('common:core.dataset.Set Website Config')}
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
@@ -330,7 +332,7 @@ const Header = ({}: {}) => {
|
||||
h={['28px', '35px']}
|
||||
>
|
||||
<MyIcon name={'common/importLight'} mr={2} w={'14px'} />
|
||||
<Box>{t('dataset.collections.Create And Import')}</Box>
|
||||
<Box>{t('common:dataset.collections.Create And Import')}</Box>
|
||||
</Flex>
|
||||
</MenuButton>
|
||||
}
|
||||
@@ -341,7 +343,7 @@ const Header = ({}: {}) => {
|
||||
label: (
|
||||
<Flex>
|
||||
<MyIcon name={'common/folderFill'} w={'20px'} mr={2} />
|
||||
{t('Folder')}
|
||||
{t('common:Folder')}
|
||||
</Flex>
|
||||
),
|
||||
onClick: () => setEditFolderData({})
|
||||
@@ -350,7 +352,7 @@ const Header = ({}: {}) => {
|
||||
label: (
|
||||
<Flex>
|
||||
<MyIcon name={'core/dataset/fileCollection'} mr={2} w={'20px'} />
|
||||
{t('core.dataset.Text collection')}
|
||||
{t('common:core.dataset.Text collection')}
|
||||
</Flex>
|
||||
),
|
||||
onClick: () =>
|
||||
|
||||
@@ -34,8 +34,8 @@ const WebsiteConfigModal = ({
|
||||
});
|
||||
const isEdit = !!defaultValue.url;
|
||||
const confirmTip = isEdit
|
||||
? t('core.dataset.website.Confirm Update Tips')
|
||||
: t('core.dataset.website.Confirm Create Tips');
|
||||
? t('common:core.dataset.website.Confirm Update Tips')
|
||||
: t('common:core.dataset.website.Confirm Create Tips');
|
||||
|
||||
const { ConfirmModal, openConfirm } = useConfirm({
|
||||
type: 'common'
|
||||
@@ -45,13 +45,13 @@ const WebsiteConfigModal = ({
|
||||
<MyModal
|
||||
isOpen
|
||||
iconSrc="core/dataset/websiteDataset"
|
||||
title={t('core.dataset.website.Config')}
|
||||
title={t('common:core.dataset.website.Config')}
|
||||
onClose={onClose}
|
||||
maxW={'500px'}
|
||||
>
|
||||
<ModalBody>
|
||||
<Box fontSize={'sm'} color={'myGray.600'}>
|
||||
{t('core.dataset.website.Config Description')}
|
||||
{t('common:core.dataset.website.Config Description')}
|
||||
{feConfigs?.docUrl && (
|
||||
<Link
|
||||
href={getDocPath('/docs/course/websync')}
|
||||
@@ -59,14 +59,14 @@ const WebsiteConfigModal = ({
|
||||
textDecoration={'underline'}
|
||||
fontWeight={'bold'}
|
||||
>
|
||||
{t('common.course.Read Course')}
|
||||
{t('common:common.course.Read Course')}
|
||||
</Link>
|
||||
)}
|
||||
</Box>
|
||||
<Box mt={2}>
|
||||
<Box>{t('core.dataset.website.Base Url')}</Box>
|
||||
<Box>{t('common:core.dataset.website.Base Url')}</Box>
|
||||
<Input
|
||||
placeholder={t('core.dataset.collection.Website Link')}
|
||||
placeholder={t('common:core.dataset.collection.Website Link')}
|
||||
{...register('url', {
|
||||
required: true
|
||||
})}
|
||||
@@ -74,14 +74,14 @@ const WebsiteConfigModal = ({
|
||||
</Box>
|
||||
<Box mt={3}>
|
||||
<Box>
|
||||
{t('core.dataset.website.Selector')}({t('common.choosable')})
|
||||
{t('common:core.dataset.website.Selector')}({t('common:common.choosable')})
|
||||
</Box>
|
||||
<Input {...register('selector')} placeholder="body .content #document" />
|
||||
</Box>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
<Button variant={'whiteBase'} onClick={onClose}>
|
||||
{t('common.Close')}
|
||||
{t('common:common.Close')}
|
||||
</Button>
|
||||
<Button
|
||||
ml={2}
|
||||
@@ -91,7 +91,7 @@ const WebsiteConfigModal = ({
|
||||
if (!strIsLink(data.url)) {
|
||||
return toast({
|
||||
status: 'warning',
|
||||
title: t('common.link.UnValid')
|
||||
title: t('common:common.link.UnValid')
|
||||
});
|
||||
}
|
||||
openConfirm(
|
||||
@@ -103,7 +103,7 @@ const WebsiteConfigModal = ({
|
||||
)();
|
||||
})}
|
||||
>
|
||||
{t('core.dataset.website.Start Sync')}
|
||||
{t('common:core.dataset.website.Start Sync')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
<ConfirmModal />
|
||||
|
||||
@@ -62,15 +62,15 @@ const CollectionCard = () => {
|
||||
const { datasetDetail, loadDatasetDetail } = useContextSelector(DatasetPageContext, (v) => v);
|
||||
|
||||
const { openConfirm: openDeleteConfirm, ConfirmModal: ConfirmDeleteModal } = useConfirm({
|
||||
content: t('dataset.Confirm to delete the file'),
|
||||
content: t('common:dataset.Confirm to delete the file'),
|
||||
type: 'delete'
|
||||
});
|
||||
const { openConfirm: openSyncConfirm, ConfirmModal: ConfirmSyncModal } = useConfirm({
|
||||
content: t('core.dataset.collection.Start Sync Tip')
|
||||
content: t('common:core.dataset.collection.Start Sync Tip')
|
||||
});
|
||||
|
||||
const { onOpenModal: onOpenEditTitleModal, EditModal: EditTitleModal } = useEditTitle({
|
||||
title: t('Rename')
|
||||
title: t('common:Rename')
|
||||
});
|
||||
|
||||
const [moveCollectionData, setMoveCollectionData] = useState<{ collectionId: string }>();
|
||||
@@ -93,7 +93,7 @@ const CollectionCard = () => {
|
||||
};
|
||||
}
|
||||
return {
|
||||
statusText: t('core.dataset.collection.status.active'),
|
||||
statusText: t('common:core.dataset.collection.status.active'),
|
||||
colorSchema: 'green'
|
||||
};
|
||||
})();
|
||||
@@ -113,7 +113,7 @@ const CollectionCard = () => {
|
||||
onSuccess() {
|
||||
getData(pageNum);
|
||||
},
|
||||
successToast: t('common.Update Success')
|
||||
successToast: t('common:common.Update Success')
|
||||
}
|
||||
);
|
||||
const { mutate: onDelCollection, isLoading: isDeleting } = useRequest({
|
||||
@@ -125,8 +125,8 @@ const CollectionCard = () => {
|
||||
onSuccess() {
|
||||
getData(pageNum);
|
||||
},
|
||||
successToast: t('common.Delete Success'),
|
||||
errorToast: t('common.Delete Failed')
|
||||
successToast: t('common:common.Delete Success'),
|
||||
errorToast: t('common:common.Delete Failed')
|
||||
});
|
||||
|
||||
const { mutate: onclickStartSync, isLoading: isSyncing } = useRequest({
|
||||
@@ -140,7 +140,7 @@ const CollectionCard = () => {
|
||||
title: t(DatasetCollectionSyncResultMap[res]?.label)
|
||||
});
|
||||
},
|
||||
errorToast: t('core.dataset.error.Start Sync Failed')
|
||||
errorToast: t('common:core.dataset.error.Start Sync Failed')
|
||||
});
|
||||
|
||||
const hasTrainingData = useMemo(
|
||||
@@ -192,11 +192,11 @@ const CollectionCard = () => {
|
||||
<Table variant={'simple'} draggable={false}>
|
||||
<Thead draggable={false}>
|
||||
<Tr>
|
||||
<Th py={4}>{t('common.Name')}</Th>
|
||||
<Th py={4}>{t('common:common.Name')}</Th>
|
||||
<Th py={4}>{datasetT('collection.Training type')}</Th>
|
||||
<Th py={4}>{t('dataset.collections.Data Amount')}</Th>
|
||||
<Th py={4}>{t('common:dataset.collections.Data Amount')}</Th>
|
||||
<Th py={4}>{datasetT('collection.Create update time')}</Th>
|
||||
<Th py={4}>{t('common.Status')}</Th>
|
||||
<Th py={4}>{t('common:common.Status')}</Th>
|
||||
<Th py={4}>{datasetT('Enable')}</Th>
|
||||
<Th py={4} />
|
||||
</Tr>
|
||||
@@ -235,7 +235,10 @@ const CollectionCard = () => {
|
||||
<Td minW={'150px'} maxW={['200px', '300px']} draggable py={2}>
|
||||
<Flex alignItems={'center'}>
|
||||
<MyIcon name={collection.icon as any} w={'16px'} mr={2} />
|
||||
<MyTooltip label={t('common.folder.Drag Tip')} shouldWrapChildren={false}>
|
||||
<MyTooltip
|
||||
label={t('common:common.folder.Drag Tip')}
|
||||
shouldWrapChildren={false}
|
||||
>
|
||||
<Box color={'myGray.900'} className="textEllipsis">
|
||||
{collection.name}
|
||||
</Box>
|
||||
@@ -309,7 +312,7 @@ const CollectionCard = () => {
|
||||
label: (
|
||||
<Flex alignItems={'center'}>
|
||||
<MyIcon name={'common/refreshLight'} w={'14px'} mr={2} />
|
||||
{t('core.dataset.collection.Sync')}
|
||||
{t('common:core.dataset.collection.Sync')}
|
||||
</Flex>
|
||||
),
|
||||
onClick: () =>
|
||||
@@ -323,7 +326,7 @@ const CollectionCard = () => {
|
||||
label: (
|
||||
<Flex alignItems={'center'}>
|
||||
<MyIcon name={'common/file/move'} w={'14px'} mr={2} />
|
||||
{t('Move')}
|
||||
{t('common:Move')}
|
||||
</Flex>
|
||||
),
|
||||
onClick: () =>
|
||||
@@ -333,7 +336,7 @@ const CollectionCard = () => {
|
||||
label: (
|
||||
<Flex alignItems={'center'}>
|
||||
<MyIcon name={'edit'} w={'14px'} mr={2} />
|
||||
{t('Rename')}
|
||||
{t('common:Rename')}
|
||||
</Flex>
|
||||
),
|
||||
onClick: () =>
|
||||
@@ -359,7 +362,7 @@ const CollectionCard = () => {
|
||||
w={'14px'}
|
||||
_hover={{ color: 'red.600' }}
|
||||
/>
|
||||
<Box>{t('common.Delete')}</Box>
|
||||
<Box>{t('common:common.Delete')}</Box>
|
||||
</Flex>
|
||||
),
|
||||
type: 'danger',
|
||||
@@ -370,8 +373,8 @@ const CollectionCard = () => {
|
||||
},
|
||||
undefined,
|
||||
collection.type === DatasetCollectionTypeEnum.folder
|
||||
? t('dataset.collections.Confirm to delete the folder')
|
||||
: t('dataset.Confirm to delete the file')
|
||||
? t('common:dataset.collections.Confirm to delete the folder')
|
||||
: t('common:dataset.Confirm to delete the file')
|
||||
)()
|
||||
}
|
||||
]
|
||||
@@ -411,7 +414,7 @@ const CollectionCard = () => {
|
||||
setMoveCollectionData(undefined);
|
||||
toast({
|
||||
status: 'success',
|
||||
title: t('common.folder.Move Success')
|
||||
title: t('common:common.folder.Move Success')
|
||||
});
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -72,7 +72,7 @@ const DataCard = () => {
|
||||
const [searchText, setSearchText] = useState('');
|
||||
const { toast } = useToast();
|
||||
const { openConfirm, ConfirmModal } = useConfirm({
|
||||
content: t('dataset.Confirm to delete the data'),
|
||||
content: t('common:dataset.Confirm to delete the data'),
|
||||
type: 'delete'
|
||||
});
|
||||
const { isOpen, onOpen, onClose } = useDisclosure();
|
||||
@@ -141,41 +141,41 @@ const DataCard = () => {
|
||||
|
||||
return [
|
||||
{
|
||||
label: t('core.dataset.collection.metadata.source'),
|
||||
label: t('common:core.dataset.collection.metadata.source'),
|
||||
value: t(DatasetCollectionTypeMap[collection.type]?.name)
|
||||
},
|
||||
{
|
||||
label: t('core.dataset.collection.metadata.source name'),
|
||||
label: t('common:core.dataset.collection.metadata.source name'),
|
||||
value: collection.file?.filename || collection?.rawLink || collection?.name
|
||||
},
|
||||
{
|
||||
label: t('core.dataset.collection.metadata.source size'),
|
||||
label: t('common:core.dataset.collection.metadata.source size'),
|
||||
value: collection.file ? formatFileSize(collection.file.length) : '-'
|
||||
},
|
||||
{
|
||||
label: t('core.dataset.collection.metadata.Createtime'),
|
||||
label: t('common:core.dataset.collection.metadata.Createtime'),
|
||||
value: formatTime2YMDHM(collection.createTime)
|
||||
},
|
||||
{
|
||||
label: t('core.dataset.collection.metadata.Updatetime'),
|
||||
label: t('common:core.dataset.collection.metadata.Updatetime'),
|
||||
value: formatTime2YMDHM(collection.updateTime)
|
||||
},
|
||||
{
|
||||
label: t('core.dataset.collection.metadata.Raw text length'),
|
||||
label: t('common:core.dataset.collection.metadata.Raw text length'),
|
||||
value: collection.rawTextLength ?? '-'
|
||||
},
|
||||
{
|
||||
label: t('core.dataset.collection.metadata.Training Type'),
|
||||
label: t('common:core.dataset.collection.metadata.Training Type'),
|
||||
value: t(TrainingTypeMap[collection.trainingType]?.label)
|
||||
},
|
||||
{
|
||||
label: t('core.dataset.collection.metadata.Chunk Size'),
|
||||
label: t('common:core.dataset.collection.metadata.Chunk Size'),
|
||||
value: collection.chunkSize || '-'
|
||||
},
|
||||
...(webSelector
|
||||
? [
|
||||
{
|
||||
label: t('core.dataset.collection.metadata.Web page selector'),
|
||||
label: t('common:core.dataset.collection.metadata.Web page selector'),
|
||||
value: webSelector
|
||||
}
|
||||
]
|
||||
@@ -235,7 +235,7 @@ const DataCard = () => {
|
||||
/>
|
||||
)}
|
||||
<Box fontSize={'sm'} color={'myGray.500'}>
|
||||
{t('core.dataset.collection.id')}:{' '}
|
||||
{t('common:core.dataset.collection.id')}:{' '}
|
||||
<Box as={'span'} userSelect={'all'}>
|
||||
{collection?._id}
|
||||
</Box>
|
||||
@@ -253,12 +253,12 @@ const DataCard = () => {
|
||||
setEditDataId('');
|
||||
}}
|
||||
>
|
||||
{t('dataset.Insert Data')}
|
||||
{t('common:dataset.Insert Data')}
|
||||
</Button>
|
||||
</Box>
|
||||
)}
|
||||
{isPc && (
|
||||
<MyTooltip label={t('core.dataset.collection.metadata.Read Metadata')}>
|
||||
<MyTooltip label={t('common:core.dataset.collection.metadata.Read Metadata')}>
|
||||
<IconButton
|
||||
variant={'whiteBase'}
|
||||
size={['sm', 'md']}
|
||||
@@ -286,7 +286,7 @@ const DataCard = () => {
|
||||
/>
|
||||
}
|
||||
w={['200px', '300px']}
|
||||
placeholder={t('core.dataset.data.Search data placeholder')}
|
||||
placeholder={t('common:core.dataset.data.Search data placeholder')}
|
||||
value={searchText}
|
||||
onChange={(e) => {
|
||||
setSearchText(e.target.value);
|
||||
@@ -438,7 +438,7 @@ const DataCard = () => {
|
||||
<Pagination />
|
||||
</Flex>
|
||||
)}
|
||||
{total === 0 && <EmptyTip text={t('core.dataset.data.Empty Tip')}></EmptyTip>}
|
||||
{total === 0 && <EmptyTip text={t('common:core.dataset.data.Empty Tip')}></EmptyTip>}
|
||||
</Box>
|
||||
</Flex>
|
||||
|
||||
@@ -447,7 +447,7 @@ const DataCard = () => {
|
||||
<DrawerOverlay />
|
||||
<DrawerContent>
|
||||
<DrawerHeader fontSize={'lg'}>
|
||||
{t('core.dataset.collection.metadata.metadata')}
|
||||
{t('common:core.dataset.collection.metadata.metadata')}
|
||||
</DrawerHeader>
|
||||
|
||||
<DrawerBody>
|
||||
@@ -461,14 +461,14 @@ const DataCard = () => {
|
||||
))}
|
||||
{collection?.sourceId && (
|
||||
<Button variant={'whitePrimary'} onClick={readSource}>
|
||||
{t('core.dataset.collection.metadata.read source')}
|
||||
{t('common:core.dataset.collection.metadata.read source')}
|
||||
</Button>
|
||||
)}
|
||||
</DrawerBody>
|
||||
|
||||
<DrawerFooter>
|
||||
<Button variant={'whitePrimary'} onClick={onClose}>
|
||||
{t('common.Close')}
|
||||
{t('common:common.Close')}
|
||||
</Button>
|
||||
</DrawerFooter>
|
||||
</DrawerContent>
|
||||
|
||||
@@ -87,57 +87,57 @@ const DatasetImportContextProvider = ({ children }: { children: React.ReactNode
|
||||
const modeSteps: Record<ImportDataSourceEnum, { title: string }[]> = {
|
||||
[ImportDataSourceEnum.fileLocal]: [
|
||||
{
|
||||
title: t('core.dataset.import.Select file')
|
||||
title: t('common:core.dataset.import.Select file')
|
||||
},
|
||||
{
|
||||
title: t('core.dataset.import.Data Preprocessing')
|
||||
title: t('common:core.dataset.import.Data Preprocessing')
|
||||
},
|
||||
{
|
||||
title: t('core.dataset.import.Upload data')
|
||||
title: t('common:core.dataset.import.Upload data')
|
||||
}
|
||||
],
|
||||
[ImportDataSourceEnum.fileLink]: [
|
||||
{
|
||||
title: t('core.dataset.import.Select file')
|
||||
title: t('common:core.dataset.import.Select file')
|
||||
},
|
||||
{
|
||||
title: t('core.dataset.import.Data Preprocessing')
|
||||
title: t('common:core.dataset.import.Data Preprocessing')
|
||||
},
|
||||
{
|
||||
title: t('core.dataset.import.Upload data')
|
||||
title: t('common:core.dataset.import.Upload data')
|
||||
}
|
||||
],
|
||||
[ImportDataSourceEnum.fileCustom]: [
|
||||
{
|
||||
title: t('core.dataset.import.Select file')
|
||||
title: t('common:core.dataset.import.Select file')
|
||||
},
|
||||
{
|
||||
title: t('core.dataset.import.Data Preprocessing')
|
||||
title: t('common:core.dataset.import.Data Preprocessing')
|
||||
},
|
||||
{
|
||||
title: t('core.dataset.import.Upload data')
|
||||
title: t('common:core.dataset.import.Upload data')
|
||||
}
|
||||
],
|
||||
[ImportDataSourceEnum.csvTable]: [
|
||||
{
|
||||
title: t('core.dataset.import.Select file')
|
||||
title: t('common:core.dataset.import.Select file')
|
||||
},
|
||||
{
|
||||
title: t('core.dataset.import.Data Preprocessing')
|
||||
title: t('common:core.dataset.import.Data Preprocessing')
|
||||
},
|
||||
{
|
||||
title: t('core.dataset.import.Upload data')
|
||||
title: t('common:core.dataset.import.Upload data')
|
||||
}
|
||||
],
|
||||
[ImportDataSourceEnum.externalFile]: [
|
||||
{
|
||||
title: t('core.dataset.import.Select file')
|
||||
title: t('common:core.dataset.import.Select file')
|
||||
},
|
||||
{
|
||||
title: t('core.dataset.import.Data Preprocessing')
|
||||
title: t('common:core.dataset.import.Data Preprocessing')
|
||||
},
|
||||
{
|
||||
title: t('core.dataset.import.Upload data')
|
||||
title: t('common:core.dataset.import.Upload data')
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -266,7 +266,7 @@ const DatasetImportContextProvider = ({ children }: { children: React.ReactNode
|
||||
})
|
||||
}
|
||||
/>
|
||||
{t('common.Exit')}
|
||||
{t('common:common.Exit')}
|
||||
</Flex>
|
||||
) : (
|
||||
<Button
|
||||
@@ -274,7 +274,7 @@ const DatasetImportContextProvider = ({ children }: { children: React.ReactNode
|
||||
leftIcon={<MyIcon name={'common/backFill'} w={'14px'} />}
|
||||
onClick={goToPrevious}
|
||||
>
|
||||
{t('common.Last Step')}
|
||||
{t('common:common.Last Step')}
|
||||
</Button>
|
||||
)}
|
||||
<Box flex={1} />
|
||||
|
||||
@@ -65,7 +65,7 @@ function DataProcess({ showPreviewChunks = true }: { showPreviewChunks: boolean
|
||||
if (!feConfigs?.isPlus && !TrainingTypeMap[e]?.openSource) {
|
||||
return toast({
|
||||
status: 'warning',
|
||||
title: t('common.system.Commercial version function')
|
||||
title: t('common:common.system.Commercial version function')
|
||||
});
|
||||
}
|
||||
setValue('mode', e);
|
||||
@@ -78,11 +78,11 @@ function DataProcess({ showPreviewChunks = true }: { showPreviewChunks: boolean
|
||||
<Box flex={'1 0 0'} minW={['auto', '540px']} maxW={'600px'}>
|
||||
<Flex alignItems={'center'}>
|
||||
<MyIcon name={'common/settingLight'} w={'20px'} />
|
||||
<Box fontSize={'md'}>{t('core.dataset.import.Data process params')}</Box>
|
||||
<Box fontSize={'md'}>{t('common:core.dataset.import.Data process params')}</Box>
|
||||
</Flex>
|
||||
|
||||
<Box display={['block', 'flex']} mt={4} alignItems={'center'}>
|
||||
<FormLabel flex={'0 0 100px'}>{t('core.dataset.import.Training mode')}</FormLabel>
|
||||
<FormLabel flex={'0 0 100px'}>{t('common:core.dataset.import.Training mode')}</FormLabel>
|
||||
<LeftRadio
|
||||
list={trainingModeList.map(([key, value]) => ({
|
||||
title: t(value.label),
|
||||
@@ -100,25 +100,27 @@ function DataProcess({ showPreviewChunks = true }: { showPreviewChunks: boolean
|
||||
/>
|
||||
</Box>
|
||||
<Box display={['block', 'flex']} mt={5}>
|
||||
<FormLabel flex={'0 0 100px'}>{t('core.dataset.import.Process way')}</FormLabel>
|
||||
<FormLabel flex={'0 0 100px'}>{t('common:core.dataset.import.Process way')}</FormLabel>
|
||||
<LeftRadio
|
||||
list={[
|
||||
{
|
||||
title: t('core.dataset.import.Auto process'),
|
||||
desc: t('core.dataset.import.Auto process desc'),
|
||||
title: t('common:core.dataset.import.Auto process'),
|
||||
desc: t('common:core.dataset.import.Auto process desc'),
|
||||
value: ImportProcessWayEnum.auto
|
||||
},
|
||||
{
|
||||
title: t('core.dataset.import.Custom process'),
|
||||
desc: t('core.dataset.import.Custom process desc'),
|
||||
title: t('common:core.dataset.import.Custom process'),
|
||||
desc: t('common:core.dataset.import.Custom process desc'),
|
||||
value: ImportProcessWayEnum.custom,
|
||||
children: way === ImportProcessWayEnum.custom && (
|
||||
<Box mt={5}>
|
||||
{showChunkInput && chunkSizeField && (
|
||||
<Box>
|
||||
<Flex alignItems={'center'}>
|
||||
<Box>{t('core.dataset.import.Ideal chunk length')}</Box>
|
||||
<MyTooltip label={t('core.dataset.import.Ideal chunk length Tips')}>
|
||||
<Box>{t('common:core.dataset.import.Ideal chunk length')}</Box>
|
||||
<MyTooltip
|
||||
label={t('common:core.dataset.import.Ideal chunk length Tips')}
|
||||
>
|
||||
<MyIcon
|
||||
name={'common/questionLight'}
|
||||
ml={1}
|
||||
@@ -171,8 +173,8 @@ function DataProcess({ showPreviewChunks = true }: { showPreviewChunks: boolean
|
||||
|
||||
<Box mt={3}>
|
||||
<Box>
|
||||
{t('core.dataset.import.Custom split char')}
|
||||
<MyTooltip label={t('core.dataset.import.Custom split char Tips')}>
|
||||
{t('common:core.dataset.import.Custom split char')}
|
||||
<MyTooltip label={t('common:core.dataset.import.Custom split char Tips')}>
|
||||
<MyIcon
|
||||
name={'common/questionLight'}
|
||||
ml={1}
|
||||
@@ -194,7 +196,7 @@ function DataProcess({ showPreviewChunks = true }: { showPreviewChunks: boolean
|
||||
|
||||
{showPromptInput && (
|
||||
<Box mt={3}>
|
||||
<Box>{t('core.dataset.collection.QA Prompt')}</Box>
|
||||
<Box>{t('common:core.dataset.collection.QA Prompt')}</Box>
|
||||
<Box
|
||||
position={'relative'}
|
||||
py={2}
|
||||
@@ -237,7 +239,7 @@ function DataProcess({ showPreviewChunks = true }: { showPreviewChunks: boolean
|
||||
bottom={2}
|
||||
onClick={onOpenCustomPrompt}
|
||||
>
|
||||
{t('core.dataset.import.Custom prompt')}
|
||||
{t('common:core.dataset.import.Custom prompt')}
|
||||
</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
@@ -273,7 +275,7 @@ function DataProcess({ showPreviewChunks = true }: { showPreviewChunks: boolean
|
||||
goToNext();
|
||||
}}
|
||||
>
|
||||
{t('common.Next Step')}
|
||||
{t('common:common.Next Step')}
|
||||
</Button>
|
||||
</Flex>
|
||||
</Box>
|
||||
@@ -311,7 +313,7 @@ const PromptTextarea = ({
|
||||
return (
|
||||
<MyModal
|
||||
isOpen
|
||||
title={t('core.dataset.import.Custom prompt')}
|
||||
title={t('common:core.dataset.import.Custom prompt')}
|
||||
iconSrc="modal/edit"
|
||||
w={'600px'}
|
||||
onClose={onClose}
|
||||
@@ -328,7 +330,7 @@ const PromptTextarea = ({
|
||||
onClose();
|
||||
}}
|
||||
>
|
||||
{t('common.Confirm')}
|
||||
{t('common:common.Confirm')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
|
||||
@@ -15,7 +15,7 @@ const PreviewData = ({ showPreviewChunks }: { showPreviewChunks: boolean }) => {
|
||||
<Preview showPreviewChunks={showPreviewChunks} />
|
||||
</Box>
|
||||
<Flex mt={2} justifyContent={'flex-end'}>
|
||||
<Button onClick={goToNext}>{t('common.Next Step')}</Button>
|
||||
<Button onClick={goToNext}>{t('common:common.Next Step')}</Button>
|
||||
</Flex>
|
||||
</Flex>
|
||||
);
|
||||
|
||||
@@ -118,7 +118,7 @@ const Upload = () => {
|
||||
},
|
||||
onSuccess() {
|
||||
toast({
|
||||
title: t('core.dataset.import.Import success'),
|
||||
title: t('common:core.dataset.import.Import success'),
|
||||
status: 'success'
|
||||
});
|
||||
|
||||
@@ -152,10 +152,10 @@ const Upload = () => {
|
||||
<Thead draggable={false}>
|
||||
<Tr bg={'myGray.100'} mb={2}>
|
||||
<Th borderLeftRadius={'md'} overflow={'hidden'} borderBottom={'none'} py={4}>
|
||||
{t('core.dataset.import.Source name')}
|
||||
{t('common:core.dataset.import.Source name')}
|
||||
</Th>
|
||||
<Th borderBottom={'none'} py={4}>
|
||||
{t('core.dataset.import.Upload status')}
|
||||
{t('common:core.dataset.import.Upload status')}
|
||||
</Th>
|
||||
</Tr>
|
||||
</Thead>
|
||||
@@ -173,13 +173,13 @@ const Upload = () => {
|
||||
<Td>
|
||||
<Box display={'inline-block'}>
|
||||
{item.createStatus === 'waiting' && (
|
||||
<MyTag colorSchema={'gray'}>{t('common.Waiting')}</MyTag>
|
||||
<MyTag colorSchema={'gray'}>{t('common:common.Waiting')}</MyTag>
|
||||
)}
|
||||
{item.createStatus === 'creating' && (
|
||||
<MyTag colorSchema={'blue'}>{t('common.Creating')}</MyTag>
|
||||
<MyTag colorSchema={'blue'}>{t('common:common.Creating')}</MyTag>
|
||||
)}
|
||||
{item.createStatus === 'finish' && (
|
||||
<MyTag colorSchema={'green'}>{t('common.Finish')}</MyTag>
|
||||
<MyTag colorSchema={'green'}>{t('common:common.Finish')}</MyTag>
|
||||
)}
|
||||
</Box>
|
||||
</Td>
|
||||
@@ -194,7 +194,7 @@ const Upload = () => {
|
||||
{sources.length > 0
|
||||
? `${t('core.dataset.import.Total files', { total: sources.length })} | `
|
||||
: ''}
|
||||
{t('core.dataset.import.Start upload')}
|
||||
{t('common:core.dataset.import.Start upload')}
|
||||
</Button>
|
||||
</Flex>
|
||||
</Box>
|
||||
|
||||
@@ -17,25 +17,25 @@ const FileModeSelector = ({ onClose }: { onClose: () => void }) => {
|
||||
isOpen
|
||||
onClose={onClose}
|
||||
iconSrc="modal/selectSource"
|
||||
title={t('core.dataset.import.Select source')}
|
||||
title={t('common:core.dataset.import.Select source')}
|
||||
w={'600px'}
|
||||
>
|
||||
<ModalBody px={6} py={4}>
|
||||
<LeftRadio
|
||||
list={[
|
||||
{
|
||||
title: t('core.dataset.import.Local file'),
|
||||
desc: t('core.dataset.import.Local file desc'),
|
||||
title: t('common:core.dataset.import.Local file'),
|
||||
desc: t('common:core.dataset.import.Local file desc'),
|
||||
value: ImportDataSourceEnum.fileLocal
|
||||
},
|
||||
{
|
||||
title: t('core.dataset.import.Web link'),
|
||||
desc: t('core.dataset.import.Web link desc'),
|
||||
title: t('common:core.dataset.import.Web link'),
|
||||
desc: t('common:core.dataset.import.Web link desc'),
|
||||
value: ImportDataSourceEnum.fileLink
|
||||
},
|
||||
{
|
||||
title: t('core.dataset.import.Custom text'),
|
||||
desc: t('core.dataset.import.Custom text desc'),
|
||||
title: t('common:core.dataset.import.Custom text'),
|
||||
desc: t('common:core.dataset.import.Custom text desc'),
|
||||
value: ImportDataSourceEnum.fileCustom
|
||||
}
|
||||
]}
|
||||
@@ -55,7 +55,7 @@ const FileModeSelector = ({ onClose }: { onClose: () => void }) => {
|
||||
})
|
||||
}
|
||||
>
|
||||
{t('common.Confirm')}
|
||||
{t('common:common.Confirm')}
|
||||
</Button>
|
||||
</ModalFooter>
|
||||
</MyModal>
|
||||
|
||||
@@ -22,7 +22,7 @@ const Preview = ({ showPreviewChunks }: { showPreviewChunks: boolean }) => {
|
||||
<Box h={'100%'} display={['block', 'flex']} flexDirection={'column'}>
|
||||
<Flex alignItems={'center'}>
|
||||
<MyIcon name={'core/dataset/fileCollection'} w={'20px'} />
|
||||
<Box fontSize={'md'}>{t('core.dataset.import.Sources list')}</Box>
|
||||
<Box fontSize={'md'}>{t('common:core.dataset.import.Sources list')}</Box>
|
||||
</Flex>
|
||||
<Box mt={3} flex={'1 0 0'} width={'100%'} overflow={'auto'}>
|
||||
{sources.map((source) => (
|
||||
@@ -59,7 +59,7 @@ const Preview = ({ showPreviewChunks }: { showPreviewChunks: boolean }) => {
|
||||
label: (
|
||||
<Flex alignItems={'center'}>
|
||||
<MyIcon name={'core/dataset/fileCollection'} w={'14px'} mr={2} />
|
||||
{t('core.dataset.import.Preview raw text')}
|
||||
{t('common:core.dataset.import.Preview raw text')}
|
||||
</Flex>
|
||||
),
|
||||
onClick: () => setPreviewRawTextSource(source)
|
||||
@@ -68,7 +68,7 @@ const Preview = ({ showPreviewChunks }: { showPreviewChunks: boolean }) => {
|
||||
label: (
|
||||
<Flex alignItems={'center'}>
|
||||
<MyIcon name={'core/dataset/splitLight'} w={'14px'} mr={2} />
|
||||
{t('core.dataset.import.Preview chunks')}
|
||||
{t('common:core.dataset.import.Preview chunks')}
|
||||
</Flex>
|
||||
),
|
||||
onClick: () => setPreviewChunkSource(source)
|
||||
|
||||
@@ -43,13 +43,13 @@ export const RenderUploadFiles = ({
|
||||
{fileT('File Name')}
|
||||
</Th>
|
||||
<Th borderBottom={'none'} py={4}>
|
||||
{t('core.dataset.import.Upload file progress')}
|
||||
{t('common:core.dataset.import.Upload file progress')}
|
||||
</Th>
|
||||
<Th borderBottom={'none'} py={4}>
|
||||
{fileT('File Size')}
|
||||
</Th>
|
||||
<Th borderRightRadius={'md'} borderBottom={'none'} py={4}>
|
||||
{t('common.Action')}
|
||||
{t('common:common.Action')}
|
||||
</Th>
|
||||
</Tr>
|
||||
</Thead>
|
||||
@@ -85,7 +85,7 @@ export const RenderUploadFiles = ({
|
||||
{!item.isUploading && (
|
||||
<Flex alignItems={'center'} gap={4}>
|
||||
{showPreviewContent && (
|
||||
<MyTooltip label={t('core.dataset.import.Preview raw text')}>
|
||||
<MyTooltip label={t('common:core.dataset.import.Preview raw text')}>
|
||||
<IconButton
|
||||
variant={'whitePrimary'}
|
||||
size={'sm'}
|
||||
|
||||
@@ -180,7 +180,7 @@ const CustomLinkInput = () => {
|
||||
goToNext();
|
||||
})}
|
||||
>
|
||||
{t('common.Next Step')}
|
||||
{t('common:common.Next Step')}
|
||||
</Button>
|
||||
</Flex>
|
||||
</Box>
|
||||
|
||||
@@ -69,7 +69,7 @@ const CustomTextInput = () => {
|
||||
<Box maxW={['100%', '800px']}>
|
||||
<Box display={['block', 'flex']} alignItems={'center'}>
|
||||
<Box flex={'0 0 120px'} fontSize={'sm'}>
|
||||
{t('core.dataset.collection.Collection name')}
|
||||
{t('common:core.dataset.collection.Collection name')}
|
||||
</Box>
|
||||
<Input
|
||||
flex={'1 0 0'}
|
||||
@@ -77,19 +77,19 @@ const CustomTextInput = () => {
|
||||
{...register('name', {
|
||||
required: true
|
||||
})}
|
||||
placeholder={t('core.dataset.collection.Collection name')}
|
||||
placeholder={t('common:core.dataset.collection.Collection name')}
|
||||
bg={'myGray.50'}
|
||||
/>
|
||||
</Box>
|
||||
<Box display={['block', 'flex']} alignItems={'flex-start'} mt={5}>
|
||||
<Box flex={'0 0 120px'} fontSize={'sm'}>
|
||||
{t('core.dataset.collection.Collection raw text')}
|
||||
{t('common:core.dataset.collection.Collection raw text')}
|
||||
</Box>
|
||||
<Textarea
|
||||
flex={'1 0 0'}
|
||||
w={'100%'}
|
||||
rows={15}
|
||||
placeholder={t('core.dataset.collection.Collection raw text')}
|
||||
placeholder={t('common:core.dataset.collection.Collection raw text')}
|
||||
{...register('value', {
|
||||
required: true
|
||||
})}
|
||||
@@ -97,7 +97,9 @@ const CustomTextInput = () => {
|
||||
/>
|
||||
</Box>
|
||||
<Flex mt={5} justifyContent={'flex-end'}>
|
||||
<Button onClick={handleSubmit((data) => onSubmit(data))}>{t('common.Next Step')}</Button>
|
||||
<Button onClick={handleSubmit((data) => onSubmit(data))}>
|
||||
{t('common:common.Next Step')}
|
||||
</Button>
|
||||
</Flex>
|
||||
</Box>
|
||||
);
|
||||
|
||||
@@ -60,13 +60,13 @@ const CustomLinkImport = () => {
|
||||
<Box maxW={['100%', '800px']}>
|
||||
<Box display={['block', 'flex']} alignItems={'flex-start'} mt={1}>
|
||||
<Box flex={'0 0 100px'} fontSize={'sm'}>
|
||||
{t('core.dataset.import.Link name')}
|
||||
{t('common:core.dataset.import.Link name')}
|
||||
</Box>
|
||||
<Textarea
|
||||
flex={'1 0 0'}
|
||||
w={'100%'}
|
||||
rows={10}
|
||||
placeholder={t('core.dataset.import.Link name placeholder')}
|
||||
placeholder={t('common:core.dataset.import.Link name placeholder')}
|
||||
bg={'myGray.50'}
|
||||
overflowX={'auto'}
|
||||
whiteSpace={'nowrap'}
|
||||
@@ -77,11 +77,11 @@ const CustomLinkImport = () => {
|
||||
</Box>
|
||||
<Box display={['block', 'flex']} alignItems={'center'} mt={4}>
|
||||
<Box flex={'0 0 100px'} fontSize={'sm'}>
|
||||
{t('core.dataset.website.Selector')}
|
||||
{t('common:core.dataset.website.Selector')}
|
||||
<Box color={'myGray.500'} fontSize={'sm'}>
|
||||
{feConfigs?.docUrl && (
|
||||
<Link href={getDocPath('/docs/course/websync/#选择器如何使用')} target="_blank">
|
||||
{t('core.dataset.website.Selector Course')}
|
||||
{t('common:core.dataset.website.Selector Course')}
|
||||
</Link>
|
||||
)}
|
||||
</Box>
|
||||
@@ -142,7 +142,7 @@ const CustomLinkImport = () => {
|
||||
goToNext();
|
||||
})}
|
||||
>
|
||||
{t('common.Next Step')}
|
||||
{t('common:common.Next Step')}
|
||||
</Button>
|
||||
</Flex>
|
||||
</Box>
|
||||
|
||||
@@ -71,7 +71,7 @@ const SelectFile = React.memo(function SelectFile() {
|
||||
{selectFiles.length > 0
|
||||
? `${t('core.dataset.import.Total files', { total: selectFiles.length })} | `
|
||||
: ''}
|
||||
{t('common.Next Step')}
|
||||
{t('common:common.Next Step')}
|
||||
</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user