From f1d964288dfb2129f509b30938959a56ef7d731a Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 30 May 2025 16:48:46 +0800 Subject: [PATCH] fix: schema title use prop name --- .../tool-selector/reasoning-config-form.tsx | 10 ++++++---- .../plugin-detail-panel/tool-selector/schema-modal.tsx | 3 +++ .../json-schema-config-modal/visual-editor/index.tsx | 3 ++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/web/app/components/plugins/plugin-detail-panel/tool-selector/reasoning-config-form.tsx b/web/app/components/plugins/plugin-detail-panel/tool-selector/reasoning-config-form.tsx index 49b099662a..017e0eb7aa 100644 --- a/web/app/components/plugins/plugin-detail-panel/tool-selector/reasoning-config-form.tsx +++ b/web/app/components/plugins/plugin-detail-panel/tool-selector/reasoning-config-form.tsx @@ -143,9 +143,9 @@ const ReasoningConfigForm: React.FC = ({ }] = useBoolean(false) const [schema, setSchema] = useState(null) - console.log(schema) + const [schemaRootName, setSchemaRootName] = useState('') - const renderField = (schema: any, showSchema: (schema: SchemaRoot) => void) => { + const renderField = (schema: any, showSchema: (schema: SchemaRoot, rootName: string) => void) => { const { variable, label, @@ -205,7 +205,7 @@ const ReasoningConfigForm: React.FC = ({ asChild={false}>
showSchema(input_schema as SchemaRoot)} + onClick={() => showSchema(input_schema as SchemaRoot, label[language] || label.en_US)} >
@@ -318,14 +318,16 @@ const ReasoningConfigForm: React.FC = ({ } return (
- {!isShowSchema && schemas.map(schema => renderField(schema, (s: SchemaRoot) => { + {!isShowSchema && schemas.map(schema => renderField(schema, (s: SchemaRoot, rootName: string) => { setSchema(s) + setSchemaRootName(rootName) showSchema() }))} {isShowSchema && ( )} diff --git a/web/app/components/plugins/plugin-detail-panel/tool-selector/schema-modal.tsx b/web/app/components/plugins/plugin-detail-panel/tool-selector/schema-modal.tsx index de4e96a8b7..d9dd907816 100644 --- a/web/app/components/plugins/plugin-detail-panel/tool-selector/schema-modal.tsx +++ b/web/app/components/plugins/plugin-detail-panel/tool-selector/schema-modal.tsx @@ -11,12 +11,14 @@ import { RiCloseLine } from '@remixicon/react' type Props = { isShow: boolean schema: SchemaRoot + rootName: string onClose: () => void } const SchemaModal: FC = ({ isShow, schema, + rootName, onClose, }) => { const { t } = useTranslation() @@ -43,6 +45,7 @@ const SchemaModal: FC = ({ diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/index.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/index.tsx index 50924b5629..28b9035edd 100644 --- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/index.tsx +++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/index.tsx @@ -5,6 +5,7 @@ import { useSchemaNodeOperations } from './hooks' export type VisualEditorProps = { schema: SchemaRoot + rootName?: string readOnly?: boolean onChange?: (schema: SchemaRoot) => void } @@ -16,7 +17,7 @@ const VisualEditor: FC = (props) => { return (