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
021ec059
authored
Dec 09, 2024
by
heheer
Committed by
GitHub
Dec 09, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: plugin group api position & team selector optional display (#3339)
parent
6ceee7cb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
10 deletions
+39
-10
projects/app/src/pages/account/info/index.tsx
+9
-9
projects/app/src/pages/api/core/app/plugin/getPluginGroups.ts
+29
-0
projects/app/src/web/core/app/api/plugin.ts
+1
-1
No files found.
projects/app/src/pages/account/info/index.tsx
View file @
021ec059
...
...
@@ -61,10 +61,9 @@ const AiPointsModal = dynamic(() =>
const
Info
=
()
=>
{
const
{
isPc
}
=
useSystem
();
const
{
teamPlanStatus
}
=
useUserStore
();
const
{
teamPlanStatus
,
initUserInfo
}
=
useUserStore
();
const
standardPlan
=
teamPlanStatus
?.
standardConstants
;
const
{
isOpen
:
isOpenContact
,
onClose
:
onCloseContact
,
onOpen
:
onOpenContact
}
=
useDisclosure
();
const
{
initUserInfo
}
=
useUserStore
();
useQuery
([
'init'
],
initUserInfo
);
...
...
@@ -112,11 +111,10 @@ const MyInfo = ({ onOpenContact }: { onOpenContact: () => void }) => {
const
theme
=
useTheme
();
const
{
feConfigs
}
=
useSystemStore
();
const
{
t
}
=
useTranslation
();
const
{
userInfo
,
updateUserInfo
}
=
useUserStore
();
const
{
userInfo
,
updateUserInfo
,
teamPlanStatus
}
=
useUserStore
();
const
{
reset
}
=
useForm
<
UserUpdateParams
>
({
defaultValues
:
userInfo
as
UserType
});
const
{
teamPlanStatus
}
=
useUserStore
();
const
standardPlan
=
teamPlanStatus
?.
standardConstants
;
const
{
isPc
}
=
useSystem
();
const
{
toast
}
=
useToast
();
...
...
@@ -305,12 +303,14 @@ const MyInfo = ({ onOpenContact }: { onOpenContact: () => void }) => {
)
}
</
Flex
>
)
}
<
Flex
mt=
{
6
}
alignItems=
{
'center'
}
>
<
Box
{
...
labelStyles
}
>
{
t
(
'account_info:user_team_team_name'
)
}
:
</
Box
>
<
Flex
flex=
{
'1 0 0'
}
w=
{
0
}
align=
{
'center'
}
>
<
TeamSelector
height=
{
'28px'
}
w=
{
'100%'
}
showManage
/>
{
feConfigs
.
isPlus
&&
(
<
Flex
mt=
{
6
}
alignItems=
{
'center'
}
>
<
Box
{
...
labelStyles
}
>
{
t
(
'account_info:user_team_team_name'
)
}
:
</
Box
>
<
Flex
flex=
{
'1 0 0'
}
w=
{
0
}
align=
{
'center'
}
>
<
TeamSelector
height=
{
'28px'
}
w=
{
'100%'
}
showManage
/>
</
Flex
>
</
Flex
>
</
Flex
>
)
}
{
feConfigs
?.
isPlus
&&
(
userInfo
?.
team
?.
balance
??
0
)
>
0
&&
(
<
Box
mt=
{
6
}
whiteSpace=
{
'nowrap'
}
>
<
Flex
alignItems=
{
'center'
}
>
...
...
projects/app/src/pages/api/core/app/plugin/getPluginGroups.ts
0 → 100644
View file @
021ec059
import
{
NextAPI
}
from
'@/service/middleware/entry'
;
import
{
MongoPluginGroups
}
from
'@fastgpt/service/core/app/plugin/pluginGroupSchema'
;
import
{
PluginGroupSchemaType
}
from
'@fastgpt/service/core/app/plugin/type'
;
import
{
ApiRequestProps
,
ApiResponseType
}
from
'@fastgpt/service/type/next'
;
export
type
getPluginGroupsQuery
=
{};
export
type
getPluginGroupsBody
=
{};
export
type
getPluginGroupsResponse
=
PluginGroupSchemaType
[];
async
function
handler
(
req
:
ApiRequestProps
<
getPluginGroupsBody
,
getPluginGroupsQuery
>
,
res
:
ApiResponseType
<
any
>
):
Promise
<
getPluginGroupsResponse
>
{
const
pluginGroups
=
await
MongoPluginGroups
.
find
().
sort
({
groupOrder
:
1
});
const
result
=
pluginGroups
.
map
((
item
)
=>
({
groupId
:
item
.
groupId
,
groupName
:
item
.
groupName
,
groupAvatar
:
item
.
groupAvatar
,
groupTypes
:
item
.
groupTypes
,
groupOrder
:
item
.
groupOrder
}));
return
result
;
}
export
default
NextAPI
(
handler
);
projects/app/src/web/core/app/api/plugin.ts
View file @
021ec059
...
...
@@ -42,7 +42,7 @@ export const getSystemPlugTemplates = (data: GetSystemPluginTemplatesBody) =>
POST
<
NodeTemplateListItemType
[]
>
(
'/core/app/plugin/getSystemPluginTemplates'
,
data
);
export
const
getPluginGroups
=
()
=>
GET
<
PluginGroupSchemaType
[]
>
(
'/
proApi/
core/app/plugin/getPluginGroups'
);
GET
<
PluginGroupSchemaType
[]
>
(
'/core/app/plugin/getPluginGroups'
);
export
const
getSystemPluginPaths
=
(
parentId
:
ParentIdType
)
=>
{
if
(
!
parentId
)
return
Promise
.
resolve
<
ParentTreePathItemType
[]
>
([]);
...
...
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