feat: app template;fix: chat test reset (#1838)

* feat: app template;fix: chat test reset

* template output

* template output
This commit is contained in:
Archer
2024-06-25 13:47:25 +08:00
committed by GitHub
parent 5c8c7fb9f2
commit c8bc9838e3
11 changed files with 2110 additions and 462 deletions

View File

@@ -316,8 +316,8 @@ export const ResponseBox = React.memo(function ResponseBox({
)}
{/* code */}
<Row label={workflowT('response.Custom inputs')} value={activeModule?.customInputs} />
<Row label={workflowT('response.Custom outputs')} value={activeModule?.customOutputs} />
<Row label={workflowT('response.Custom inputs')} value={activeModule?.customInputs} />
<Row label={workflowT('response.Code log')} value={activeModule?.codeLog} />
</Box>
</>

View File

@@ -1,11 +1,9 @@
import type { StoreNodeItemType } from '@fastgpt/global/core/workflow/type/index.d';
import React, { useRef, forwardRef, ForwardedRef, useImperativeHandle } from 'react';
import React, { forwardRef, ForwardedRef } from 'react';
import { SmallCloseIcon } from '@chakra-ui/icons';
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 { useUserStore } from '@/web/support/user/useUserStore';
import type { ComponentRef } from '@/components/ChatBox/type.d';
import { useTranslation } from 'next-i18next';
import { StoreEdgeItemType } from '@fastgpt/global/core/workflow/type/edge';
@@ -32,7 +30,6 @@ const ChatTest = (
ref: ForwardedRef<ChatTestComponentRef>
) => {
const { t } = useTranslation();
const ChatBoxRef = useRef<ComponentRef>(null);
const { appDetail } = useContextSelector(AppContext, (v) => v);
const { resetChatBox, ChatBox } = useChatTest({
@@ -41,10 +38,6 @@ const ChatTest = (
chatConfig: appDetail.chatConfig
});
useImperativeHandle(ref, () => ({
resetChatTest: resetChatBox
}));
return (
<>
<Box
@@ -84,9 +77,7 @@ const ChatTest = (
borderRadius={'md'}
aria-label={'delete'}
onClick={(e) => {
e.stopPropagation();
ChatBoxRef.current?.resetHistory([]);
ChatBoxRef.current?.resetVariables();
resetChatBox();
}}
/>
</MyTooltip>

File diff suppressed because it is too large Load Diff