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
3688842c
authored
May 13, 2025
by
heheer
Committed by
GitHub
May 13, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter tool type version & fix unpublished version (#4803)
parent
398d131b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
17 deletions
+20
-17
packages/service/core/app/plugin/controller.ts
+5
-12
packages/service/core/app/version/controller.ts
+3
-0
packages/web/components/common/MySelect/index.tsx
+10
-3
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/NodeCard.tsx
+2
-2
No files found.
packages/service/core/app/plugin/controller.ts
View file @
3688842c
...
@@ -22,8 +22,7 @@ import {
...
@@ -22,8 +22,7 @@ import {
import
{
type
PluginRuntimeType
}
from
'@fastgpt/global/core/plugin/type'
;
import
{
type
PluginRuntimeType
}
from
'@fastgpt/global/core/plugin/type'
;
import
{
MongoSystemPlugin
}
from
'./systemPluginSchema'
;
import
{
MongoSystemPlugin
}
from
'./systemPluginSchema'
;
import
{
PluginErrEnum
}
from
'@fastgpt/global/common/error/code/plugin'
;
import
{
PluginErrEnum
}
from
'@fastgpt/global/common/error/code/plugin'
;
import
{
MongoAppVersion
}
from
'../version/schema'
;
import
{
Types
}
from
'mongoose'
;
import
{
i18nT
}
from
'../../../../web/i18n/utils'
;
/*
/*
plugin id rule:
plugin id rule:
...
@@ -111,17 +110,11 @@ export async function getChildAppPreviewNode({
...
@@ -111,17 +110,11 @@ export async function getChildAppPreviewNode({
const
version
=
await
getAppVersionById
({
appId
,
versionId
,
app
:
item
});
const
version
=
await
getAppVersionById
({
appId
,
versionId
,
app
:
item
});
if
(
!
version
.
versionId
)
return
Promise
.
reject
(
i18nT
(
'common:app_not_version'
));
const
isLatest
=
version
.
versionId
&&
Types
.
ObjectId
.
isValid
(
version
.
versionId
)
const
versionData
=
await
MongoAppVersion
.
findById
(
version
.
versionId
,
'_id versionName appId time'
).
lean
();
const
isLatest
=
versionData
?
await
checkIsLatestVersion
({
?
await
checkIsLatestVersion
({
appId
,
appId
,
versionId
:
versionData
.
_i
d
versionId
:
version
.
versionI
d
})
})
:
true
;
:
true
;
...
@@ -140,7 +133,7 @@ export async function getChildAppPreviewNode({
...
@@ -140,7 +133,7 @@ export async function getChildAppPreviewNode({
templateType
:
FlowNodeTemplateTypeEnum
.
teamApp
,
templateType
:
FlowNodeTemplateTypeEnum
.
teamApp
,
version
:
version
.
versionId
,
version
:
version
.
versionId
,
versionLabel
:
version
Data
?.
versionName
||
''
,
versionLabel
:
version
?.
versionName
||
''
,
isLatestVersion
:
isLatest
,
isLatestVersion
:
isLatest
,
originCost
:
0
,
originCost
:
0
,
...
...
packages/service/core/app/version/controller.ts
View file @
3688842c
...
@@ -15,6 +15,7 @@ export const getAppLatestVersion = async (appId: string, app?: AppSchema) => {
...
@@ -15,6 +15,7 @@ export const getAppLatestVersion = async (appId: string, app?: AppSchema) => {
if
(
version
)
{
if
(
version
)
{
return
{
return
{
versionId
:
version
.
_id
,
versionId
:
version
.
_id
,
versionName
:
version
.
versionName
,
nodes
:
version
.
nodes
,
nodes
:
version
.
nodes
,
edges
:
version
.
edges
,
edges
:
version
.
edges
,
chatConfig
:
version
.
chatConfig
||
app
?.
chatConfig
||
{}
chatConfig
:
version
.
chatConfig
||
app
?.
chatConfig
||
{}
...
@@ -22,6 +23,7 @@ export const getAppLatestVersion = async (appId: string, app?: AppSchema) => {
...
@@ -22,6 +23,7 @@ export const getAppLatestVersion = async (appId: string, app?: AppSchema) => {
}
}
return
{
return
{
versionId
:
app
?.
pluginData
?.
nodeVersion
,
versionId
:
app
?.
pluginData
?.
nodeVersion
,
versionName
:
app
?.
name
,
nodes
:
app
?.
modules
||
[],
nodes
:
app
?.
modules
||
[],
edges
:
app
?.
edges
||
[],
edges
:
app
?.
edges
||
[],
chatConfig
:
app
?.
chatConfig
||
{}
chatConfig
:
app
?.
chatConfig
||
{}
...
@@ -47,6 +49,7 @@ export const getAppVersionById = async ({
...
@@ -47,6 +49,7 @@ export const getAppVersionById = async ({
if
(
version
)
{
if
(
version
)
{
return
{
return
{
versionId
:
version
.
_id
,
versionId
:
version
.
_id
,
versionName
:
version
.
versionName
,
nodes
:
version
.
nodes
,
nodes
:
version
.
nodes
,
edges
:
version
.
edges
,
edges
:
version
.
edges
,
chatConfig
:
version
.
chatConfig
||
app
?.
chatConfig
||
{}
chatConfig
:
version
.
chatConfig
||
app
?.
chatConfig
||
{}
...
...
packages/web/components/common/MySelect/index.tsx
View file @
3688842c
...
@@ -24,6 +24,7 @@ import { useRequest2 } from '../../../hooks/useRequest';
...
@@ -24,6 +24,7 @@ import { useRequest2 } from '../../../hooks/useRequest';
import
MyDivider
from
'../MyDivider'
;
import
MyDivider
from
'../MyDivider'
;
import
type
{
useScrollPagination
}
from
'../../../hooks/useScrollPagination'
;
import
type
{
useScrollPagination
}
from
'../../../hooks/useScrollPagination'
;
import
Avatar
from
'../Avatar'
;
import
Avatar
from
'../Avatar'
;
import
EmptyTip
from
'../EmptyTip'
;
/** 选择组件 Props 类型
/** 选择组件 Props 类型
* value: 选中的值
* value: 选中的值
...
@@ -141,7 +142,8 @@ const MySelect = <T = any,>(
...
@@ -141,7 +142,8 @@ const MySelect = <T = any,>(
const
ListRender
=
useMemo
(()
=>
{
const
ListRender
=
useMemo
(()
=>
{
return
(
return
(
<>
<>
{
filterList
.
map
((
item
,
i
)
=>
(
{
filterList
.
length
>
0
?
(
filterList
.
map
((
item
,
i
)
=>
(
<
Box
key=
{
i
}
>
<
Box
key=
{
i
}
>
<
MenuItem
<
MenuItem
{
...
menuItemStyles
}
{
...
menuItemStyles
}
...
@@ -166,7 +168,9 @@ const MySelect = <T = any,>(
...
@@ -166,7 +168,9 @@ const MySelect = <T = any,>(
mb=
{
0.5
}
mb=
{
0.5
}
>
>
<
Flex
alignItems=
{
'center'
}
>
<
Flex
alignItems=
{
'center'
}
>
{
item
.
icon
&&
<
Avatar
mr=
{
2
}
src=
{
item
.
icon
as
any
}
w=
{
item
.
iconSize
??
'1rem'
}
/>
}
{
item
.
icon
&&
(
<
Avatar
mr=
{
2
}
src=
{
item
.
icon
as
any
}
w=
{
item
.
iconSize
??
'1rem'
}
/>
)
}
{
item
.
label
}
{
item
.
label
}
</
Flex
>
</
Flex
>
{
item
.
description
&&
(
{
item
.
description
&&
(
...
@@ -177,7 +181,10 @@ const MySelect = <T = any,>(
...
@@ -177,7 +181,10 @@ const MySelect = <T = any,>(
</
MenuItem
>
</
MenuItem
>
{
item
.
showBorder
&&
<
MyDivider
my=
{
2
}
/>
}
{
item
.
showBorder
&&
<
MyDivider
my=
{
2
}
/>
}
</
Box
>
</
Box
>
))
}
))
)
:
(
<
EmptyTip
py=
{
0
}
/>
)
}
</>
</>
);
);
},
[
filterList
,
onClickChange
,
value
]);
},
[
filterList
,
onClickChange
,
value
]);
...
...
projects/app/src/pageComponents/app/detail/WorkflowComponents/Flow/nodes/render/NodeCard.tsx
View file @
3688842c
...
@@ -104,8 +104,8 @@ const NodeCard = (props: Props) => {
...
@@ -104,8 +104,8 @@ const NodeCard = (props: Props) => {
const
isAppNode
=
node
&&
AppNodeFlowNodeTypeMap
[
node
?.
flowNodeType
];
const
isAppNode
=
node
&&
AppNodeFlowNodeTypeMap
[
node
?.
flowNodeType
];
const
showVersion
=
useMemo
(()
=>
{
const
showVersion
=
useMemo
(()
=>
{
if
(
!
isAppNode
||
!
node
?.
pluginId
)
return
false
;
if
(
!
isAppNode
||
!
node
?.
pluginId
)
return
false
;
const
splitRes
=
node
.
pluginId
.
split
(
'-'
)
;
if
([
FlowNodeTypeEnum
.
tool
,
FlowNodeTypeEnum
.
toolSet
].
includes
(
node
.
flowNodeType
))
return
false
;
if
(
splitRes
.
length
>
1
)
{
if
(
node
.
pluginId
.
split
(
'-'
)
.
length
>
1
)
{
return
false
;
return
false
;
}
}
return
true
;
return
true
;
...
...
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