mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-28 17:29:44 +00:00
feat: app template;fix: chat test reset (#1838)
* feat: app template;fix: chat test reset * template output * template output
This commit is contained in:
@@ -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>
|
||||
</>
|
||||
|
@@ -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
Reference in New Issue
Block a user