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
Show 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 = ({
};
export
const
formatEditorVariablePickerIcon
=
(
variables
:
{
key
:
string
;
label
:
string
;
type
?:
`
${
VariableInputEnum
}
`
;
required
?:
boolean
}[]
variables
:
{
id
:
string
;
key
:
string
;
label
:
string
;
type
?:
`
${
VariableInputEnum
}
`
;
required
?:
boolean
;
}[]
):
EditorVariablePickerType
[]
=>
{
return
variables
.
map
((
item
)
=>
({
...
item
,
...
...
packages/web/components/common/Textarea/PromptEditor/type.d.ts
View file @
f000fbb1
import
type
{
WorkflowIOValueTypeEnum
}
from
'@fastgpt/global/core/workflow/constants'
;
export
type
EditorVariablePickerType
=
{
id
:
string
;
key
:
string
;
label
:
string
;
required
?:
boolean
;
...
...
projects/app/src/components/core/app/VariableEdit.tsx
View file @
f000fbb1
...
...
@@ -385,7 +385,7 @@ const TableItem = ({
onClick=
{
()
=>
{
const
formattedItem
=
{
...
item
,
list
:
item
.
enums
||
[]
list
:
item
.
enums
?.
map
((
item
)
=>
({
label
:
item
.
value
,
value
:
item
.
value
}))
||
[]
};
reset
(
formattedItem
);
}
}
...
...
projects/app/src/components/core/app/formRender/index.tsx
View file @
f000fbb1
...
...
@@ -100,11 +100,14 @@ const InputRender = (props: InputRenderProps) => {
}
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
)
{
const
{
list
=
[]
}
=
props
;
const
list
=
props
.
list
||
props
.
enums
?.
map
((
item
)
=>
({
label
:
item
.
value
,
value
:
item
.
value
}))
||
[];
return
(
<
MultipleSelect
<
string
>
{
...
commonProps
}
...
...
projects/app/src/components/core/app/formRender/type.d.ts
View file @
f000fbb1
...
...
@@ -40,6 +40,9 @@ type SpecificProps =
// select & multipleSelect
inputType
:
InputTypeEnum
.
select
|
InputTypeEnum
.
multipleSelect
;
list
?:
{
label
:
string
;
value
:
string
}[];
// old version
enums
?:
{
value
:
string
}[];
}
|
{
// 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({
return
(
feConfigs
?.
externalProviderWorkflowVariables
?.
map
((
item
)
=>
({
key
:
item
.
key
,
id
:
item
.
key
,
label
:
item
.
name
}))
||
[]
);
...
...
@@ -294,6 +295,7 @@ export function RenderHttpProps({
return
(
feConfigs
?.
externalProviderWorkflowVariables
?.
map
((
item
)
=>
({
key
:
item
.
key
,
id
:
item
.
key
,
label
:
item
.
name
}))
||
[]
);
...
...
@@ -498,6 +500,7 @@ const RenderForm = ({
input
:
FlowNodeInputItemType
;
variables
:
EditorVariableLabelPickerType
[];
externalProviderWorkflowVariables
:
{
id
:
string
;
key
:
string
;
label
:
string
;
}[];
...
...
@@ -684,6 +687,7 @@ const RenderBody = ({
typeInput
:
FlowNodeInputItemType
|
undefined
;
variables
:
EditorVariableLabelPickerType
[];
externalProviderWorkflowVariables
:
{
id
:
string
;
key
:
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>) =>
const
externalProviderWorkflowVariables
=
useMemo
(()
=>
{
return
(
feConfigs
?.
externalProviderWorkflowVariables
?.
map
((
item
)
=>
({
id
:
item
.
key
,
key
:
item
.
key
,
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) => {
const
externalVariables
=
useMemo
(()
=>
{
return
(
feConfigs
?.
externalProviderWorkflowVariables
?.
map
((
item
)
=>
({
id
:
item
.
key
,
key
:
item
.
key
,
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
</
Flex
>
<
PromptEditor
variables=
{
quoteTemplateVariables
}
variables=
{
quoteTemplateVariables
.
map
((
item
)
=>
({
...
item
,
id
:
item
.
key
}))
}
minH=
{
160
}
title=
{
t
(
'common:core.app.Quote templates'
)
}
placeholder=
{
t
(
'workflow:quote_content_placeholder'
)
}
...
...
@@ -268,7 +271,10 @@ const EditModal = ({ onClose, ...props }: RenderInputProps & { onClose: () => vo
/>
</
Flex
>
<
PromptEditor
variables=
{
quotePromptVariables
}
variables=
{
quotePromptVariables
.
map
((
item
)
=>
({
...
item
,
id
:
item
.
key
}))
}
title=
{
t
(
'common:core.app.Quote prompt'
)
}
minH=
{
300
}
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 = ({
const
nodeVariables
=
currentNode
.
inputs
.
filter
((
input
)
=>
input
.
canEdit
)
.
map
((
item
)
=>
({
id
:
item
.
key
,
key
:
item
.
key
,
label
:
item
.
label
,
parent
:
{
...
...
@@ -137,6 +138,7 @@ export const getEditorVariables = ({
)
.
map
((
output
)
=>
{
return
{
id
:
output
.
id
,
label
:
t
((
output
.
label
as
any
)
||
''
),
key
:
output
.
id
,
parent
:
{
...
...
projects/app/src/web/core/app/utils.ts
View file @
f000fbb1
...
...
@@ -582,30 +582,35 @@ export function filterSensitiveFormData(appForm: AppSimpleEditFormType) {
export
const
workflowSystemVariables
:
EditorVariablePickerType
[]
=
[
{
id
:
'userId'
,
key
:
'userId'
,
label
:
i18nT
(
'workflow:use_user_id'
),
required
:
true
,
valueType
:
WorkflowIOValueTypeEnum
.
string
},
{
id
:
'appId'
,
key
:
'appId'
,
label
:
i18nT
(
'common:core.module.http.AppId'
),
required
:
true
,
valueType
:
WorkflowIOValueTypeEnum
.
string
},
{
id
:
'chatId'
,
key
:
'chatId'
,
label
:
i18nT
(
'common:core.module.http.ChatId'
),
valueType
:
WorkflowIOValueTypeEnum
.
string
,
required
:
true
},
{
id
:
'responseChatItemId'
,
key
:
'responseChatItemId'
,
label
:
i18nT
(
'common:core.module.http.ResponseChatItemId'
),
valueType
:
WorkflowIOValueTypeEnum
.
string
,
required
:
true
},
{
id
:
'histories'
,
key
:
'histories'
,
label
:
i18nT
(
'common:core.module.http.Histories'
),
required
:
true
,
...
...
@@ -613,6 +618,7 @@ export const workflowSystemVariables: EditorVariablePickerType[] = [
valueDesc
:
chatHistoryValueDesc
},
{
id
:
'cTime'
,
key
:
'cTime'
,
label
:
i18nT
(
'common:core.module.http.Current time'
),
required
:
true
,
...
...
projects/app/src/web/core/workflow/adapt.ts
View file @
f000fbb1
...
...
@@ -54,7 +54,7 @@ export const getGlobalVariableNode = ({
nodeId
:
VARIABLE_NODE_ID
,
...
template
,
outputs
:
globalVariables
.
map
((
item
)
=>
({
id
:
item
.
key
,
id
:
item
.
id
,
type
:
FlowNodeOutputTypeEnum
.
static
,
label
:
item
.
label
,
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