perf: init shell (#5651)

* perf: init shell

* fix: tool run select

* border radius
This commit is contained in:
Archer
2025-09-15 22:21:24 +08:00
committed by GitHub
parent 2ed1545eb5
commit cb7d1a3205
11 changed files with 134 additions and 104 deletions

View File

@@ -151,8 +151,8 @@ services:
fastgpt: fastgpt:
container_name: fastgpt container_name: fastgpt
image: ghcr.io/labring/fastgpt:v4.12.3 # git image: ghcr.io/labring/fastgpt:v4.12.4 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.3 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.4 # 阿里云
ports: ports:
- 3000:3000 - 3000:3000
networks: networks:
@@ -209,15 +209,15 @@ services:
- ./config.json:/app/data/config.json - ./config.json:/app/data/config.json
sandbox: sandbox:
container_name: sandbox container_name: sandbox
image: ghcr.io/labring/fastgpt-sandbox:v4.12.3 # git image: ghcr.io/labring/fastgpt-sandbox:v4.12.4 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.3 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.4 # 阿里云
networks: networks:
- fastgpt - fastgpt
restart: always restart: always
fastgpt-mcp-server: fastgpt-mcp-server:
container_name: fastgpt-mcp-server container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.12.3 # git image: ghcr.io/labring/fastgpt-mcp_server:v4.12.4 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.3 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.4 # 阿里云
ports: ports:
- 3005:3000 - 3005:3000
networks: networks:
@@ -226,8 +226,8 @@ services:
environment: environment:
- FASTGPT_ENDPOINT=http://fastgpt:3000 - FASTGPT_ENDPOINT=http://fastgpt:3000
fastgpt-plugin: fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v0.1.12 # git image: ghcr.io/labring/fastgpt-plugin:v0.1.13 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.12 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.13 # 阿里云
container_name: fastgpt-plugin container_name: fastgpt-plugin
restart: always restart: always
networks: networks:
@@ -252,8 +252,8 @@ services:
# AI Proxy # AI Proxy
aiproxy: aiproxy:
image: ghcr.io/labring/aiproxy:v0.2.2 image: ghcr.io/labring/aiproxy:v0.3.2
# image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.2.2 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.3.2 # 阿里云
container_name: aiproxy container_name: aiproxy
restart: unless-stopped restart: unless-stopped
depends_on: depends_on:

View File

@@ -126,8 +126,8 @@ services:
fastgpt: fastgpt:
container_name: fastgpt container_name: fastgpt
image: ghcr.io/labring/fastgpt:v4.12.3 # git image: ghcr.io/labring/fastgpt:v4.12.4 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.3 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.4 # 阿里云
ports: ports:
- 3000:3000 - 3000:3000
networks: networks:
@@ -183,15 +183,15 @@ services:
- ./config.json:/app/data/config.json - ./config.json:/app/data/config.json
sandbox: sandbox:
container_name: sandbox container_name: sandbox
image: ghcr.io/labring/fastgpt-sandbox:v4.12.3 # git image: ghcr.io/labring/fastgpt-sandbox:v4.12.4 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.3 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.4 # 阿里云
networks: networks:
- fastgpt - fastgpt
restart: always restart: always
fastgpt-mcp-server: fastgpt-mcp-server:
container_name: fastgpt-mcp-server container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.12.3 # git image: ghcr.io/labring/fastgpt-mcp_server:v4.12.4 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.3 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.4 # 阿里云
ports: ports:
- 3005:3000 - 3005:3000
networks: networks:
@@ -200,8 +200,8 @@ services:
environment: environment:
- FASTGPT_ENDPOINT=http://fastgpt:3000 - FASTGPT_ENDPOINT=http://fastgpt:3000
fastgpt-plugin: fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v0.1.12 # git image: ghcr.io/labring/fastgpt-plugin:v0.1.13 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.12 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.13 # 阿里云
container_name: fastgpt-plugin container_name: fastgpt-plugin
restart: always restart: always
networks: networks:
@@ -226,8 +226,8 @@ services:
# AI Proxy # AI Proxy
aiproxy: aiproxy:
image: ghcr.io/labring/aiproxy:v0.2.2 image: ghcr.io/labring/aiproxy:v0.3.2
# image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.2.2 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.3.2 # 阿里云
container_name: aiproxy container_name: aiproxy
restart: unless-stopped restart: unless-stopped
depends_on: depends_on:

View File

@@ -112,8 +112,8 @@ services:
fastgpt: fastgpt:
container_name: fastgpt container_name: fastgpt
image: ghcr.io/labring/fastgpt:v4.12.3 # git image: ghcr.io/labring/fastgpt:v4.12.4 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.3 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.4 # 阿里云
ports: ports:
- 3000:3000 - 3000:3000
networks: networks:
@@ -169,15 +169,15 @@ services:
- ./config.json:/app/data/config.json - ./config.json:/app/data/config.json
sandbox: sandbox:
container_name: sandbox container_name: sandbox
image: ghcr.io/labring/fastgpt-sandbox:v4.12.3 # git image: ghcr.io/labring/fastgpt-sandbox:v4.12.4 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.3 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.4 # 阿里云
networks: networks:
- fastgpt - fastgpt
restart: always restart: always
fastgpt-mcp-server: fastgpt-mcp-server:
container_name: fastgpt-mcp-server container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.12.3 # git image: ghcr.io/labring/fastgpt-mcp_server:v4.12.4 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.3 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.4 # 阿里云
ports: ports:
- 3005:3000 - 3005:3000
networks: networks:
@@ -186,8 +186,8 @@ services:
environment: environment:
- FASTGPT_ENDPOINT=http://fastgpt:3000 - FASTGPT_ENDPOINT=http://fastgpt:3000
fastgpt-plugin: fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v0.1.12 # git image: ghcr.io/labring/fastgpt-plugin:v0.1.13 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.12 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.13 # 阿里云
container_name: fastgpt-plugin container_name: fastgpt-plugin
restart: always restart: always
networks: networks:
@@ -212,8 +212,8 @@ services:
# AI Proxy # AI Proxy
aiproxy: aiproxy:
image: ghcr.io/labring/aiproxy:v0.2.2 image: ghcr.io/labring/aiproxy:v0.3.2
# image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.2.2 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.3.2 # 阿里云
container_name: aiproxy container_name: aiproxy
restart: unless-stopped restart: unless-stopped
depends_on: depends_on:

View File

@@ -92,8 +92,8 @@ services:
fastgpt: fastgpt:
container_name: fastgpt container_name: fastgpt
image: ghcr.io/labring/fastgpt:v4.12.3 # git image: ghcr.io/labring/fastgpt:v4.12.4 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.3 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.4 # 阿里云
ports: ports:
- 3000:3000 - 3000:3000
networks: networks:
@@ -151,15 +151,15 @@ services:
- ./config.json:/app/data/config.json - ./config.json:/app/data/config.json
sandbox: sandbox:
container_name: sandbox container_name: sandbox
image: ghcr.io/labring/fastgpt-sandbox:v4.12.3 # git image: ghcr.io/labring/fastgpt-sandbox:v4.12.4 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.3 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.4 # 阿里云
networks: networks:
- fastgpt - fastgpt
restart: always restart: always
fastgpt-mcp-server: fastgpt-mcp-server:
container_name: fastgpt-mcp-server container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.12.3 # git image: ghcr.io/labring/fastgpt-mcp_server:v4.12.4 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.3 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.4 # 阿里云
ports: ports:
- 3005:3000 - 3005:3000
networks: networks:
@@ -168,8 +168,8 @@ services:
environment: environment:
- FASTGPT_ENDPOINT=http://fastgpt:3000 - FASTGPT_ENDPOINT=http://fastgpt:3000
fastgpt-plugin: fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v0.1.12 # git image: ghcr.io/labring/fastgpt-plugin:v0.1.13 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.12 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.13 # 阿里云
container_name: fastgpt-plugin container_name: fastgpt-plugin
restart: always restart: always
networks: networks:
@@ -194,8 +194,8 @@ services:
# AI Proxy # AI Proxy
aiproxy: aiproxy:
image: ghcr.io/labring/aiproxy:v0.2.2 image: ghcr.io/labring/aiproxy:v0.3.2
# image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.2.2 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.3.2 # 阿里云
container_name: aiproxy container_name: aiproxy
restart: unless-stopped restart: unless-stopped
depends_on: depends_on:

View File

@@ -95,8 +95,8 @@ services:
fastgpt: fastgpt:
container_name: fastgpt container_name: fastgpt
image: ghcr.io/labring/fastgpt:v4.12.3 # git image: ghcr.io/labring/fastgpt:v4.12.4 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.3 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.12.4 # 阿里云
ports: ports:
- 3000:3000 - 3000:3000
networks: networks:
@@ -152,15 +152,15 @@ services:
- ./config.json:/app/data/config.json - ./config.json:/app/data/config.json
sandbox: sandbox:
container_name: sandbox container_name: sandbox
image: ghcr.io/labring/fastgpt-sandbox:v4.12.3 # git image: ghcr.io/labring/fastgpt-sandbox:v4.12.4 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.3 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.12.4 # 阿里云
networks: networks:
- fastgpt - fastgpt
restart: always restart: always
fastgpt-mcp-server: fastgpt-mcp-server:
container_name: fastgpt-mcp-server container_name: fastgpt-mcp-server
image: ghcr.io/labring/fastgpt-mcp_server:v4.12.3 # git image: ghcr.io/labring/fastgpt-mcp_server:v4.12.4 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.3 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.12.4 # 阿里云
ports: ports:
- 3005:3000 - 3005:3000
networks: networks:
@@ -169,8 +169,8 @@ services:
environment: environment:
- FASTGPT_ENDPOINT=http://fastgpt:3000 - FASTGPT_ENDPOINT=http://fastgpt:3000
fastgpt-plugin: fastgpt-plugin:
image: ghcr.io/labring/fastgpt-plugin:v0.1.12 # git image: ghcr.io/labring/fastgpt-plugin:v0.1.13 # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.12 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-plugin:v0.1.13 # 阿里云
container_name: fastgpt-plugin container_name: fastgpt-plugin
restart: always restart: always
networks: networks:
@@ -195,8 +195,8 @@ services:
# AI Proxy # AI Proxy
aiproxy: aiproxy:
image: ghcr.io/labring/aiproxy:v0.2.2 image: ghcr.io/labring/aiproxy:v0.3.2
# image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.2.2 # 阿里云 # image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.3.2 # 阿里云
container_name: aiproxy container_name: aiproxy
restart: unless-stopped restart: unless-stopped
depends_on: depends_on:

View File

@@ -1,8 +1,19 @@
--- ---
title: 'V4.12.4(进行)' title: 'V4.12.4'
description: 'FastGPT V4.12.4 更新说明' description: 'FastGPT V4.12.4 更新说明, 发布于 2025-9-15'
--- ---
## 更新指南
### 1. 更新镜像:
- 更新 FastGPT 镜像tag: v4.12.4
- 更新 FastGPT 商业版镜像tag: v4.12.4
- 更新 fastgpt-plugin 镜像 tag: v0.1.13
- mcp_server 无需更新
- 更新 Sandbox 镜像 tag: v4.12.4
- AIProxy 无需更新
## 🚀 新增内容 ## 🚀 新增内容
1. 商业版支持企微发布渠道。 1. 商业版支持企微发布渠道。

View File

@@ -31,7 +31,7 @@
"document/content/docs/introduction/development/modelConfig/ppio.mdx": "2025-08-05T23:20:39+08:00", "document/content/docs/introduction/development/modelConfig/ppio.mdx": "2025-08-05T23:20:39+08:00",
"document/content/docs/introduction/development/modelConfig/siliconCloud.mdx": "2025-08-05T23:20:39+08:00", "document/content/docs/introduction/development/modelConfig/siliconCloud.mdx": "2025-08-05T23:20:39+08:00",
"document/content/docs/introduction/development/openapi/chat.mdx": "2025-08-14T18:54:47+08:00", "document/content/docs/introduction/development/openapi/chat.mdx": "2025-08-14T18:54:47+08:00",
"document/content/docs/introduction/development/openapi/dataset.mdx": "2025-09-11T10:29:11+08:00", "document/content/docs/introduction/development/openapi/dataset.mdx": "2025-09-15T20:02:54+08:00",
"document/content/docs/introduction/development/openapi/intro.mdx": "2025-08-14T18:54:47+08:00", "document/content/docs/introduction/development/openapi/intro.mdx": "2025-08-14T18:54:47+08:00",
"document/content/docs/introduction/development/openapi/share.mdx": "2025-08-05T23:20:39+08:00", "document/content/docs/introduction/development/openapi/share.mdx": "2025-08-05T23:20:39+08:00",
"document/content/docs/introduction/development/proxy/cloudflare.mdx": "2025-07-23T21:35:03+08:00", "document/content/docs/introduction/development/proxy/cloudflare.mdx": "2025-07-23T21:35:03+08:00",
@@ -97,7 +97,7 @@
"document/content/docs/protocol/terms.en.mdx": "2025-08-03T22:37:45+08:00", "document/content/docs/protocol/terms.en.mdx": "2025-08-03T22:37:45+08:00",
"document/content/docs/protocol/terms.mdx": "2025-08-03T22:37:45+08:00", "document/content/docs/protocol/terms.mdx": "2025-08-03T22:37:45+08:00",
"document/content/docs/toc.en.mdx": "2025-08-04T13:42:36+08:00", "document/content/docs/toc.en.mdx": "2025-08-04T13:42:36+08:00",
"document/content/docs/toc.mdx": "2025-09-12T12:58:39+08:00", "document/content/docs/toc.mdx": "2025-09-15T20:02:54+08:00",
"document/content/docs/upgrading/4-10/4100.mdx": "2025-08-02T19:38:37+08:00", "document/content/docs/upgrading/4-10/4100.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-10/4101.mdx": "2025-09-08T20:07:20+08:00", "document/content/docs/upgrading/4-10/4101.mdx": "2025-09-08T20:07:20+08:00",
"document/content/docs/upgrading/4-11/4110.mdx": "2025-08-05T23:20:39+08:00", "document/content/docs/upgrading/4-11/4110.mdx": "2025-08-05T23:20:39+08:00",
@@ -106,7 +106,7 @@
"document/content/docs/upgrading/4-12/4121.mdx": "2025-09-07T14:41:48+08:00", "document/content/docs/upgrading/4-12/4121.mdx": "2025-09-07T14:41:48+08:00",
"document/content/docs/upgrading/4-12/4122.mdx": "2025-09-07T14:41:48+08:00", "document/content/docs/upgrading/4-12/4122.mdx": "2025-09-07T14:41:48+08:00",
"document/content/docs/upgrading/4-12/4123.mdx": "2025-09-07T20:55:14+08:00", "document/content/docs/upgrading/4-12/4123.mdx": "2025-09-07T20:55:14+08:00",
"document/content/docs/upgrading/4-12/4124.mdx": "2025-09-13T01:34:04+08:00", "document/content/docs/upgrading/4-12/4124.mdx": "2025-09-15T20:02:54+08:00",
"document/content/docs/upgrading/4-8/40.mdx": "2025-08-02T19:38:37+08:00", "document/content/docs/upgrading/4-8/40.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-8/41.mdx": "2025-08-02T19:38:37+08:00", "document/content/docs/upgrading/4-8/41.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00", "document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00",
@@ -186,6 +186,6 @@
"document/content/docs/use-cases/external-integration/feishu.mdx": "2025-07-24T14:23:04+08:00", "document/content/docs/use-cases/external-integration/feishu.mdx": "2025-07-24T14:23:04+08:00",
"document/content/docs/use-cases/external-integration/official_account.mdx": "2025-08-05T23:20:39+08:00", "document/content/docs/use-cases/external-integration/official_account.mdx": "2025-08-05T23:20:39+08:00",
"document/content/docs/use-cases/external-integration/openapi.mdx": "2025-08-14T18:54:47+08:00", "document/content/docs/use-cases/external-integration/openapi.mdx": "2025-08-14T18:54:47+08:00",
"document/content/docs/use-cases/external-integration/wecom.mdx": "2025-09-12T12:58:39+08:00", "document/content/docs/use-cases/external-integration/wecom.mdx": "2025-09-15T20:02:54+08:00",
"document/content/docs/use-cases/index.mdx": "2025-07-24T14:23:04+08:00" "document/content/docs/use-cases/index.mdx": "2025-07-24T14:23:04+08:00"
} }

