mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
perf: all plugin variables type support referense & replace input and textarea with prompt editor (#2950)
* support reference as plugin variables * replace input and textarea with prompt editor * adjust height & optimize textarea and input * input select
This commit is contained in:
@@ -267,6 +267,7 @@ export enum NodeOutputKeyEnum {
|
||||
export enum VariableInputEnum {
|
||||
input = 'input',
|
||||
textarea = 'textarea',
|
||||
textInput = 'textInput',
|
||||
numberInput = 'numberInput',
|
||||
select = 'select',
|
||||
custom = 'custom'
|
||||
@@ -294,6 +295,12 @@ export const variableMap: Record<
|
||||
defaultValueType: WorkflowIOValueTypeEnum.string,
|
||||
description: i18nT('app:variable.textarea_type_desc')
|
||||
},
|
||||
[VariableInputEnum.textInput]: {
|
||||
icon: 'core/workflow/inputType/input',
|
||||
label: i18nT('common:core.workflow.inputType.textInput'),
|
||||
value: VariableInputEnum.textInput,
|
||||
defaultValueType: WorkflowIOValueTypeEnum.string
|
||||
},
|
||||
[VariableInputEnum.numberInput]: {
|
||||
icon: 'core/workflow/inputType/numberInput',
|
||||
label: i18nT('common:core.workflow.inputType.number input'),
|
||||
|
@@ -1,14 +1,13 @@
|
||||
import { WorkflowIOValueTypeEnum } from '../constants';
|
||||
import { i18nT } from '../../../../web/i18n/utils';
|
||||
export enum FlowNodeInputTypeEnum { // render ui
|
||||
textInput = 'textInput',
|
||||
reference = 'reference', // reference to other node output
|
||||
input = 'input', // one line input
|
||||
numberInput = 'numberInput',
|
||||
switch = 'switch', // true/false
|
||||
select = 'select',
|
||||
|
||||
// editor
|
||||
textarea = 'textarea',
|
||||
JSONEditor = 'JSONEditor',
|
||||
|
||||
addInputParam = 'addInputParam', // params input
|
||||
@@ -27,7 +26,11 @@ export enum FlowNodeInputTypeEnum { // render ui
|
||||
settingDatasetQuotePrompt = 'settingDatasetQuotePrompt',
|
||||
|
||||
hidden = 'hidden',
|
||||
custom = 'custom'
|
||||
custom = 'custom',
|
||||
|
||||
// deprecated
|
||||
input = 'input', // one line input
|
||||
textarea = 'textarea'
|
||||
}
|
||||
export const FlowNodeInputMap: Record<
|
||||
FlowNodeInputTypeEnum,
|
||||
@@ -35,12 +38,12 @@ export const FlowNodeInputMap: Record<
|
||||
icon: string;
|
||||
}
|
||||
> = {
|
||||
[FlowNodeInputTypeEnum.textInput]: {
|
||||
icon: 'core/workflow/inputType/input'
|
||||
},
|
||||
[FlowNodeInputTypeEnum.reference]: {
|
||||
icon: 'core/workflow/inputType/reference'
|
||||
},
|
||||
[FlowNodeInputTypeEnum.input]: {
|
||||
icon: 'core/workflow/inputType/input'
|
||||
},
|
||||
[FlowNodeInputTypeEnum.numberInput]: {
|
||||
icon: 'core/workflow/inputType/numberInput'
|
||||
},
|
||||
@@ -50,9 +53,6 @@ export const FlowNodeInputMap: Record<
|
||||
[FlowNodeInputTypeEnum.switch]: {
|
||||
icon: 'core/workflow/inputType/switch'
|
||||
},
|
||||
[FlowNodeInputTypeEnum.textarea]: {
|
||||
icon: 'core/workflow/inputType/textarea'
|
||||
},
|
||||
[FlowNodeInputTypeEnum.JSONEditor]: {
|
||||
icon: 'core/workflow/inputType/jsonEditor'
|
||||
},
|
||||
@@ -85,6 +85,12 @@ export const FlowNodeInputMap: Record<
|
||||
},
|
||||
[FlowNodeInputTypeEnum.custom]: {
|
||||
icon: 'core/workflow/inputType/custom'
|
||||
},
|
||||
[FlowNodeInputTypeEnum.input]: {
|
||||
icon: 'core/workflow/inputType/input'
|
||||
},
|
||||
[FlowNodeInputTypeEnum.textarea]: {
|
||||
icon: 'core/workflow/inputType/textarea'
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -230,6 +230,10 @@ export const appData2FlowNodeIO = ({
|
||||
FlowNodeInputTypeEnum.textarea,
|
||||
FlowNodeInputTypeEnum.reference
|
||||
],
|
||||
[VariableInputEnum.textInput]: [
|
||||
FlowNodeInputTypeEnum.textInput,
|
||||
FlowNodeInputTypeEnum.reference
|
||||
],
|
||||
[VariableInputEnum.numberInput]: [FlowNodeInputTypeEnum.numberInput],
|
||||
[VariableInputEnum.select]: [FlowNodeInputTypeEnum.select],
|
||||
[VariableInputEnum.custom]: [
|
||||
|
Reference in New Issue
Block a user