perf: remove unuse code (#2227)

This commit is contained in:
Archer
2024-07-31 15:43:58 +08:00
committed by GitHub
parent 8c7f4a3a30
commit 2fdca621e6
14 changed files with 27 additions and 90 deletions

View File

@@ -1,5 +1,5 @@
import { Box, Flex, TextareaProps } from '@chakra-ui/react';
import React, { useTransition } from 'react';
import React from 'react';
import MyIcon from '@fastgpt/web/components/common/Icon';
import ChatFunctionTip from './Tip';
import MyTextarea from '@/components/common/Textarea/MyTextarea';

View File

@@ -1,5 +1,5 @@
import { Box, BoxProps, Card, Flex } from '@chakra-ui/react';
import React, { useMemo, useTransition } from 'react';
import React, { useMemo } from 'react';
import ChatController, { type ChatControllerProps } from './ChatController';
import ChatAvatar from './ChatAvatar';
import { MessageCardStyle } from '../constants';

View File

@@ -14,7 +14,6 @@ import { useRouter } from 'next/router';
import AppCard from '../WorkflowComponents/AppCard';
import { uiWorkflow2StoreWorkflow } from '../WorkflowComponents/utils';
import { useSystemStore } from '@/web/common/system/useSystemStore';
import RouteTab from '../RouteTab';
import { useSystem } from '@fastgpt/web/hooks/useSystem';
const PublishHistories = dynamic(() => import('../PublishHistoriesSlider'));
@@ -54,6 +53,7 @@ const Header = () => {
router.push('/app/list');
} catch (error) {}
}, [onSaveWorkflow, router]);
// effect
useBeforeunload({
callback: onSaveWorkflow,

View File

@@ -69,4 +69,4 @@ const Render = () => {
);
};
export default React.memo(Render);
export default Render;

View File

@@ -69,4 +69,4 @@ const Render = () => {
);
};
export default React.memo(Render);
export default Render;

View File

@@ -1,7 +1,7 @@
import type { StoreNodeItemType } from '@fastgpt/global/core/workflow/type/node.d';
import React from 'react';
import { SmallCloseIcon } from '@chakra-ui/icons';
import { Box, Flex, HStack, IconButton } from '@chakra-ui/react';
import { Box, Flex, IconButton } from '@chakra-ui/react';
import MyIcon from '@fastgpt/web/components/common/Icon';
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
import { useTranslation } from 'next-i18next';

View File

@@ -305,7 +305,7 @@ export function RenderHttpProps({
{t('common:core.module.Http request props')}
<QuestionTip
ml={1}
label={t('core.module.http.Props tip', { variable: variableText })}
label={t('common:core.module.http.Props tip', { variable: variableText })}
></QuestionTip>
</Flex>
<LightRowTabs<TabEnum>

View File

@@ -5,11 +5,7 @@ import {
storeNode2FlowNode
} from '@/web/core/workflow/utils';
import { getErrText } from '@fastgpt/global/common/error/utils';
import {
NodeOutputKeyEnum,
RuntimeEdgeStatusEnum,
WorkflowIOValueTypeEnum
} from '@fastgpt/global/core/workflow/constants';
import { NodeOutputKeyEnum, RuntimeEdgeStatusEnum } from '@fastgpt/global/core/workflow/constants';
import { FlowNodeTypeEnum } from '@fastgpt/global/core/workflow/node/constant';
import { RuntimeNodeItemType } from '@fastgpt/global/core/workflow/runtime/type';
import { FlowNodeItemType, StoreNodeItemType } from '@fastgpt/global/core/workflow/type/node';
@@ -49,11 +45,7 @@ import { useDisclosure } from '@chakra-ui/react';
import { uiWorkflow2StoreWorkflow } from './utils';
import { useTranslation } from 'next-i18next';
import { useRequest2 } from '@fastgpt/web/hooks/useRequest';
import {
formatTime2HM,
formatTime2YMDHM,
formatTime2YMDHMW
} from '@fastgpt/global/common/string/time';
import { formatTime2HM, formatTime2YMDHMW } from '@fastgpt/global/common/string/time';
import type { InitProps } from '@/pages/app/detail/components/PublishHistoriesSlider';
import { cloneDeep } from 'lodash';

View File

@@ -19,10 +19,10 @@ import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
import dynamic from 'next/dynamic';
import { useChat } from '@/components/core/chat/ChatContainer/useChat';
import { Box } from '@chakra-ui/react';
import ChatBox from '@/components/core/chat/ChatContainer/ChatBox';
import { AppChatConfigType } from '@fastgpt/global/core/app/type';
const PluginRunBox = dynamic(() => import('@/components/core/chat/ChatContainer/PluginRunBox'));
const ChatBox = dynamic(() => import('@/components/core/chat/ChatContainer/ChatBox'));
export const useChatTest = ({
nodes,

View File

@@ -9,12 +9,15 @@ import AppContextProvider, { AppContext } from './components/context';
import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
const SimpleEdit = dynamic(() => import('./components/SimpleApp'), {
ssr: false,
loading: () => <Loading fixed={false} />
});
const Workflow = dynamic(() => import('./components/Workflow'), {
ssr: false,
loading: () => <Loading fixed={false} />
});
const Plugin = dynamic(() => import('./components/Plugin'), {
ssr: false,
loading: () => <Loading fixed={false} />
});