View File

@@ -153,7 +153,10 @@ export const dispatchRunTool = async (props: RunToolProps): Promise<RunToolRespo
} }
const usagePoints = (() => { const usagePoints = (() => {
if (params.system_input_config?.type !== SystemToolInputTypeEnum.system) { if (
params.system_input_config?.type === SystemToolInputTypeEnum.team ||
params.system_input_config?.type === SystemToolInputTypeEnum.manual
) {
return 0; return 0;
} }
return (tool.systemKeyCost ?? 0) + (tool.currentCost ?? 0); return (tool.systemKeyCost ?? 0) + (tool.currentCost ?? 0);

View File

@@ -15,7 +15,7 @@ function UserBox({ sourceMember, avatarSize = '1.25rem', ...props }: UserBoxProp
return ( return (
<HStack space="1" {...props}> <HStack space="1" {...props}>
<Avatar src={sourceMember.avatar} w={avatarSize} /> <Avatar src={sourceMember.avatar} w={avatarSize} borderRadius={'xs'} />
<Box maxW={'150px'} whiteSpace={'nowrap'} overflow={'hidden'}> <Box maxW={'150px'} whiteSpace={'nowrap'} overflow={'hidden'}>
{sourceMember.name} {sourceMember.name}
</Box> </Box>

View File

@@ -94,13 +94,19 @@ const ConfigToolModal = ({
<Controller <Controller
control={control} control={control}
name={input.key} name={input.key}
render={({ field: { onChange, value } }) => ( rules={{
required: true
}}
render={({ field: { onChange, value }, fieldState: { error } }) => (
<Box> <Box>
<FormLabel mb={1}>{t('common:secret_key')}</FormLabel> <FormLabel mb={1} required>
{t('common:secret_key')}
</FormLabel>
<Button <Button
variant={'whiteBase'} variant={'whiteBase'}
border={'base'} border={'base'}
borderRadius={'md'} borderRadius={'md'}
borderColor={error ? 'red.500' : 'borderColor.low'}
leftIcon={ leftIcon={
<Box w={'6px'} h={'6px'} bg={'primary.600'} borderRadius={'md'} /> <Box w={'6px'} h={'6px'} bg={'primary.600'} borderRadius={'md'} />
} }

View File

@@ -1,4 +1,5 @@
import { NextAPI } from '@/service/middleware/entry'; import { NextAPI } from '@/service/middleware/entry';
import { batchRun } from '@fastgpt/global/common/system/utils';
import { OwnerRoleVal, PerResourceTypeEnum } from '@fastgpt/global/support/permission/constant'; import { OwnerRoleVal, PerResourceTypeEnum } from '@fastgpt/global/support/permission/constant';
import { MongoApp } from '@fastgpt/service/core/app/schema'; import { MongoApp } from '@fastgpt/service/core/app/schema';
import { MongoDataset } from '@fastgpt/service/core/dataset/schema'; import { MongoDataset } from '@fastgpt/service/core/dataset/schema';
@@ -32,51 +33,60 @@ async function handler(
MongoTeamMember.find({ role: 'owner' }, '_id teamId').lean() MongoTeamMember.find({ role: 'owner' }, '_id teamId').lean()
]); ]);
await MongoResourcePermission.bulkWrite( for (let i = 0; i < apps.length; i += 10000) {
apps.map((app) => ({ const appList = apps.slice(i, i + 10000);
updateOne: { await MongoResourcePermission.bulkWrite(
filter: { appList.map((app) => ({
resourceId: app._id, updateOne: {
resourceType: PerResourceTypeEnum.app, filter: {
teamId: app.teamId, resourceId: app._id,
tmbId: app.tmbId resourceType: PerResourceTypeEnum.app,
}, teamId: app.teamId,
update: { tmbId: app.tmbId
permission: OwnerRoleVal },
}, update: {
upsert: true permission: OwnerRoleVal
} },
})) upsert: true
);
await MongoResourcePermission.bulkWrite(
datasets.map((dataset) => ({
updateOne: {
filter: {
resourceId: dataset._id,
resourceType: PerResourceTypeEnum.dataset,
teamId: dataset.teamId,
tmbId: dataset.tmbId
},
update: {
permission: OwnerRoleVal
},
upsert: true
}
}))
);
await MongoResourcePermission.bulkWrite(
tmbs.map((team) => ({
deleteOne: {
filter: {
resourceType: PerResourceTypeEnum.team,
teamId: team.teamId,
tmbId: team._id
} }
} }))
})) );
); }
for (let i = 0; i < datasets.length; i += 10000) {
const datasetList = datasets.slice(i, i + 10000);
await MongoResourcePermission.bulkWrite(
datasetList.map((dataset) => ({
updateOne: {
filter: {
resourceId: dataset._id,
resourceType: PerResourceTypeEnum.dataset,
teamId: dataset.teamId,
tmbId: dataset.tmbId
},
update: {
permission: OwnerRoleVal
},
upsert: true
}
}))
);
}
for (let i = 0; i < tmbs.length; i += 10000) {
const tmbList = tmbs.slice(i, i + 10000);
await MongoResourcePermission.bulkWrite(
tmbList.map((team) => ({
deleteOne: {
filter: {
resourceType: PerResourceTypeEnum.team,
teamId: team.teamId,
tmbId: team._id
}
}
}))
);
}
return { return {
message: 'Success' message: 'Success'