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
a37c7515
authored
Mar 28, 2025
by
heheer
Committed by
GitHub
Mar 28, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix child app update variables (#4385)
parent
0ed99d8c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
8 deletions
+20
-8
packages/global/core/workflow/runtime/type.d.ts
+1
-0
packages/service/core/workflow/dispatch/plugin/run.ts
+2
-1
packages/service/core/workflow/dispatch/plugin/runApp.ts
+2
-1
packages/service/core/workflow/dispatch/tools/runUpdateVar.ts
+14
-5
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/ChatTest.tsx
+1
-1
No files found.
packages/global/core/workflow/runtime/type.d.ts
View file @
a37c7515
...
@@ -40,6 +40,7 @@ export type ChatDispatchProps = {
...
@@ -40,6 +40,7 @@ export type ChatDispatchProps = {
id
:
string
;
// May be the id of the system plug-in (cannot be used directly to look up the table)
id
:
string
;
// May be the id of the system plug-in (cannot be used directly to look up the table)
teamId
:
string
;
teamId
:
string
;
tmbId
:
string
;
// App tmbId
tmbId
:
string
;
// App tmbId
isChildApp
?:
boolean
;
};
};
runningUserInfo
:
{
runningUserInfo
:
{
teamId
:
string
;
teamId
:
string
;
...
...
packages/service/core/workflow/dispatch/plugin/run.ts
View file @
a37c7515
...
@@ -90,7 +90,8 @@ export const dispatchRunPlugin = async (props: RunPluginProps): Promise<RunPlugi
...
@@ -90,7 +90,8 @@ export const dispatchRunPlugin = async (props: RunPluginProps): Promise<RunPlugi
id
:
String
(
plugin
.
id
),
id
:
String
(
plugin
.
id
),
// 如果系统插件有 teamId 和 tmbId,则使用系统插件的 teamId 和 tmbId(管理员指定了插件作为系统插件)
// 如果系统插件有 teamId 和 tmbId,则使用系统插件的 teamId 和 tmbId(管理员指定了插件作为系统插件)
teamId
:
plugin
.
teamId
||
runningAppInfo
.
teamId
,
teamId
:
plugin
.
teamId
||
runningAppInfo
.
teamId
,
tmbId
:
plugin
.
tmbId
||
runningAppInfo
.
tmbId
tmbId
:
plugin
.
tmbId
||
runningAppInfo
.
tmbId
,
isChildApp
:
true
},
},
variables
:
runtimeVariables
,
variables
:
runtimeVariables
,
query
:
getPluginRunUserQuery
({
query
:
getPluginRunUserQuery
({
...
...
packages/service/core/workflow/dispatch/plugin/runApp.ts
View file @
a37c7515
...
@@ -112,7 +112,8 @@ export const dispatchRunAppNode = async (props: Props): Promise<Response> => {
...
@@ -112,7 +112,8 @@ export const dispatchRunAppNode = async (props: Props): Promise<Response> => {
runningAppInfo
:
{
runningAppInfo
:
{
id
:
String
(
appData
.
_id
),
id
:
String
(
appData
.
_id
),
teamId
:
String
(
appData
.
teamId
),
teamId
:
String
(
appData
.
teamId
),
tmbId
:
String
(
appData
.
tmbId
)
tmbId
:
String
(
appData
.
tmbId
),
isChildApp
:
true
},
},
runtimeNodes
:
storeNodes2RuntimeNodes
(
nodes
,
getWorkflowEntryNodeIds
(
nodes
)),
runtimeNodes
:
storeNodes2RuntimeNodes
(
nodes
,
getWorkflowEntryNodeIds
(
nodes
)),
runtimeEdges
:
initWorkflowEdgeStatus
(
edges
),
runtimeEdges
:
initWorkflowEdgeStatus
(
edges
),
...
...
packages/service/core/workflow/dispatch/tools/runUpdateVar.ts
View file @
a37c7515
...
@@ -19,7 +19,14 @@ type Props = ModuleDispatchProps<{
...
@@ -19,7 +19,14 @@ type Props = ModuleDispatchProps<{
type
Response
=
DispatchNodeResultType
<
{}
>
;
type
Response
=
DispatchNodeResultType
<
{}
>
;
export
const
dispatchUpdateVariable
=
async
(
props
:
Props
):
Promise
<
Response
>
=>
{
export
const
dispatchUpdateVariable
=
async
(
props
:
Props
):
Promise
<
Response
>
=>
{
const
{
params
,
variables
,
runtimeNodes
,
workflowStreamResponse
,
externalProvider
}
=
props
;
const
{
params
,
variables
,
runtimeNodes
,
workflowStreamResponse
,
externalProvider
,
runningAppInfo
}
=
props
;
const
{
updateList
}
=
params
;
const
{
updateList
}
=
params
;
const
nodeIds
=
runtimeNodes
.
map
((
node
)
=>
node
.
nodeId
);
const
nodeIds
=
runtimeNodes
.
map
((
node
)
=>
node
.
nodeId
);
...
@@ -78,10 +85,12 @@ export const dispatchUpdateVariable = async (props: Props): Promise<Response> =>
...
@@ -78,10 +85,12 @@ export const dispatchUpdateVariable = async (props: Props): Promise<Response> =>
return
value
;
return
value
;
});
});
workflowStreamResponse
?.({
if
(
!
runningAppInfo
.
isChildApp
)
{
event
:
SseResponseEventEnum
.
updateVariables
,
workflowStreamResponse
?.({
data
:
removeSystemVariable
(
variables
,
externalProvider
.
externalWorkflowVariables
)
event
:
SseResponseEventEnum
.
updateVariables
,
});
data
:
removeSystemVariable
(
variables
,
externalProvider
.
externalWorkflowVariables
)
});
}
return
{
return
{
[
DispatchNodeResponseKeyEnum
.
newVariables
]:
variables
,
[
DispatchNodeResponseKeyEnum
.
newVariables
]:
variables
,
...
...
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/ChatTest.tsx
View file @
a37c7515
...
@@ -65,7 +65,7 @@ const ChatTest = ({ isOpen, nodes = [], edges = [], onClose }: Props) => {
...
@@ -65,7 +65,7 @@ const ChatTest = ({ isOpen, nodes = [], edges = [], onClose }: Props) => {
}
}
}
}
/>
/>
<
MyBox
<
MyBox
isLoading=
{
loading
}
isLoading=
{
isPlugin
&&
loading
}
zIndex=
{
300
}
zIndex=
{
300
}
display=
{
'flex'
}
display=
{
'flex'
}
flexDirection=
{
'column'
}
flexDirection=
{
'column'
}
...
...
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