4.8.10 workflow perf (#2596)

* perf: run plugin variables init

* perf: init free plan

* perf: dataset data ui

* perf: workflow theme

* perf: plugin input modal ui

* perf: workflow dispatch

* fix: account ui

* feat: 4810 doc
This commit is contained in:
Archer
2024-09-03 09:56:33 +08:00
committed by GitHub
parent 5ebe0017a0
commit 761e35c226
19 changed files with 216 additions and 180 deletions

View File

@@ -68,7 +68,7 @@ const SettingLLMModel = ({
<Button
w={'100%'}
justifyContent={'flex-start'}
variant={'whiteFlow'}
variant={'whiteBase'}
bg={bg}
_active={{
transform: 'none'

View File

@@ -67,9 +67,9 @@ const Account = () => {
return (
<>
<Box py={[3, '28px']} maxW={['95vw', '1080px']} px={[5, 10]} mx={'auto'}>
<Box py={[3, '28px']} px={[5, 10]} mx={'auto'}>
{isPc ? (
<Flex justifyContent={'center'}>
<Flex justifyContent={'center'} maxW={'1080px'}>
<Box flex={'0 0 330px'}>
<MyInfo onOpenContact={onOpenContact} />
<Box mt={9}>
@@ -77,7 +77,7 @@ const Account = () => {
</Box>
</Box>
{!!standardPlan && (
<Box ml={'45px'} flex={'1 0 0'} maxW={'600px'}>
<Box ml={'45px'} flex={'1'} maxW={'600px'}>
<PlanUsage />
</Box>
)}
@@ -437,7 +437,7 @@ const PlanUsage = () => {
borderColor={'borderColor.low'}
borderRadius={'md'}
>
<Flex px={[5, 7]} py={[3, 6]} whiteSpace={'nowrap'}>
<Flex px={[5, 7]} pt={[3, 6]}>
<Box flex={'1 0 0'}>
<Box color={'myGray.600'} fontSize="sm">
{t('common:support.wallet.subscription.Current plan')}
@@ -445,24 +445,26 @@ const PlanUsage = () => {
<Box fontWeight={'bold'} fontSize="lg">
{t(planName as any)}
</Box>
{isFreeTeam ? (
<>
<Box mt="2" color={'#485264'} fontSize="sm">
{t('common:info.free_plan')}
</Box>
</>
) : (
<Flex mt="2" color={'#485264'} fontSize="xs">
<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('common:support.wallet.subscription.Upgrade plan')}
</Button>
</Flex>
<Box px={[5, 7]} pb={[3, 6]}>
{isFreeTeam ? (
<>
<Box mt="2" color={'#485264'} fontSize="sm">
{t('common:info.free_plan')}
</Box>
</>
) : (
<Flex mt="2" color={'#485264'} fontSize="xs">
<Box>{t('common:support.wallet.Plan expired time')}:</Box>
<Box ml={2}>{formatTime2YMD(standardPlan?.expiredTime)}</Box>
</Flex>
)}
</Box>
<Box py={3} borderTopWidth={'1px'} borderTopColor={'borderColor.base'}>
<Box py={[0, 3]} px={[5, 7]} overflow={'auto'}>
<StandardPlanContentList
@@ -479,7 +481,7 @@ const PlanUsage = () => {
borderColor={'borderColor.low'}
borderRadius={'md'}
px={[5, 10]}
pt={[2, 4]}
pt={4}
pb={[4, 7]}
>
<Flex>

View File

@@ -180,12 +180,11 @@ const UsageTable = () => {
))}
</Tbody>
</Table>
{!isLoading && usages.length === 0 && (
<EmptyTip text={t('common:user.no_usage_records')}></EmptyTip>
)}
</TableContainer>
{!isLoading && usages.length === 0 && (
<EmptyTip text={t('common:user.no_usage_records')}></EmptyTip>
)}
<Loading loading={isLoading} fixed={false} />
{!!usageDetail && (
<UsageDetail usage={usageDetail} onClose={() => setUsageDetail(undefined)} />

View File

@@ -125,7 +125,7 @@ const Header = () => {
try {
localStorage.removeItem(`${appDetail._id}-past`);
localStorage.removeItem(`${appDetail._id}-future`);
router.push('/app/list');
router.back();
} catch (error) {}
}, [appDetail._id, router]);

View File

@@ -15,7 +15,7 @@ const RouteTab = () => {
const setCurrentTab = useCallback(
(tab: TabEnum) => {
router.push({
router.replace({
query: {
...router.query,
currentTab: tab
@@ -41,7 +41,7 @@ const RouteTab = () => {
]
: [])
],
[appDetail.permission.hasManagePer, appT]
[appDetail.permission.hasManagePer, appDetail.type, appT]
);
return (

View File

@@ -125,7 +125,7 @@ const Header = () => {
try {
localStorage.removeItem(`${appDetail._id}-past`);
localStorage.removeItem(`${appDetail._id}-future`);
router.push('/app/list');
router.back();
} catch (error) {}
}, [appDetail._id, router]);

View File

@@ -74,8 +74,7 @@ const AppCard = ({
label: ExportPopover({
chatConfig: appDetail.chatConfig,
appName: appDetail.name
}),
onClick: () => {}
})
}
]
}
@@ -192,7 +191,7 @@ function ExportPopover({
const { t } = useTranslation();
const { copyData } = useCopyData();
const { flowData2StoreDataAndCheck } = useContextSelector(WorkflowContext, (v) => v);
const data = flowData2StoreDataAndCheck();
const onExportWorkflow = useCallback(async () => {
const data = flowData2StoreDataAndCheck();
if (data) {
@@ -251,7 +250,10 @@ function ExportPopover({
}}
borderRadius={'xs'}
onClick={() => {
const data = flowData2StoreDataAndCheck();
if (!data) return;
fileDownload({
text: JSON.stringify(
{

View File

@@ -312,6 +312,7 @@ const FieldEditModal = ({
title={isEdit ? t('workflow:edit_input') : t('workflow:add_new_input')}
maxW={['90vw', '1028px']}
w={'100%'}
isCentered
>
<Flex h={'560px'}>
<Stack gap={4} p={8}>

View File

@@ -50,7 +50,7 @@ const SelectAppRender = ({ item, nodeId }: RenderInputProps) => {
<>
<Box onClick={onOpenSelectApp}>
{!value ? (
<Button variant={'whiteFlow'} w={'100%'}>
<Button variant={'whiteBase'} w={'100%'}>
{t('common:core.module.Select app')}
</Button>
) : (
@@ -58,7 +58,7 @@ const SelectAppRender = ({ item, nodeId }: RenderInputProps) => {
isLoading={loading}
w={'100%'}
justifyContent={loading ? 'center' : 'flex-start'}
variant={'whiteFlow'}
variant={'whiteBase'}
leftIcon={<Avatar src={appDetail?.avatar} w={6} />}
>
{appDetail?.name}

View File

@@ -179,7 +179,7 @@ const DataCard = () => {
<Flex align={'center'} color={'myGray.500'}>
<MyIcon name="common/list" mr={2} w={'18px'} />
<Box as={'span'} fontSize={['sm', '14px']} fontWeight={'500'}>
{t('core.dataset.data.Total Amount', { total })}
{t('common:core.dataset.data.Total Amount', { total })}
</Box>
</Flex>
<Box flex={1} mr={1} />
@@ -204,7 +204,7 @@ const DataCard = () => {
/>
</Flex>
{/* data */}
<Box flex={'1 0 0'} overflow={'auto'} px={5}>
<Box flex={'1 0 0'} overflow={'auto'} px={5} pb={5}>
<Flex flexDir={'column'} gap={2}>
{datasetDataList.map((item, index) => (
<Card