|
|
|
@ -21,6 +21,7 @@ import ModelParameterModal from '@/app/components/plugins/plugin-detail-panel/mo
|
|
|
|
import ToolSelector from '@/app/components/plugins/plugin-detail-panel/tool-selector'
|
|
|
|
import ToolSelector from '@/app/components/plugins/plugin-detail-panel/tool-selector'
|
|
|
|
import MultipleToolSelector from '@/app/components/plugins/plugin-detail-panel/multiple-tool-selector'
|
|
|
|
import MultipleToolSelector from '@/app/components/plugins/plugin-detail-panel/multiple-tool-selector'
|
|
|
|
import AppSelector from '@/app/components/plugins/plugin-detail-panel/app-selector'
|
|
|
|
import AppSelector from '@/app/components/plugins/plugin-detail-panel/app-selector'
|
|
|
|
|
|
|
|
import VarReferencePicker from '@/app/components/workflow/nodes/_base/components/variable/var-reference-picker'
|
|
|
|
import RadioE from '@/app/components/base/radio/ui'
|
|
|
|
import RadioE from '@/app/components/base/radio/ui'
|
|
|
|
import type {
|
|
|
|
import type {
|
|
|
|
NodeOutPutVar,
|
|
|
|
NodeOutPutVar,
|
|
|
|
@ -409,6 +410,38 @@ function Form<
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (formSchema.type === FormTypeEnum.varSelector) {
|
|
|
|
|
|
|
|
const {
|
|
|
|
|
|
|
|
variable, label, required, scope,
|
|
|
|
|
|
|
|
} = formSchema as (CredentialFormSchemaTextInput | CredentialFormSchemaSecretInput)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<div key={variable} className={cn(itemClassName, 'py-3')}>
|
|
|
|
|
|
|
|
<div className={cn(fieldLabelClassName, 'system-sm-semibold flex items-center py-2 text-text-secondary')}>
|
|
|
|
|
|
|
|
{label[language] || label.en_US}
|
|
|
|
|
|
|
|
{required && (
|
|
|
|
|
|
|
|
<span className='ml-1 text-red-500'>*</span>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
{tooltipContent}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<VarReferencePicker
|
|
|
|
|
|
|
|
zIndex={1001}
|
|
|
|
|
|
|
|
readonly={false}
|
|
|
|
|
|
|
|
isShowNodeName
|
|
|
|
|
|
|
|
nodeId={nodeId || ''}
|
|
|
|
|
|
|
|
value={value[variable] || []}
|
|
|
|
|
|
|
|
onChange={item => handleFormChange(variable, item as any)}
|
|
|
|
|
|
|
|
filterVar={(varPayload) => {
|
|
|
|
|
|
|
|
if (!scope) return true
|
|
|
|
|
|
|
|
return scope.split('&').includes(varPayload.type)
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
{fieldMoreInfo?.(formSchema)}
|
|
|
|
|
|
|
|
{validating && changeKey === variable && <ValidatingTip />}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// @ts-expect-error it work
|
|
|
|
// @ts-expect-error it work
|
|
|
|
if (!Object.values(FormTypeEnum).includes(formSchema.type))
|
|
|
|
if (!Object.values(FormTypeEnum).includes(formSchema.type))
|
|
|
|
return customRenderField?.(formSchema as CustomFormSchema, filteredProps)
|
|
|
|
return customRenderField?.(formSchema as CustomFormSchema, filteredProps)
|
|
|
|
|