Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
f000fbb1
authored
Jul 16, 2025
by
heheer
Committed by
GitHub
Jul 16, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compatible with old enums (#5219)
* compatible with old enums\ * add id
parent
4e2ab1f6
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
40 additions
and
7 deletions
+40
-7
packages/global/core/workflow/utils.ts
+7
-1
packages/web/components/common/Textarea/PromptEditor/type.d.ts
+1
-0
projects/app/src/components/core/app/VariableEdit.tsx
+1
-1
projects/app/src/components/core/app/formRender/index.tsx
+5
-2
projects/app/src/components/core/app/formRender/type.d.ts
+3
-0
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/NodeHttp/index.tsx
+4
-0
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/NodeVariableUpdate.tsx
+1
-0
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/RenderInput/templates/CommonInputForm.tsx
+1
-0
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/RenderInput/templates/SettingQuotePrompt.tsx
+8
-2
projects/app/src/pageComponents/app/detail/WorkflowComponents/utils.tsx
+2
-0
projects/app/src/web/core/app/utils.ts
+6
-0
projects/app/src/web/core/workflow/adapt.ts
+1
-1
No files found.
packages/global/core/workflow/utils.ts
View file @
f000fbb1
...
@@ -341,7 +341,13 @@ export const toolSetData2FlowNodeIO = ({
...
@@ -341,7 +341,13 @@ export const toolSetData2FlowNodeIO = ({
};
};
export
const
formatEditorVariablePickerIcon
=
(
export
const
formatEditorVariablePickerIcon
=
(
variables
:
{
key
:
string
;
label
:
string
;
type
?:
`
${
VariableInputEnum
}
`
;
required
?:
boolean
}[]
variables
:
{
id
:
string
;
key
:
string
;
label
:
string
;
type
?:
`
${
VariableInputEnum
}
`
;
required
?:
boolean
;
}[]
):
EditorVariablePickerType
[]
=>
{
):
EditorVariablePickerType
[]
=>
{
return
variables
.
map
((
item
)
=>
({
return
variables
.
map
((
item
)
=>
({
...
item
,
...
item
,
...
...
packages/web/components/common/Textarea/PromptEditor/type.d.ts
View file @
f000fbb1
import
type
{
WorkflowIOValueTypeEnum
}
from
'@fastgpt/global/core/workflow/constants'
;
import
type
{
WorkflowIOValueTypeEnum
}
from
'@fastgpt/global/core/workflow/constants'
;
export
type
EditorVariablePickerType
=
{
export
type
EditorVariablePickerType
=
{
id
:
string
;
key
:
string
;
key
:
string
;
label
:
string
;
label
:
string
;
required
?:
boolean
;
required
?:
boolean
;
...
...
projects/app/src/components/core/app/VariableEdit.tsx
View file @
f000fbb1
...
@@ -385,7 +385,7 @@ const TableItem = ({
...
@@ -385,7 +385,7 @@ const TableItem = ({
onClick=
{
()
=>
{
onClick=
{
()
=>
{
const
formattedItem
=
{
const
formattedItem
=
{
...
item
,
...
item
,
list
:
item
.
enums
||
[]
list
:
item
.
enums
?.
map
((
item
)
=>
({
label
:
item
.
value
,
value
:
item
.
value
}))
||
[]
};
};
reset
(
formattedItem
);
reset
(
formattedItem
);
}
}
}
}
...
...
projects/app/src/components/core/app/formRender/index.tsx
View file @
f000fbb1
...
@@ -100,11 +100,14 @@ const InputRender = (props: InputRenderProps) => {
...
@@ -100,11 +100,14 @@ const InputRender = (props: InputRenderProps) => {
}
}
if
(
inputType
===
InputTypeEnum
.
select
)
{
if
(
inputType
===
InputTypeEnum
.
select
)
{
return
<
MySelect
{
...
commonProps
}
list=
{
props
.
list
||
[]
}
h=
{
10
}
/>;
const
list
=
props
.
list
||
props
.
enums
?.
map
((
item
)
=>
({
label
:
item
.
value
,
value
:
item
.
value
}))
||
[];
return
<
MySelect
{
...
commonProps
}
list=
{
list
}
h=
{
10
}
/>;
}
}
if
(
inputType
===
InputTypeEnum
.
multipleSelect
)
{
if
(
inputType
===
InputTypeEnum
.
multipleSelect
)
{
const
{
list
=
[]
}
=
props
;
const
list
=
props
.
list
||
props
.
enums
?.
map
((
item
)
=>
({
label
:
item
.
value
,
value
:
item
.
value
}))
||
[];
return
(
return
(
<
MultipleSelect
<
string
>
<
MultipleSelect
<
string
>
{
...
commonProps
}
{
...
commonProps
}
...
...
projects/app/src/components/core/app/formRender/type.d.ts
View file @
f000fbb1
...
@@ -40,6 +40,9 @@ type SpecificProps =
...
@@ -40,6 +40,9 @@ type SpecificProps =
// select & multipleSelect
// select & multipleSelect
inputType
:
InputTypeEnum
.
select
|
InputTypeEnum
.
multipleSelect
;
inputType
:
InputTypeEnum
.
select
|
InputTypeEnum
.
multipleSelect
;
list
?:
{
label
:
string
;
value
:
string
}[];
list
?:
{
label
:
string
;
value
:
string
}[];
// old version
enums
?:
{
value
:
string
}[];
}
}
|
{
|
{
// JSONEditor
// JSONEditor
...
...
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/NodeHttp/index.tsx
View file @
f000fbb1
...
@@ -174,6 +174,7 @@ const RenderHttpMethodAndUrl = React.memo(function RenderHttpMethodAndUrl({
...
@@ -174,6 +174,7 @@ const RenderHttpMethodAndUrl = React.memo(function RenderHttpMethodAndUrl({
return
(
return
(
feConfigs
?.
externalProviderWorkflowVariables
?.
map
((
item
)
=>
({
feConfigs
?.
externalProviderWorkflowVariables
?.
map
((
item
)
=>
({
key
:
item
.
key
,
key
:
item
.
key
,
id
:
item
.
key
,
label
:
item
.
name
label
:
item
.
name
}))
||
[]
}))
||
[]
);
);
...
@@ -294,6 +295,7 @@ export function RenderHttpProps({
...
@@ -294,6 +295,7 @@ export function RenderHttpProps({
return
(
return
(
feConfigs
?.
externalProviderWorkflowVariables
?.
map
((
item
)
=>
({
feConfigs
?.
externalProviderWorkflowVariables
?.
map
((
item
)
=>
({
key
:
item
.
key
,
key
:
item
.
key
,
id
:
item
.
key
,
label
:
item
.
name
label
:
item
.
name
}))
||
[]
}))
||
[]
);
);
...
@@ -498,6 +500,7 @@ const RenderForm = ({
...
@@ -498,6 +500,7 @@ const RenderForm = ({
input
:
FlowNodeInputItemType
;
input
:
FlowNodeInputItemType
;
variables
:
EditorVariableLabelPickerType
[];
variables
:
EditorVariableLabelPickerType
[];
externalProviderWorkflowVariables
:
{
externalProviderWorkflowVariables
:
{
id
:
string
;
key
:
string
;
key
:
string
;
label
:
string
;
label
:
string
;
}[];
}[];
...
@@ -684,6 +687,7 @@ const RenderBody = ({
...
@@ -684,6 +687,7 @@ const RenderBody = ({
typeInput
:
FlowNodeInputItemType
|
undefined
;
typeInput
:
FlowNodeInputItemType
|
undefined
;
variables
:
EditorVariableLabelPickerType
[];
variables
:
EditorVariableLabelPickerType
[];
externalProviderWorkflowVariables
:
{
externalProviderWorkflowVariables
:
{
id
:
string
;
key
:
string
;
key
:
string
;
label
:
string
;
label
:
string
;
}[];
}[];
...
...
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/NodeVariableUpdate.tsx
View file @
f000fbb1
...
@@ -67,6 +67,7 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps<FlowNodeItemType>) =>
...
@@ -67,6 +67,7 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps<FlowNodeItemType>) =>
const
externalProviderWorkflowVariables
=
useMemo
(()
=>
{
const
externalProviderWorkflowVariables
=
useMemo
(()
=>
{
return
(
return
(
feConfigs
?.
externalProviderWorkflowVariables
?.
map
((
item
)
=>
({
feConfigs
?.
externalProviderWorkflowVariables
?.
map
((
item
)
=>
({
id
:
item
.
key
,
key
:
item
.
key
,
key
:
item
.
key
,
label
:
item
.
name
label
:
item
.
name
}))
||
[]
}))
||
[]
...
...
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/RenderInput/templates/CommonInputForm.tsx
View file @
f000fbb1
...
@@ -51,6 +51,7 @@ const CommonInputForm = ({ item, nodeId }: RenderInputProps) => {
...
@@ -51,6 +51,7 @@ const CommonInputForm = ({ item, nodeId }: RenderInputProps) => {
const
externalVariables
=
useMemo
(()
=>
{
const
externalVariables
=
useMemo
(()
=>
{
return
(
return
(
feConfigs
?.
externalProviderWorkflowVariables
?.
map
((
item
)
=>
({
feConfigs
?.
externalProviderWorkflowVariables
?.
map
((
item
)
=>
({
id
:
item
.
key
,
key
:
item
.
key
,
key
:
item
.
key
,
label
:
item
.
name
label
:
item
.
name
}))
||
[]
}))
||
[]
...
...
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/RenderInput/templates/SettingQuotePrompt.tsx
View file @
f000fbb1
...
@@ -247,7 +247,10 @@ const EditModal = ({ onClose, ...props }: RenderInputProps & { onClose: () => vo
...
@@ -247,7 +247,10 @@ const EditModal = ({ onClose, ...props }: RenderInputProps & { onClose: () => vo
</
Flex
>
</
Flex
>
<
PromptEditor
<
PromptEditor
variables=
{
quoteTemplateVariables
}
variables=
{
quoteTemplateVariables
.
map
((
item
)
=>
({
...
item
,
id
:
item
.
key
}))
}
minH=
{
160
}
minH=
{
160
}
title=
{
t
(
'common:core.app.Quote templates'
)
}
title=
{
t
(
'common:core.app.Quote templates'
)
}
placeholder=
{
t
(
'workflow:quote_content_placeholder'
)
}
placeholder=
{
t
(
'workflow:quote_content_placeholder'
)
}
...
@@ -268,7 +271,10 @@ const EditModal = ({ onClose, ...props }: RenderInputProps & { onClose: () => vo
...
@@ -268,7 +271,10 @@ const EditModal = ({ onClose, ...props }: RenderInputProps & { onClose: () => vo
/>
/>
</
Flex
>
</
Flex
>
<
PromptEditor
<
PromptEditor
variables=
{
quotePromptVariables
}
variables=
{
quotePromptVariables
.
map
((
item
)
=>
({
...
item
,
id
:
item
.
key
}))
}
title=
{
t
(
'common:core.app.Quote prompt'
)
}
title=
{
t
(
'common:core.app.Quote prompt'
)
}
minH=
{
300
}
minH=
{
300
}
placeholder=
{
t
(
'workflow:quote_prompt_tip'
,
{
placeholder=
{
t
(
'workflow:quote_prompt_tip'
,
{
...
...
projects/app/src/pageComponents/app/detail/WorkflowComponents/utils.tsx
View file @
f000fbb1
...
@@ -107,6 +107,7 @@ export const getEditorVariables = ({
...
@@ -107,6 +107,7 @@ export const getEditorVariables = ({
const
nodeVariables
=
currentNode
.
inputs
const
nodeVariables
=
currentNode
.
inputs
.
filter
((
input
)
=>
input
.
canEdit
)
.
filter
((
input
)
=>
input
.
canEdit
)
.
map
((
item
)
=>
({
.
map
((
item
)
=>
({
id
:
item
.
key
,
key
:
item
.
key
,
key
:
item
.
key
,
label
:
item
.
label
,
label
:
item
.
label
,
parent
:
{
parent
:
{
...
@@ -137,6 +138,7 @@ export const getEditorVariables = ({
...
@@ -137,6 +138,7 @@ export const getEditorVariables = ({
)
)
.
map
((
output
)
=>
{
.
map
((
output
)
=>
{
return
{
return
{
id
:
output
.
id
,
label
:
t
((
output
.
label
as
any
)
||
''
),
label
:
t
((
output
.
label
as
any
)
||
''
),
key
:
output
.
id
,
key
:
output
.
id
,
parent
:
{
parent
:
{
...
...
projects/app/src/web/core/app/utils.ts
View file @
f000fbb1
...
@@ -582,30 +582,35 @@ export function filterSensitiveFormData(appForm: AppSimpleEditFormType) {
...
@@ -582,30 +582,35 @@ export function filterSensitiveFormData(appForm: AppSimpleEditFormType) {
export
const
workflowSystemVariables
:
EditorVariablePickerType
[]
=
[
export
const
workflowSystemVariables
:
EditorVariablePickerType
[]
=
[
{
{
id
:
'userId'
,
key
:
'userId'
,
key
:
'userId'
,
label
:
i18nT
(
'workflow:use_user_id'
),
label
:
i18nT
(
'workflow:use_user_id'
),
required
:
true
,
required
:
true
,
valueType
:
WorkflowIOValueTypeEnum
.
string
valueType
:
WorkflowIOValueTypeEnum
.
string
},
},
{
{
id
:
'appId'
,
key
:
'appId'
,
key
:
'appId'
,
label
:
i18nT
(
'common:core.module.http.AppId'
),
label
:
i18nT
(
'common:core.module.http.AppId'
),
required
:
true
,
required
:
true
,
valueType
:
WorkflowIOValueTypeEnum
.
string
valueType
:
WorkflowIOValueTypeEnum
.
string
},
},
{
{
id
:
'chatId'
,
key
:
'chatId'
,
key
:
'chatId'
,
label
:
i18nT
(
'common:core.module.http.ChatId'
),
label
:
i18nT
(
'common:core.module.http.ChatId'
),
valueType
:
WorkflowIOValueTypeEnum
.
string
,
valueType
:
WorkflowIOValueTypeEnum
.
string
,
required
:
true
required
:
true
},
},
{
{
id
:
'responseChatItemId'
,
key
:
'responseChatItemId'
,
key
:
'responseChatItemId'
,
label
:
i18nT
(
'common:core.module.http.ResponseChatItemId'
),
label
:
i18nT
(
'common:core.module.http.ResponseChatItemId'
),
valueType
:
WorkflowIOValueTypeEnum
.
string
,
valueType
:
WorkflowIOValueTypeEnum
.
string
,
required
:
true
required
:
true
},
},
{
{
id
:
'histories'
,
key
:
'histories'
,
key
:
'histories'
,
label
:
i18nT
(
'common:core.module.http.Histories'
),
label
:
i18nT
(
'common:core.module.http.Histories'
),
required
:
true
,
required
:
true
,
...
@@ -613,6 +618,7 @@ export const workflowSystemVariables: EditorVariablePickerType[] = [
...
@@ -613,6 +618,7 @@ export const workflowSystemVariables: EditorVariablePickerType[] = [
valueDesc
:
chatHistoryValueDesc
valueDesc
:
chatHistoryValueDesc
},
},
{
{
id
:
'cTime'
,
key
:
'cTime'
,
key
:
'cTime'
,
label
:
i18nT
(
'common:core.module.http.Current time'
),
label
:
i18nT
(
'common:core.module.http.Current time'
),
required
:
true
,
required
:
true
,
...
...
projects/app/src/web/core/workflow/adapt.ts
View file @
f000fbb1
...
@@ -54,7 +54,7 @@ export const getGlobalVariableNode = ({
...
@@ -54,7 +54,7 @@ export const getGlobalVariableNode = ({
nodeId
:
VARIABLE_NODE_ID
,
nodeId
:
VARIABLE_NODE_ID
,
...
template
,
...
template
,
outputs
:
globalVariables
.
map
((
item
)
=>
({
outputs
:
globalVariables
.
map
((
item
)
=>
({
id
:
item
.
key
,
id
:
item
.
id
,
type
:
FlowNodeOutputTypeEnum
.
static
,
type
:
FlowNodeOutputTypeEnum
.
static
,
label
:
item
.
label
,
label
:
item
.
label
,
key
:
item
.
key
,
key
:
item
.
key
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment