mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 18:08:07 +08:00
fix: not obj type struct schema render error
This commit is contained in:
@ -136,23 +136,28 @@ const Panel: FC<NodePanelProps<DataSourceNodeType>> = ({ id, data }) => {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
outputSchema.map(outputItem => (
|
outputSchema.map((outputItem) => {
|
||||||
|
const schemaType = getMatchedSchemaType(outputItem.value)
|
||||||
|
|
||||||
|
return (
|
||||||
<div key={outputItem.name}>
|
<div key={outputItem.name}>
|
||||||
{outputItem.value?.type === 'object' ? (
|
{outputItem.value?.type === 'object' ? (
|
||||||
<StructureOutputItem
|
<StructureOutputItem
|
||||||
rootClassName='code-sm-semibold text-text-secondary'
|
rootClassName='code-sm-semibold text-text-secondary'
|
||||||
payload={wrapStructuredVarItem(outputItem, getMatchedSchemaType(outputItem.value))} />
|
payload={wrapStructuredVarItem(outputItem, schemaType)}
|
||||||
|
/>
|
||||||
) : (
|
) : (
|
||||||
<VarItem
|
<VarItem
|
||||||
name={outputItem.name}
|
name={outputItem.name}
|
||||||
type={outputItem.type.toLocaleLowerCase()}
|
// eslint-disable-next-line sonarjs/no-nested-template-literals
|
||||||
|
type={`${outputItem.type.toLocaleLowerCase()}${schemaType ? ` (${schemaType})` : ''}`}
|
||||||
description={outputItem.description}
|
description={outputItem.description}
|
||||||
isIndent={hasObjectOutput}
|
isIndent={hasObjectOutput}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
))
|
)
|
||||||
}
|
})}
|
||||||
</OutputVars>
|
</OutputVars>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -117,22 +117,27 @@ const Panel: FC<NodePanelProps<ToolNodeType>> = ({
|
|||||||
description={t(`${i18nPrefix}.outputVars.json`)}
|
description={t(`${i18nPrefix}.outputVars.json`)}
|
||||||
isIndent={hasObjectOutput}
|
isIndent={hasObjectOutput}
|
||||||
/>
|
/>
|
||||||
{outputSchema.map(outputItem => (
|
{outputSchema.map((outputItem) => {
|
||||||
<div key={outputItem.name}>
|
const schemaType = getMatchedSchemaType(outputItem.value)
|
||||||
{outputItem.value?.type === 'object' ? (
|
return (
|
||||||
<StructureOutputItem
|
<div key={outputItem.name}>
|
||||||
rootClassName='code-sm-semibold text-text-secondary'
|
{outputItem.value?.type === 'object' ? (
|
||||||
payload={wrapStructuredVarItem(outputItem, getMatchedSchemaType(outputItem.value))} />
|
<StructureOutputItem
|
||||||
) : (
|
rootClassName='code-sm-semibold text-text-secondary'
|
||||||
<VarItem
|
payload={wrapStructuredVarItem(outputItem, schemaType)}
|
||||||
name={outputItem.name}
|
/>
|
||||||
type={outputItem.type.toLocaleLowerCase()}
|
) : (
|
||||||
description={outputItem.description}
|
<VarItem
|
||||||
isIndent={hasObjectOutput}
|
name={outputItem.name}
|
||||||
/>
|
// eslint-disable-next-line sonarjs/no-nested-template-literals
|
||||||
)}
|
type={`${outputItem.type.toLocaleLowerCase()}${schemaType ? ` (${schemaType})` : ''}`}
|
||||||
</div>
|
description={outputItem.description}
|
||||||
))}
|
isIndent={hasObjectOutput}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
</>
|
</>
|
||||||
</OutputVars>
|
</OutputVars>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user