mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
feat: plugin input type add select and custom var (#2571)
* feat: plugin input type add select and custom var * fix * fix ui * fix * fix
This commit is contained in:
@@ -15,6 +15,7 @@ export enum FlowNodeInputTypeEnum { // render ui
|
||||
|
||||
// special input
|
||||
selectApp = 'selectApp',
|
||||
customVariable = 'customVariable',
|
||||
|
||||
// ai model select
|
||||
selectLLMModel = 'selectLLMModel',
|
||||
@@ -44,7 +45,7 @@ export const FlowNodeInputMap: Record<
|
||||
icon: 'core/workflow/inputType/numberInput'
|
||||
},
|
||||
[FlowNodeInputTypeEnum.select]: {
|
||||
icon: 'core/workflow/inputType/input'
|
||||
icon: 'core/workflow/inputType/option'
|
||||
},
|
||||
[FlowNodeInputTypeEnum.switch]: {
|
||||
icon: 'core/workflow/inputType/switch'
|
||||
@@ -79,8 +80,11 @@ export const FlowNodeInputMap: Record<
|
||||
[FlowNodeInputTypeEnum.hidden]: {
|
||||
icon: 'core/workflow/inputType/select'
|
||||
},
|
||||
[FlowNodeInputTypeEnum.customVariable]: {
|
||||
icon: 'core/workflow/inputType/customVariable'
|
||||
},
|
||||
[FlowNodeInputTypeEnum.custom]: {
|
||||
icon: 'core/workflow/inputType/select'
|
||||
icon: 'core/workflow/inputType/custom'
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -173,14 +173,17 @@ export const pluginData2FlowNodeIO = ({
|
||||
const pluginOutput = nodes.find((node) => node.flowNodeType === FlowNodeTypeEnum.pluginOutput);
|
||||
|
||||
return {
|
||||
inputs: pluginInput
|
||||
? pluginInput.inputs.map((item) => ({
|
||||
...item,
|
||||
...getModuleInputUiField(item),
|
||||
value: getOrInitModuleInputValue(item),
|
||||
canEdit: false
|
||||
}))
|
||||
: [],
|
||||
inputs:
|
||||
pluginInput?.inputs.map((item) => ({
|
||||
...item,
|
||||
...getModuleInputUiField(item),
|
||||
value: getOrInitModuleInputValue(item),
|
||||
canEdit: false,
|
||||
renderTypeList:
|
||||
item.renderTypeList[0] === FlowNodeInputTypeEnum.customVariable
|
||||
? [FlowNodeInputTypeEnum.reference, FlowNodeInputTypeEnum.input]
|
||||
: item.renderTypeList
|
||||
})) || [],
|
||||
outputs: pluginOutput
|
||||
? [
|
||||
...pluginOutput.inputs.map((item) => ({
|
||||
|
Reference in New Issue
Block a user