mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 01:01:11 +03:00
Merge pull request #510 from FlowiseAI/feature/API-Config
modify options and password api config
This commit is contained in:
@@ -633,21 +633,32 @@ export const findAvailableConfigs = (reactFlowNodes: IReactFlowNode[]) => {
|
|||||||
for (const flowNode of reactFlowNodes) {
|
for (const flowNode of reactFlowNodes) {
|
||||||
for (const inputParam of flowNode.data.inputParams) {
|
for (const inputParam of flowNode.data.inputParams) {
|
||||||
let obj: IOverrideConfig
|
let obj: IOverrideConfig
|
||||||
if (inputParam.type === 'password' || inputParam.type === 'options') {
|
if (inputParam.type === 'file') {
|
||||||
continue
|
|
||||||
} else if (inputParam.type === 'file') {
|
|
||||||
obj = {
|
obj = {
|
||||||
node: flowNode.data.label,
|
node: flowNode.data.label,
|
||||||
label: inputParam.label,
|
label: inputParam.label,
|
||||||
name: 'files',
|
name: 'files',
|
||||||
type: inputParam.fileType ?? inputParam.type
|
type: inputParam.fileType ?? inputParam.type
|
||||||
}
|
}
|
||||||
|
} else if (inputParam.type === 'options') {
|
||||||
|
obj = {
|
||||||
|
node: flowNode.data.label,
|
||||||
|
label: inputParam.label,
|
||||||
|
name: inputParam.name,
|
||||||
|
type: inputParam.options
|
||||||
|
? inputParam.options
|
||||||
|
?.map((option) => {
|
||||||
|
return option.name
|
||||||
|
})
|
||||||
|
.join(', ')
|
||||||
|
: 'string'
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
obj = {
|
obj = {
|
||||||
node: flowNode.data.label,
|
node: flowNode.data.label,
|
||||||
label: inputParam.label,
|
label: inputParam.label,
|
||||||
name: inputParam.name,
|
name: inputParam.name,
|
||||||
type: inputParam.type
|
type: inputParam.type === 'password' ? 'string' : inputParam.type
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!configs.some((config) => JSON.stringify(config) === JSON.stringify(obj))) {
|
if (!configs.some((config) => JSON.stringify(config) === JSON.stringify(obj))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user