From df95b6eba0569ec6d909f90aa6c8a65f26c77f9c Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 21 Jul 2025 15:12:26 +0800 Subject: [PATCH] chore: remove debug code --- .../config/automatic/get-automatic-res.tsx | 19 +++------ .../code-generator/get-code-generator-res.tsx | 39 +++++++------------ 2 files changed, 20 insertions(+), 38 deletions(-) diff --git a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx index fbad952e79..7c11510399 100644 --- a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx +++ b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx @@ -131,8 +131,8 @@ const GetAutomaticRes: FC = ({ }, ] - const [instruction, setInstruction] = useState('The travel plan to Anshun of Guizhou Province in China') // TODO: test value - const [ideaOutput, setIdeaOutput] = useState('use json format to output the result. Content in result uses Chinese. Format: {"summary: "summary content", "result": "result content"}') + const [instruction, setInstruction] = useState('') + const [ideaOutput, setIdeaOutput] = useState('') const handleChooseTemplate = useCallback((key: string) => { return () => { @@ -158,14 +158,6 @@ const GetAutomaticRes: FC = ({ storageKey, }) - // useEffect(() => { - // // if (!versions.length) { - // addVersion({ - // modified: 'ddd', - // }) - // // } - // }, []) - useEffect(() => { if (defaultModel) { const localModel = localStorage.getItem('auto-gen-model') @@ -364,15 +356,14 @@ const GetAutomaticRes: FC = ({ onClick={onGenerate} disabled={isLoading} > - + {t('appDebug.generate.generate')} - {/* {(!isLoading && res) && ( */} - { + {(!isLoading && current) && (
= ({ generatorType={GeneratorType.prompt} />
- } + )} {isLoading && renderLoading} {isShowAutoPromptResPlaceholder() && !renderNoData} {isShowConfirmOverwrite && ( diff --git a/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx b/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx index 0bf2f54b28..066fb774c9 100644 --- a/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx +++ b/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx @@ -71,7 +71,7 @@ export const GetCodeGeneratorResModal: FC = ( defaultModel, } = useModelListAndDefaultModelAndCurrentProviderAndModel(ModelTypeEnum.textGeneration) const [instruction, setInstruction] = useState('') - const [ideaOutput, setIdeaOutput] = useState('Write comment in Janpanese') + const [ideaOutput, setIdeaOutput] = useState('') const [isLoading, { setTrue: setLoadingTrue, setFalse: setLoadingFalse }] = useBoolean(false) const storageKey = `${flowId}-${nodeId}}` @@ -79,15 +79,6 @@ export const GetCodeGeneratorResModal: FC = ( storageKey, }) - // useEffect(() => { - // if (!versions?.length) { - // addVersion({ - // modified: `def main(num1: float, num2: float) -> dict: - // return {'result': num1 + num2}`, - // }) - // } - // }, []) - const isValid = () => { if (instruction.trim() === '') { Toast.notify({ @@ -144,7 +135,7 @@ export const GetCodeGeneratorResModal: FC = ( message: error, }) } - else { + else { addVersion(res) } } @@ -247,7 +238,7 @@ export const GetCodeGeneratorResModal: FC = ( onClick={onGenerate} disabled={isLoading} > - + {t('appDebug.codegen.generate')} @@ -255,18 +246,18 @@ export const GetCodeGeneratorResModal: FC = ( {isLoading && renderLoading} {!isLoading && !current && renderNoData} - {/* {(!isLoading && res) && ( */} -
- -
- {/* )} */} + {(!isLoading && current) && ( +
+ +
+ )} {isShowConfirmOverwrite && (