diff --git a/packages/global/core/app/jsonschema.ts b/packages/global/core/app/jsonschema.ts index cc3061b62..53426efed 100644 --- a/packages/global/core/app/jsonschema.ts +++ b/packages/global/core/app/jsonschema.ts @@ -84,13 +84,19 @@ const getNodeInputRenderTypeFromSchemaInputType = ({ } return { renderTypeList: [FlowNodeInputTypeEnum.JSONEditor, FlowNodeInputTypeEnum.reference] }; }; -export const jsonSchema2NodeInput = (jsonSchema: JSONSchemaInputType): FlowNodeInputItemType[] => { +export const jsonSchema2NodeInput = ({ + jsonSchema, + schemaType +}: { + jsonSchema: JSONSchemaInputType; + schemaType: 'mcp' | 'http'; +}): FlowNodeInputItemType[] => { return Object.entries(jsonSchema?.properties || {}).map(([key, value]) => ({ key, label: key, valueType: getNodeInputTypeFromSchemaInputType({ type: value.type, arrayItems: value.items }), description: value.description, - toolDescription: value['x-tool-description'] ?? value.description ?? key, + toolDescription: schemaType === 'http' ? value['x-tool-description'] : value.description || key, required: jsonSchema?.required?.includes(key), ...getNodeInputRenderTypeFromSchemaInputType(value) })); diff --git a/packages/global/core/app/tool/httpTool/utils.ts b/packages/global/core/app/tool/httpTool/utils.ts index ffb813def..49a9770c1 100644 --- a/packages/global/core/app/tool/httpTool/utils.ts +++ b/packages/global/core/app/tool/httpTool/utils.ts @@ -69,7 +69,7 @@ export const getHTTPToolRuntimeNode = ({ toolId: `${AppToolSourceEnum.http}-${parentId}/${tool.name}` } }, - inputs: jsonSchema2NodeInput(tool.inputSchema), + inputs: jsonSchema2NodeInput({ jsonSchema: tool.inputSchema, schemaType: 'http' }), outputs: [ ...jsonSchema2NodeOutput(tool.outputSchema), { diff --git a/packages/global/core/app/tool/mcpTool/utils.ts b/packages/global/core/app/tool/mcpTool/utils.ts index c5e5efeb2..77f5696d6 100644 --- a/packages/global/core/app/tool/mcpTool/utils.ts +++ b/packages/global/core/app/tool/mcpTool/utils.ts @@ -62,7 +62,7 @@ export const getMCPToolRuntimeNode = ({ toolId: `${AppToolSourceEnum.mcp}-${parentId}/${tool.name}` } }, - inputs: jsonSchema2NodeInput(tool.inputSchema), + inputs: jsonSchema2NodeInput({ jsonSchema: tool.inputSchema, schemaType: 'mcp' }), outputs: [ { id: NodeOutputKeyEnum.rawResponse, diff --git a/projects/app/src/pageComponents/app/detail/HTTPTools/EditForm.tsx b/projects/app/src/pageComponents/app/detail/HTTPTools/EditForm.tsx index 661096d99..11fba5e9e 100644 --- a/projects/app/src/pageComponents/app/detail/HTTPTools/EditForm.tsx +++ b/projects/app/src/pageComponents/app/detail/HTTPTools/EditForm.tsx @@ -154,13 +154,17 @@ const EditForm = ({ > - - {renderHttpMethod(tool.method)} + + {renderHttpMethod(tool.method)} {tool.name} @@ -170,6 +174,10 @@ const EditForm = ({ fontSize={'14px'} lineHeight={'20px'} letterSpacing={'0.25px'} + whiteSpace={'nowrap'} + overflow={'hidden'} + textOverflow={'ellipsis'} + maxW={'200px'} > {tool.path} diff --git a/projects/app/src/pageComponents/app/detail/SimpleApp/components/ToolSelectModal.tsx b/projects/app/src/pageComponents/app/detail/SimpleApp/components/ToolSelectModal.tsx index 35d044ebe..44ffbf8e7 100644 --- a/projects/app/src/pageComponents/app/detail/SimpleApp/components/ToolSelectModal.tsx +++ b/projects/app/src/pageComponents/app/detail/SimpleApp/components/ToolSelectModal.tsx @@ -371,7 +371,7 @@ const RenderList = React.memo(function RenderList({ objectFit={'contain'} borderRadius={'sm'} /> - + {t(parseI18nString(template.name, i18n.language))} {isSystemTool && ( @@ -408,16 +408,19 @@ const RenderList = React.memo(function RenderList({ borderRadius={'sm'} flexShrink={0} /> - - - {t(parseI18nString(template.name, i18n.language))} - + + {t(parseI18nString(template.name, i18n.language))} + {selected ? (