Compare commits
1 Commits
main
...
test-openG
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63028dacb2 |
@ -132,15 +132,15 @@ services:
|
|||||||
# fastgpt
|
# fastgpt
|
||||||
sandbox:
|
sandbox:
|
||||||
container_name: sandbox
|
container_name: sandbox
|
||||||
image: ghcr.io/labring/fastgpt-sandbox:v4.9.10-fix2 # git
|
image: ghcr.io/labring/fastgpt-sandbox:v4.9.10 # git
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.9.10-fix2 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.9.10 # 阿里云
|
||||||
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.9.10-fix2 # git
|
image: ghcr.io/labring/fastgpt-mcp_server:v4.9.10 # git
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.9.10-fix2 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.9.10 # 阿里云
|
||||||
ports:
|
ports:
|
||||||
- 3005:3000
|
- 3005:3000
|
||||||
networks:
|
networks:
|
||||||
@ -150,8 +150,8 @@ services:
|
|||||||
- FASTGPT_ENDPOINT=http://fastgpt:3000
|
- FASTGPT_ENDPOINT=http://fastgpt:3000
|
||||||
fastgpt:
|
fastgpt:
|
||||||
container_name: fastgpt
|
container_name: fastgpt
|
||||||
image: ghcr.io/labring/fastgpt:v4.9.10-fix2 # git
|
image: ghcr.io/labring/fastgpt:v4.9.10 # git
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.9.10-fix2 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.9.10 # 阿里云
|
||||||
ports:
|
ports:
|
||||||
- 3000:3000
|
- 3000:3000
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@ -109,15 +109,15 @@ services:
|
|||||||
# fastgpt
|
# fastgpt
|
||||||
sandbox:
|
sandbox:
|
||||||
container_name: sandbox
|
container_name: sandbox
|
||||||
image: ghcr.io/labring/fastgpt-sandbox:v4.9.10-fix2 # git
|
image: ghcr.io/labring/fastgpt-sandbox:v4.9.10 # git
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.9.10-fix2 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.9.10 # 阿里云
|
||||||
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.9.10-fix2 # git
|
image: ghcr.io/labring/fastgpt-mcp_server:v4.9.10 # git
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.9.10-fix2 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.9.10 # 阿里云
|
||||||
ports:
|
ports:
|
||||||
- 3005:3000
|
- 3005:3000
|
||||||
networks:
|
networks:
|
||||||
@ -127,8 +127,8 @@ services:
|
|||||||
- FASTGPT_ENDPOINT=http://fastgpt:3000
|
- FASTGPT_ENDPOINT=http://fastgpt:3000
|
||||||
fastgpt:
|
fastgpt:
|
||||||
container_name: fastgpt
|
container_name: fastgpt
|
||||||
image: ghcr.io/labring/fastgpt:v4.9.10-fix2 # git
|
image: ghcr.io/labring/fastgpt:v4.9.10 # git
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.9.10-fix2 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.9.10 # 阿里云
|
||||||
ports:
|
ports:
|
||||||
- 3000:3000
|
- 3000:3000
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
218
deploy/docker/docker-compose-opengauss.yml
Normal file
218
deploy/docker/docker-compose-opengauss.yml
Normal file
@ -0,0 +1,218 @@
|
|||||||
|
# 数据库的默认账号和密码仅首次运行时设置有效
|
||||||
|
# 如果修改了账号密码,记得改数据库和项目连接参数,别只改一处~
|
||||||
|
# 该配置文件只是给快速启动,测试使用。正式使用,记得务必修改账号密码,以及调整合适的知识库参数,共享内存等。
|
||||||
|
# 如何无法访问 dockerhub 和 git,可以用阿里云(阿里云没有arm包)
|
||||||
|
|
||||||
|
version: '3.3'
|
||||||
|
services:
|
||||||
|
# db
|
||||||
|
gs:
|
||||||
|
image: opengauss/opengauss:7.0.0-RC1 # docker hub
|
||||||
|
container_name: gs
|
||||||
|
restart: always
|
||||||
|
# ports: # 生产环境建议不要暴露
|
||||||
|
# - 5432:5432
|
||||||
|
networks:
|
||||||
|
- fastgpt
|
||||||
|
environment:
|
||||||
|
# 这里的配置只有首次运行生效。修改后,重启镜像是不会生效的。需要把持久化数据删除再重启,才有效果
|
||||||
|
- GS_USER=username
|
||||||
|
- GS_PASSWORD=password
|
||||||
|
- GS_DB=postgres
|
||||||
|
volumes:
|
||||||
|
- ./opengauss/data:/var/lib/opengauss/data
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD-SHELL', 'netstat -lntp | grep tcp6 > /dev/null 2>&1']
|
||||||
|
interval: 10s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 10
|
||||||
|
mongo:
|
||||||
|
image: mongo:5.0.18 # dockerhub
|
||||||
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/mongo:5.0.18 # 阿里云
|
||||||
|
# image: mongo:4.4.29 # cpu不支持AVX时候使用
|
||||||
|
container_name: mongo
|
||||||
|
restart: always
|
||||||
|
# ports:
|
||||||
|
# - 27017:27017
|
||||||
|
networks:
|
||||||
|
- fastgpt
|
||||||
|
command: mongod --keyFile /data/mongodb.key --replSet rs0
|
||||||
|
environment:
|
||||||
|
- MONGO_INITDB_ROOT_USERNAME=myusername
|
||||||
|
- MONGO_INITDB_ROOT_PASSWORD=mypassword
|
||||||
|
volumes:
|
||||||
|
- ./mongo/data:/data/db
|
||||||
|
entrypoint:
|
||||||
|
- bash
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
openssl rand -base64 128 > /data/mongodb.key
|
||||||
|
chmod 400 /data/mongodb.key
|
||||||
|
chown 999:999 /data/mongodb.key
|
||||||
|
echo 'const isInited = rs.status().ok === 1
|
||||||
|
if(!isInited){
|
||||||
|
rs.initiate({
|
||||||
|
_id: "rs0",
|
||||||
|
members: [
|
||||||
|
{ _id: 0, host: "mongo:27017" }
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}' > /data/initReplicaSet.js
|
||||||
|
# 启动MongoDB服务
|
||||||
|
exec docker-entrypoint.sh "$$@" &
|
||||||
|
|
||||||
|
# 等待MongoDB服务启动
|
||||||
|
until mongo -u myusername -p mypassword --authenticationDatabase admin --eval "print('waited for connection')"; do
|
||||||
|
echo "Waiting for MongoDB to start..."
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
|
||||||
|
# 执行初始化副本集的脚本
|
||||||
|
mongo -u myusername -p mypassword --authenticationDatabase admin /data/initReplicaSet.js
|
||||||
|
|
||||||
|
# 等待docker-entrypoint.sh脚本执行的MongoDB服务进程
|
||||||
|
wait $$!
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:7.2-alpine
|
||||||
|
container_name: redis
|
||||||
|
# ports:
|
||||||
|
# - 6379:6379
|
||||||
|
networks:
|
||||||
|
- fastgpt
|
||||||
|
restart: always
|
||||||
|
command: |
|
||||||
|
redis-server --requirepass mypassword --loglevel warning --maxclients 10000 --appendonly yes --save 60 10 --maxmemory 4gb --maxmemory-policy noeviction
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD', 'redis-cli', '-a', 'mypassword', 'ping']
|
||||||
|
interval: 10s
|
||||||
|
timeout: 3s
|
||||||
|
retries: 3
|
||||||
|
start_period: 30s
|
||||||
|
volumes:
|
||||||
|
- ./redis/data:/data
|
||||||
|
|
||||||
|
# fastgpt
|
||||||
|
sandbox:
|
||||||
|
container_name: sandbox
|
||||||
|
image: ghcr.io/labring/fastgpt-sandbox:v4.9.7-fix2 # git
|
||||||
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.9.7-fix2 # 阿里云
|
||||||
|
networks:
|
||||||
|
- fastgpt
|
||||||
|
restart: always
|
||||||
|
fastgpt-mcp-server:
|
||||||
|
container_name: fastgpt-mcp-server
|
||||||
|
image: ghcr.io/labring/fastgpt-mcp_server:v4.9.7-fix2 # git
|
||||||
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.9.7-fix2 # 阿里云
|
||||||
|
ports:
|
||||||
|
- 3005:3000
|
||||||
|
networks:
|
||||||
|
- fastgpt
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- FASTGPT_ENDPOINT=http://fastgpt:3000
|
||||||
|
fastgpt:
|
||||||
|
container_name: fastgpt
|
||||||
|
image: ghcr.io/labring/fastgpt:v4.9.7-fix2 # git
|
||||||
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.9.7-fix2 # 阿里云
|
||||||
|
# image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/ghcr.io/labring/fastgpt:v4.8.4-linuxarm64 # openGauss在arm架构上性能更好
|
||||||
|
ports:
|
||||||
|
- 3000:3000
|
||||||
|
networks:
|
||||||
|
- fastgpt
|
||||||
|
depends_on:
|
||||||
|
- mongo
|
||||||
|
- gs
|
||||||
|
- sandbox
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
# 前端外部可访问的地址,用于自动补全文件资源路径。例如 https:fastgpt.cn,不能填 localhost。这个值可以不填,不填则发给模型的图片会是一个相对路径,而不是全路径,模型可能伪造Host。
|
||||||
|
- FE_DOMAIN=
|
||||||
|
# root 密码,用户名为: root。如果需要修改 root 密码,直接修改这个环境变量,并重启即可。
|
||||||
|
- DEFAULT_ROOT_PSW=1234
|
||||||
|
# AI Proxy 的地址,如果配了该地址,优先使用
|
||||||
|
- AIPROXY_API_ENDPOINT=http://aiproxy:3000
|
||||||
|
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
|
||||||
|
- AIPROXY_API_TOKEN=aiproxy
|
||||||
|
# 数据库最大连接数
|
||||||
|
- DB_MAX_LINK=30
|
||||||
|
# 登录凭证密钥
|
||||||
|
- TOKEN_KEY=any
|
||||||
|
# root的密钥,常用于升级时候的初始化请求
|
||||||
|
- ROOT_KEY=root_key
|
||||||
|
# 文件阅读加密
|
||||||
|
- FILE_TOKEN_KEY=filetoken
|
||||||
|
# MongoDB 连接参数. 用户名myusername,密码mypassword。
|
||||||
|
- MONGODB_URI=mongodb://myusername:mypassword@mongo:27017/fastgpt?authSource=admin
|
||||||
|
# openGauss 连接参数
|
||||||
|
- OPENGAUSS_URL=opengauss://gaussdb:Huawei12%23%24@gs:9999/test
|
||||||
|
# Redis 连接参数
|
||||||
|
- REDIS_URL=redis://default:mypassword@redis:6379
|
||||||
|
# sandbox 地址
|
||||||
|
- SANDBOX_URL=http://sandbox:3000
|
||||||
|
# 日志等级: debug, info, warn, error
|
||||||
|
- LOG_LEVEL=info
|
||||||
|
- STORE_LOG_LEVEL=warn
|
||||||
|
# 工作流最大运行次数
|
||||||
|
- WORKFLOW_MAX_RUN_TIMES=1000
|
||||||
|
# 批量执行节点,最大输入长度
|
||||||
|
- WORKFLOW_MAX_LOOP_TIMES=100
|
||||||
|
# 自定义跨域,不配置时,默认都允许跨域(多个域名通过逗号分割)
|
||||||
|
- ALLOWED_ORIGINS=
|
||||||
|
# 是否开启IP限制,默认不开启
|
||||||
|
- USE_IP_LIMIT=false
|
||||||
|
# 对话文件过期天数
|
||||||
|
- CHAT_FILE_EXPIRE_TIME=7
|
||||||
|
volumes:
|
||||||
|
- ./config.json:/app/data/config.json
|
||||||
|
|
||||||
|
# AI Proxy
|
||||||
|
aiproxy:
|
||||||
|
image: ghcr.io/labring/aiproxy:v0.1.7
|
||||||
|
# image: registry.cn-hangzhou.aliyuncs.com/labring/aiproxy:v0.1.7 # 阿里云
|
||||||
|
container_name: aiproxy
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
aiproxy_pg:
|
||||||
|
condition: service_healthy
|
||||||
|
networks:
|
||||||
|
- fastgpt
|
||||||
|
environment:
|
||||||
|
# 对应 fastgpt 里的AIPROXY_API_TOKEN
|
||||||
|
- ADMIN_KEY=aiproxy
|
||||||
|
# 错误日志详情保存时间(小时)
|
||||||
|
- LOG_DETAIL_STORAGE_HOURS=1
|
||||||
|
# 数据库连接地址
|
||||||
|
- SQL_DSN=postgres://postgres:aiproxy@aiproxy_pg:5432/aiproxy
|
||||||
|
# 最大重试次数
|
||||||
|
- RETRY_TIMES=3
|
||||||
|
# 不需要计费
|
||||||
|
- BILLING_ENABLED=false
|
||||||
|
# 不需要严格检测模型
|
||||||
|
- DISABLE_MODEL_CONFIG=true
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD', 'curl', '-f', 'http://localhost:3000/api/status']
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
aiproxy_pg:
|
||||||
|
image: pgvector/pgvector:0.8.0-pg15 # docker hub
|
||||||
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.8.0-pg15 # 阿里云
|
||||||
|
restart: unless-stopped
|
||||||
|
container_name: aiproxy_pg
|
||||||
|
volumes:
|
||||||
|
- ./aiproxy_pg:/var/lib/postgresql/data
|
||||||
|
networks:
|
||||||
|
- fastgpt
|
||||||
|
environment:
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_DB: aiproxy
|
||||||
|
POSTGRES_PASSWORD: aiproxy
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD', 'pg_isready', '-U', 'postgres', '-d', 'aiproxy']
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
networks:
|
||||||
|
fastgpt:
|
||||||
@ -96,15 +96,15 @@ services:
|
|||||||
# fastgpt
|
# fastgpt
|
||||||
sandbox:
|
sandbox:
|
||||||
container_name: sandbox
|
container_name: sandbox
|
||||||
image: ghcr.io/labring/fastgpt-sandbox:v4.9.10-fix2 # git
|
image: ghcr.io/labring/fastgpt-sandbox:v4.9.10 # git
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.9.10-fix2 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.9.10 # 阿里云
|
||||||
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.9.10-fix2 # git
|
image: ghcr.io/labring/fastgpt-mcp_server:v4.9.10 # git
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.9.10-fix2 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.9.10 # 阿里云
|
||||||
ports:
|
ports:
|
||||||
- 3005:3000
|
- 3005:3000
|
||||||
networks:
|
networks:
|
||||||
@ -114,8 +114,8 @@ services:
|
|||||||
- FASTGPT_ENDPOINT=http://fastgpt:3000
|
- FASTGPT_ENDPOINT=http://fastgpt:3000
|
||||||
fastgpt:
|
fastgpt:
|
||||||
container_name: fastgpt
|
container_name: fastgpt
|
||||||
image: ghcr.io/labring/fastgpt:v4.9.10-fix2 # git
|
image: ghcr.io/labring/fastgpt:v4.9.10 # git
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.9.10-fix2 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.9.10 # 阿里云
|
||||||
ports:
|
ports:
|
||||||
- 3000:3000
|
- 3000:3000
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@ -72,15 +72,15 @@ services:
|
|||||||
|
|
||||||
sandbox:
|
sandbox:
|
||||||
container_name: sandbox
|
container_name: sandbox
|
||||||
image: ghcr.io/labring/fastgpt-sandbox:v4.9.10-fix2 # git
|
image: ghcr.io/labring/fastgpt-sandbox:v4.9.10 # git
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.9.10-fix2 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.9.10 # 阿里云
|
||||||
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.9.10-fix2 # git
|
image: ghcr.io/labring/fastgpt-mcp_server:v4.9.10 # git
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.9.10-fix2 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-mcp_server:v4.9.10 # 阿里云
|
||||||
ports:
|
ports:
|
||||||
- 3005:3000
|
- 3005:3000
|
||||||
networks:
|
networks:
|
||||||
@ -90,8 +90,8 @@ services:
|
|||||||
- FASTGPT_ENDPOINT=http://fastgpt:3000
|
- FASTGPT_ENDPOINT=http://fastgpt:3000
|
||||||
fastgpt:
|
fastgpt:
|
||||||
container_name: fastgpt
|
container_name: fastgpt
|
||||||
image: ghcr.io/labring/fastgpt:v4.9.10-fix2 # git
|
image: ghcr.io/labring/fastgpt:v4.9.10 # git
|
||||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.9.10-fix2 # 阿里云
|
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.9.10 # 阿里云
|
||||||
ports:
|
ports:
|
||||||
- 3000:3000
|
- 3000:3000
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
4
dev.md
4
dev.md
@ -99,10 +99,6 @@ export default staticContent;
|
|||||||
- Use the t(namespace:key) format to ensure consistent naming.
|
- Use the t(namespace:key) format to ensure consistent naming.
|
||||||
- Translation keys should use lowercase letters and underscores, e.g., common.close.
|
- Translation keys should use lowercase letters and underscores, e.g., common.close.
|
||||||
|
|
||||||
## audit
|
|
||||||
|
|
||||||
Please fill the OperationLogEventEnum and operationLog/audit function is added to the ts, and on the corresponding position to fill i18n, at the same time to add the location of the log using addOpearationLog function add function
|
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
|||||||
@ -645,7 +645,7 @@ data 为集合的 ID。
|
|||||||
{{< /tab >}}
|
{{< /tab >}}
|
||||||
{{< /tabs >}}
|
{{< /tabs >}}
|
||||||
|
|
||||||
### 创建一个外部文件库集合(弃用)
|
### 创建一个外部文件库集合(商业版)
|
||||||
|
|
||||||
{{< tabs tabTotal="3" >}}
|
{{< tabs tabTotal="3" >}}
|
||||||
{{< tab tabName="请求示例" >}}
|
{{< tab tabName="请求示例" >}}
|
||||||
|
|||||||
@ -15,8 +15,8 @@ weight: 790
|
|||||||
|
|
||||||
### 2. 更新镜像 tag
|
### 2. 更新镜像 tag
|
||||||
|
|
||||||
- 更新 FastGPT 镜像 tag: v4.9.10-fix2
|
- 更新 FastGPT 镜像 tag: v4.9.10
|
||||||
- 更新 FastGPT 商业版镜像 tag: v4.9.10-fix2
|
- 更新 FastGPT 商业版镜像 tag: v4.9.10
|
||||||
- mcp_server 无需更新
|
- mcp_server 无需更新
|
||||||
- Sandbox 无需更新
|
- Sandbox 无需更新
|
||||||
- AIProxy 无需更新
|
- AIProxy 无需更新
|
||||||
|
|||||||
@ -10,16 +10,12 @@ weight: 789
|
|||||||
|
|
||||||
## 🚀 新增内容
|
## 🚀 新增内容
|
||||||
|
|
||||||
1. 工作流中增加节点搜索功能。
|
1. 工作流中,子流程版本控制,可选择“保持最新版本”,无需手动更新。
|
||||||
2. 工作流中,子流程版本控制,可选择“保持最新版本”,无需手动更新。
|
|
||||||
|
|
||||||
## ⚙️ 优化
|
## ⚙️ 优化
|
||||||
|
|
||||||
1. 原文缓存改用 gridfs 存储,提高上限。
|
|
||||||
|
|
||||||
## 🐛 修复
|
## 🐛 修复
|
||||||
|
|
||||||
1. 工作流中,管理员声明的全局系统工具,无法进行版本管理。
|
1. 工作流中,管理员声明的全局系统工具,无法进行版本管理。
|
||||||
2. 工具调用节点前,有交互节点时,上下文异常。
|
|
||||||
3. 修复备份导入,小于 1000 字时,无法分块问题。
|
|
||||||
4. 自定义 PDF 解析,无法保存 base64 图片。
|
|
||||||
1
env.d.ts
vendored
1
env.d.ts
vendored
@ -15,6 +15,7 @@ declare global {
|
|||||||
MONGODB_LOG_URI?: string;
|
MONGODB_LOG_URI?: string;
|
||||||
PG_URL: string;
|
PG_URL: string;
|
||||||
OCEANBASE_URL: string;
|
OCEANBASE_URL: string;
|
||||||
|
OPENGAUSS_URL: string;
|
||||||
MILVUS_ADDRESS: string;
|
MILVUS_ADDRESS: string;
|
||||||
MILVUS_TOKEN: string;
|
MILVUS_TOKEN: string;
|
||||||
SANDBOX_URL: string;
|
SANDBOX_URL: string;
|
||||||
|
|||||||
7
packages/global/core/dataset/api.d.ts
vendored
7
packages/global/core/dataset/api.d.ts
vendored
@ -124,6 +124,13 @@ export type PgSearchRawType = {
|
|||||||
collection_id: string;
|
collection_id: string;
|
||||||
score: number;
|
score: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type GsSearchRawType = {
|
||||||
|
id: string;
|
||||||
|
collection_id: string;
|
||||||
|
score: number;
|
||||||
|
};
|
||||||
|
|
||||||
export type PushDatasetDataChunkProps = {
|
export type PushDatasetDataChunkProps = {
|
||||||
q: string; // embedding content
|
q: string; // embedding content
|
||||||
a?: string; // bonus content
|
a?: string; // bonus content
|
||||||
|
|||||||
@ -40,6 +40,5 @@ export function getSourceNameIcon({
|
|||||||
export const predictDataLimitLength = (mode: TrainingModeEnum, data: any[]) => {
|
export const predictDataLimitLength = (mode: TrainingModeEnum, data: any[]) => {
|
||||||
if (mode === TrainingModeEnum.qa) return data.length * 20;
|
if (mode === TrainingModeEnum.qa) return data.length * 20;
|
||||||
if (mode === TrainingModeEnum.auto) return data.length * 5;
|
if (mode === TrainingModeEnum.auto) return data.length * 5;
|
||||||
if (mode === TrainingModeEnum.image) return data.length * 2;
|
|
||||||
return data.length;
|
return data.length;
|
||||||
};
|
};
|
||||||
|
|||||||
1
packages/global/core/workflow/type/node.d.ts
vendored
1
packages/global/core/workflow/type/node.d.ts
vendored
@ -125,7 +125,6 @@ export type FlowNodeItemType = FlowNodeTemplateType & {
|
|||||||
nodeId: string;
|
nodeId: string;
|
||||||
parentNodeId?: string;
|
parentNodeId?: string;
|
||||||
isError?: boolean;
|
isError?: boolean;
|
||||||
searchedText?: string;
|
|
||||||
debugResult?: {
|
debugResult?: {
|
||||||
status: 'running' | 'success' | 'skipped' | 'failed';
|
status: 'running' | 'success' | 'skipped' | 'failed';
|
||||||
message?: string;
|
message?: string;
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
export enum OperationLogEventEnum {
|
export enum OperationLogEventEnum {
|
||||||
//Team
|
|
||||||
LOGIN = 'LOGIN',
|
LOGIN = 'LOGIN',
|
||||||
CREATE_INVITATION_LINK = 'CREATE_INVITATION_LINK',
|
CREATE_INVITATION_LINK = 'CREATE_INVITATION_LINK',
|
||||||
JOIN_TEAM = 'JOIN_TEAM',
|
JOIN_TEAM = 'JOIN_TEAM',
|
||||||
@ -12,52 +11,5 @@ export enum OperationLogEventEnum {
|
|||||||
RELOCATE_DEPARTMENT = 'RELOCATE_DEPARTMENT',
|
RELOCATE_DEPARTMENT = 'RELOCATE_DEPARTMENT',
|
||||||
CREATE_GROUP = 'CREATE_GROUP',
|
CREATE_GROUP = 'CREATE_GROUP',
|
||||||
DELETE_GROUP = 'DELETE_GROUP',
|
DELETE_GROUP = 'DELETE_GROUP',
|
||||||
ASSIGN_PERMISSION = 'ASSIGN_PERMISSION',
|
ASSIGN_PERMISSION = 'ASSIGN_PERMISSION'
|
||||||
//APP
|
|
||||||
CREATE_APP = 'CREATE_APP',
|
|
||||||
UPDATE_APP_INFO = 'UPDATE_APP_INFO',
|
|
||||||
MOVE_APP = 'MOVE_APP',
|
|
||||||
DELETE_APP = 'DELETE_APP',
|
|
||||||
UPDATE_APP_COLLABORATOR = 'UPDATE_APP_COLLABORATOR',
|
|
||||||
DELETE_APP_COLLABORATOR = 'DELETE_APP_COLLABORATOR',
|
|
||||||
TRANSFER_APP_OWNERSHIP = 'TRANSFER_APP_OWNERSHIP',
|
|
||||||
CREATE_APP_COPY = 'CREATE_APP_COPY',
|
|
||||||
CREATE_APP_FOLDER = 'CREATE_APP_FOLDER',
|
|
||||||
UPDATE_PUBLISH_APP = 'UPDATE_PUBLISH_APP',
|
|
||||||
CREATE_APP_PUBLISH_CHANNEL = 'CREATE_APP_PUBLISH_CHANNEL',
|
|
||||||
UPDATE_APP_PUBLISH_CHANNEL = 'UPDATE_APP_PUBLISH_CHANNEL',
|
|
||||||
DELETE_APP_PUBLISH_CHANNEL = 'DELETE_APP_PUBLISH_CHANNEL',
|
|
||||||
EXPORT_APP_CHAT_LOG = 'EXPORT_APP_CHAT_LOG',
|
|
||||||
//Dataset
|
|
||||||
CREATE_DATASET = 'CREATE_DATASET',
|
|
||||||
UPDATE_DATASET = 'UPDATE_DATASET',
|
|
||||||
DELETE_DATASET = 'DELETE_DATASET',
|
|
||||||
MOVE_DATASET = 'MOVE_DATASET',
|
|
||||||
UPDATE_DATASET_COLLABORATOR = 'UPDATE_DATASET_COLLABORATOR',
|
|
||||||
DELETE_DATASET_COLLABORATOR = 'DELETE_DATASET_COLLABORATOR',
|
|
||||||
TRANSFER_DATASET_OWNERSHIP = 'TRANSFER_DATASET_OWNERSHIP',
|
|
||||||
EXPORT_DATASET = 'EXPORT_DATASET',
|
|
||||||
CREATE_DATASET_FOLDER = 'CREATE_DATASET_FOLDER',
|
|
||||||
//Collection
|
|
||||||
CREATE_COLLECTION = 'CREATE_COLLECTION',
|
|
||||||
UPDATE_COLLECTION = 'UPDATE_COLLECTION',
|
|
||||||
DELETE_COLLECTION = 'DELETE_COLLECTION',
|
|
||||||
RETRAIN_COLLECTION = 'RETRAIN_COLLECTION',
|
|
||||||
//Data
|
|
||||||
CREATE_DATA = 'CREATE_DATA',
|
|
||||||
UPDATE_DATA = 'UPDATE_DATA',
|
|
||||||
DELETE_DATA = 'DELETE_DATA',
|
|
||||||
//SearchTest
|
|
||||||
SEARCH_TEST = 'SEARCH_TEST',
|
|
||||||
//Account
|
|
||||||
CHANGE_PASSWORD = 'CHANGE_PASSWORD',
|
|
||||||
CHANGE_NOTIFICATION_SETTINGS = 'CHANGE_NOTIFICATION_SETTINGS',
|
|
||||||
CHANGE_MEMBER_NAME_ACCOUNT = 'CHANGE_MEMBER_NAME_ACCOUNT',
|
|
||||||
PURCHASE_PLAN = 'PURCHASE_PLAN',
|
|
||||||
EXPORT_BILL_RECORDS = 'EXPORT_BILL_RECORDS',
|
|
||||||
CREATE_INVOICE = 'CREATE_INVOICE',
|
|
||||||
SET_INVOICE_HEADER = 'SET_INVOICE_HEADER',
|
|
||||||
CREATE_API_KEY = 'CREATE_API_KEY',
|
|
||||||
UPDATE_API_KEY = 'UPDATE_API_KEY',
|
|
||||||
DELETE_API_KEY = 'DELETE_API_KEY'
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,6 @@ const staticPluginList = [
|
|||||||
'WeWorkWebhook',
|
'WeWorkWebhook',
|
||||||
'google',
|
'google',
|
||||||
'bing',
|
'bing',
|
||||||
'bocha',
|
|
||||||
'delay'
|
'delay'
|
||||||
];
|
];
|
||||||
// Run in worker thread (Have npm packages)
|
// Run in worker thread (Have npm packages)
|
||||||
|
|||||||
@ -1,677 +0,0 @@
|
|||||||
{
|
|
||||||
"author": "",
|
|
||||||
"name": "博查搜索",
|
|
||||||
"avatar": "core/workflow/template/bocha",
|
|
||||||
"intro": "使用博查AI搜索引擎进行网络搜索。",
|
|
||||||
"showStatus": true,
|
|
||||||
"weight": 10,
|
|
||||||
"courseUrl": "",
|
|
||||||
"isTool": true,
|
|
||||||
"templateType": "search",
|
|
||||||
"workflow": {
|
|
||||||
"nodes": [
|
|
||||||
{
|
|
||||||
"nodeId": "pluginInput",
|
|
||||||
"name": "workflow:template.plugin_start",
|
|
||||||
"intro": "workflow:intro_plugin_input",
|
|
||||||
"avatar": "core/workflow/template/workflowStart",
|
|
||||||
"flowNodeType": "pluginInput",
|
|
||||||
"showStatus": false,
|
|
||||||
"position": {
|
|
||||||
"x": 636.3048409085379,
|
|
||||||
"y": -238.61714728578016
|
|
||||||
},
|
|
||||||
"version": "481",
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"renderTypeList": [
|
|
||||||
"input"
|
|
||||||
],
|
|
||||||
"selectedTypeIndex": 0,
|
|
||||||
"valueType": "string",
|
|
||||||
"canEdit": true,
|
|
||||||
"key": "apiKey",
|
|
||||||
"label": "apiKey",
|
|
||||||
"description": "博查API密钥",
|
|
||||||
"defaultValue": "",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"renderTypeList": [
|
|
||||||
"input",
|
|
||||||
"reference"
|
|
||||||
],
|
|
||||||
"selectedTypeIndex": 0,
|
|
||||||
"valueType": "string",
|
|
||||||
"canEdit": true,
|
|
||||||
"key": "query",
|
|
||||||
"label": "query",
|
|
||||||
"description": "搜索查询词",
|
|
||||||
"defaultValue": "",
|
|
||||||
"required": true,
|
|
||||||
"toolDescription": "搜索查询词"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"renderTypeList": [
|
|
||||||
"input",
|
|
||||||
"reference"
|
|
||||||
],
|
|
||||||
"selectedTypeIndex": 0,
|
|
||||||
"valueType": "string",
|
|
||||||
"canEdit": true,
|
|
||||||
"key": "freshness",
|
|
||||||
"label": "freshness",
|
|
||||||
"description": "搜索指定时间范围内的网页。可填值:oneDay(一天内)、oneWeek(一周内)、oneMonth(一个月内)、oneYear(一年内)、noLimit(不限,默认)、YYYY-MM-DD..YYYY-MM-DD(日期范围)、YYYY-MM-DD(指定日期)",
|
|
||||||
"defaultValue": "noLimit",
|
|
||||||
"required": false,
|
|
||||||
"toolDescription": "搜索时间范围"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"renderTypeList": [
|
|
||||||
"input",
|
|
||||||
"reference"
|
|
||||||
],
|
|
||||||
"selectedTypeIndex": 0,
|
|
||||||
"valueType": "boolean",
|
|
||||||
"canEdit": true,
|
|
||||||
"key": "summary",
|
|
||||||
"label": "summary",
|
|
||||||
"description": "是否显示文本摘要。true显示,false不显示(默认)",
|
|
||||||
"defaultValue": false,
|
|
||||||
"required": false,
|
|
||||||
"toolDescription": "是否显示文本摘要"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"renderTypeList": [
|
|
||||||
"input",
|
|
||||||
"reference"
|
|
||||||
],
|
|
||||||
"selectedTypeIndex": 0,
|
|
||||||
"valueType": "string",
|
|
||||||
"canEdit": true,
|
|
||||||
"key": "include",
|
|
||||||
"label": "include",
|
|
||||||
"description": "指定搜索的site范围。多个域名使用|或,分隔,最多20个。例如:qq.com|m.163.com",
|
|
||||||
"defaultValue": "",
|
|
||||||
"required": false,
|
|
||||||
"toolDescription": "指定搜索的site范围"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"renderTypeList": [
|
|
||||||
"input",
|
|
||||||
"reference"
|
|
||||||
],
|
|
||||||
"selectedTypeIndex": 0,
|
|
||||||
"valueType": "string",
|
|
||||||
"canEdit": true,
|
|
||||||
"key": "exclude",
|
|
||||||
"label": "exclude",
|
|
||||||
"description": "排除搜索的网站范围。多个域名使用|或,分隔,最多20个。例如:qq.com|m.163.com",
|
|
||||||
"defaultValue": "",
|
|
||||||
"required": false,
|
|
||||||
"toolDescription": "排除搜索的网站范围"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"renderTypeList": [
|
|
||||||
"input",
|
|
||||||
"reference"
|
|
||||||
],
|
|
||||||
"selectedTypeIndex": 0,
|
|
||||||
"valueType": "number",
|
|
||||||
"canEdit": true,
|
|
||||||
"key": "count",
|
|
||||||
"label": "count",
|
|
||||||
"description": "返回结果的条数。可填范围:1-50,默认为10",
|
|
||||||
"defaultValue": 10,
|
|
||||||
"required": false,
|
|
||||||
"min": 1,
|
|
||||||
"max": 50,
|
|
||||||
"toolDescription": "返回结果条数"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"id": "apiKey",
|
|
||||||
"valueType": "string",
|
|
||||||
"key": "apiKey",
|
|
||||||
"label": "apiKey",
|
|
||||||
"type": "hidden"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "query",
|
|
||||||
"valueType": "string",
|
|
||||||
"key": "query",
|
|
||||||
"label": "query",
|
|
||||||
"type": "hidden"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "freshness",
|
|
||||||
"valueType": "string",
|
|
||||||
"key": "freshness",
|
|
||||||
"label": "freshness",
|
|
||||||
"type": "hidden"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "summary",
|
|
||||||
"valueType": "boolean",
|
|
||||||
"key": "summary",
|
|
||||||
"label": "summary",
|
|
||||||
"type": "hidden"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "include",
|
|
||||||
"valueType": "string",
|
|
||||||
"key": "include",
|
|
||||||
"label": "include",
|
|
||||||
"type": "hidden"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "exclude",
|
|
||||||
"valueType": "string",
|
|
||||||
"key": "exclude",
|
|
||||||
"label": "exclude",
|
|
||||||
"type": "hidden"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "count",
|
|
||||||
"valueType": "number",
|
|
||||||
"key": "count",
|
|
||||||
"label": "count",
|
|
||||||
"type": "hidden"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nodeId": "pluginOutput",
|
|
||||||
"name": "common:core.module.template.self_output",
|
|
||||||
"intro": "workflow:intro_custom_plugin_output",
|
|
||||||
"avatar": "core/workflow/template/pluginOutput",
|
|
||||||
"flowNodeType": "pluginOutput",
|
|
||||||
"showStatus": false,
|
|
||||||
"position": {
|
|
||||||
"x": 2764.1105686698083,
|
|
||||||
"y": -30.617147285780163
|
|
||||||
},
|
|
||||||
"version": "481",
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"renderTypeList": [
|
|
||||||
"reference"
|
|
||||||
],
|
|
||||||
"valueType": "object",
|
|
||||||
"canEdit": true,
|
|
||||||
"key": "result",
|
|
||||||
"label": "result",
|
|
||||||
"isToolOutput": true,
|
|
||||||
"description": "",
|
|
||||||
"value": [
|
|
||||||
"nyA6oA8mF1iW",
|
|
||||||
"httpRawResponse"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"outputs": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nodeId": "pluginConfig",
|
|
||||||
"name": "common:core.module.template.system_config",
|
|
||||||
"intro": "",
|
|
||||||
"avatar": "core/workflow/template/systemConfig",
|
|
||||||
"flowNodeType": "pluginConfig",
|
|
||||||
"position": {
|
|
||||||
"x": 184.66337662472682,
|
|
||||||
"y": -216.05298493910115
|
|
||||||
},
|
|
||||||
"version": "4811",
|
|
||||||
"inputs": [],
|
|
||||||
"outputs": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nodeId": "nyA6oA8mF1iW",
|
|
||||||
"name": "HTTP 请求",
|
|
||||||
"intro": "调用博查搜索API",
|
|
||||||
"avatar": "core/workflow/template/httpRequest",
|
|
||||||
"flowNodeType": "httpRequest468",
|
|
||||||
"showStatus": true,
|
|
||||||
"position": {
|
|
||||||
"x": 1335.0647252518884,
|
|
||||||
"y": -455.9043948565971
|
|
||||||
},
|
|
||||||
"version": "481",
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"key": "system_addInputParam",
|
|
||||||
"renderTypeList": [
|
|
||||||
"addInputParam"
|
|
||||||
],
|
|
||||||
"valueType": "dynamic",
|
|
||||||
"label": "",
|
|
||||||
"required": false,
|
|
||||||
"description": "common:core.module.input.description.HTTP Dynamic Input",
|
|
||||||
"customInputConfig": {
|
|
||||||
"selectValueTypeList": [
|
|
||||||
"string",
|
|
||||||
"number",
|
|
||||||
"boolean",
|
|
||||||
"object",
|
|
||||||
"arrayString",
|
|
||||||
"arrayNumber",
|
|
||||||
"arrayBoolean",
|
|
||||||
"arrayObject",
|
|
||||||
"arrayAny",
|
|
||||||
"any",
|
|
||||||
"chatHistory",
|
|
||||||
"datasetQuote",
|
|
||||||
"dynamic",
|
|
||||||
"selectDataset",
|
|
||||||
"selectApp"
|
|
||||||
],
|
|
||||||
"showDescription": false,
|
|
||||||
"showDefaultValue": true
|
|
||||||
},
|
|
||||||
"debugLabel": "",
|
|
||||||
"toolDescription": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system_httpMethod",
|
|
||||||
"renderTypeList": [
|
|
||||||
"custom"
|
|
||||||
],
|
|
||||||
"valueType": "string",
|
|
||||||
"label": "",
|
|
||||||
"value": "POST",
|
|
||||||
"required": true,
|
|
||||||
"debugLabel": "",
|
|
||||||
"toolDescription": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system_httpTimeout",
|
|
||||||
"renderTypeList": [
|
|
||||||
"custom"
|
|
||||||
],
|
|
||||||
"valueType": "number",
|
|
||||||
"label": "",
|
|
||||||
"value": 30,
|
|
||||||
"min": 5,
|
|
||||||
"max": 600,
|
|
||||||
"required": true,
|
|
||||||
"debugLabel": "",
|
|
||||||
"toolDescription": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system_httpReqUrl",
|
|
||||||
"renderTypeList": [
|
|
||||||
"hidden"
|
|
||||||
],
|
|
||||||
"valueType": "string",
|
|
||||||
"label": "",
|
|
||||||
"description": "common:core.module.input.description.Http Request Url",
|
|
||||||
"placeholder": "https://api.ai.com/getInventory",
|
|
||||||
"required": false,
|
|
||||||
"value": "https://api.bochaai.com/v1/web-search",
|
|
||||||
"debugLabel": "",
|
|
||||||
"toolDescription": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system_httpHeader",
|
|
||||||
"renderTypeList": [
|
|
||||||
"custom"
|
|
||||||
],
|
|
||||||
"valueType": "any",
|
|
||||||
"value": [
|
|
||||||
{
|
|
||||||
"key": "Authorization",
|
|
||||||
"type": "string",
|
|
||||||
"value": "Bearer {{$pluginInput.apiKey$}}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "Content-Type",
|
|
||||||
"type": "string",
|
|
||||||
"value": "application/json"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"label": "",
|
|
||||||
"description": "common:core.module.input.description.Http Request Header",
|
|
||||||
"placeholder": "common:core.module.input.description.Http Request Header",
|
|
||||||
"required": false,
|
|
||||||
"debugLabel": "",
|
|
||||||
"toolDescription": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system_httpParams",
|
|
||||||
"renderTypeList": [
|
|
||||||
"hidden"
|
|
||||||
],
|
|
||||||
"valueType": "any",
|
|
||||||
"value": [],
|
|
||||||
"label": "",
|
|
||||||
"required": false,
|
|
||||||
"debugLabel": "",
|
|
||||||
"toolDescription": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system_httpJsonBody",
|
|
||||||
"renderTypeList": [
|
|
||||||
"hidden"
|
|
||||||
],
|
|
||||||
"valueType": "any",
|
|
||||||
"value": "{\n \"query\": \"{{query}}\",\n \"freshness\": \"{{freshness}}\",\n \"summary\": {{summary}},\n \"include\": \"{{include}}\",\n \"exclude\": \"{{exclude}}\",\n \"count\": {{count}}\n}",
|
|
||||||
"label": "",
|
|
||||||
"required": false,
|
|
||||||
"debugLabel": "",
|
|
||||||
"toolDescription": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system_httpFormBody",
|
|
||||||
"renderTypeList": [
|
|
||||||
"hidden"
|
|
||||||
],
|
|
||||||
"valueType": "any",
|
|
||||||
"value": [],
|
|
||||||
"label": "",
|
|
||||||
"required": false,
|
|
||||||
"debugLabel": "",
|
|
||||||
"toolDescription": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system_httpContentType",
|
|
||||||
"renderTypeList": [
|
|
||||||
"hidden"
|
|
||||||
],
|
|
||||||
"valueType": "string",
|
|
||||||
"value": "json",
|
|
||||||
"label": "",
|
|
||||||
"required": false,
|
|
||||||
"debugLabel": "",
|
|
||||||
"toolDescription": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"valueType": "string",
|
|
||||||
"renderTypeList": [
|
|
||||||
"reference"
|
|
||||||
],
|
|
||||||
"key": "query",
|
|
||||||
"label": "query",
|
|
||||||
"toolDescription": "博查搜索检索词",
|
|
||||||
"required": true,
|
|
||||||
"canEdit": true,
|
|
||||||
"editField": {
|
|
||||||
"key": true,
|
|
||||||
"description": true
|
|
||||||
},
|
|
||||||
"customInputConfig": {
|
|
||||||
"selectValueTypeList": [
|
|
||||||
"string",
|
|
||||||
"number",
|
|
||||||
"boolean",
|
|
||||||
"object",
|
|
||||||
"arrayString",
|
|
||||||
"arrayNumber",
|
|
||||||
"arrayBoolean",
|
|
||||||
"arrayObject",
|
|
||||||
"arrayAny",
|
|
||||||
"any",
|
|
||||||
"chatHistory",
|
|
||||||
"datasetQuote",
|
|
||||||
"dynamic",
|
|
||||||
"selectApp",
|
|
||||||
"selectDataset"
|
|
||||||
],
|
|
||||||
"showDescription": false,
|
|
||||||
"showDefaultValue": true
|
|
||||||
},
|
|
||||||
"value": [
|
|
||||||
"pluginInput",
|
|
||||||
"query"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"valueType": "string",
|
|
||||||
"renderTypeList": [
|
|
||||||
"reference"
|
|
||||||
],
|
|
||||||
"key": "freshness",
|
|
||||||
"label": "freshness",
|
|
||||||
"toolDescription": "搜索时间范围",
|
|
||||||
"required": false,
|
|
||||||
"canEdit": true,
|
|
||||||
"editField": {
|
|
||||||
"key": true,
|
|
||||||
"description": true
|
|
||||||
},
|
|
||||||
"customInputConfig": {
|
|
||||||
"selectValueTypeList": [
|
|
||||||
"string",
|
|
||||||
"number",
|
|
||||||
"boolean",
|
|
||||||
"object",
|
|
||||||
"arrayString",
|
|
||||||
"arrayNumber",
|
|
||||||
"arrayBoolean",
|
|
||||||
"arrayObject",
|
|
||||||
"arrayAny",
|
|
||||||
"any",
|
|
||||||
"chatHistory",
|
|
||||||
"datasetQuote",
|
|
||||||
"dynamic",
|
|
||||||
"selectApp",
|
|
||||||
"selectDataset"
|
|
||||||
],
|
|
||||||
"showDescription": false,
|
|
||||||
"showDefaultValue": true
|
|
||||||
},
|
|
||||||
"value": [
|
|
||||||
"pluginInput",
|
|
||||||
"freshness"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"valueType": "boolean",
|
|
||||||
"renderTypeList": [
|
|
||||||
"reference"
|
|
||||||
],
|
|
||||||
"key": "summary",
|
|
||||||
"label": "summary",
|
|
||||||
"toolDescription": "是否显示文本摘要",
|
|
||||||
"required": false,
|
|
||||||
"canEdit": true,
|
|
||||||
"editField": {
|
|
||||||
"key": true,
|
|
||||||
"description": true
|
|
||||||
},
|
|
||||||
"customInputConfig": {
|
|
||||||
"selectValueTypeList": [
|
|
||||||
"string",
|
|
||||||
"number",
|
|
||||||
"boolean",
|
|
||||||
"object",
|
|
||||||
"arrayString",
|
|
||||||
"arrayNumber",
|
|
||||||
"arrayBoolean",
|
|
||||||
"arrayObject",
|
|
||||||
"arrayAny",
|
|
||||||
"any",
|
|
||||||
"chatHistory",
|
|
||||||
"datasetQuote",
|
|
||||||
"dynamic",
|
|
||||||
"selectApp",
|
|
||||||
"selectDataset"
|
|
||||||
],
|
|
||||||
"showDescription": false,
|
|
||||||
"showDefaultValue": true
|
|
||||||
},
|
|
||||||
"value": [
|
|
||||||
"pluginInput",
|
|
||||||
"summary"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"valueType": "string",
|
|
||||||
"renderTypeList": [
|
|
||||||
"reference"
|
|
||||||
],
|
|
||||||
"key": "include",
|
|
||||||
"label": "include",
|
|
||||||
"toolDescription": "指定搜索的site范围",
|
|
||||||
"required": false,
|
|
||||||
"canEdit": true,
|
|
||||||
"editField": {
|
|
||||||
"key": true,
|
|
||||||
"description": true
|
|
||||||
},
|
|
||||||
"customInputConfig": {
|
|
||||||
"selectValueTypeList": [
|
|
||||||
"string",
|
|
||||||
"number",
|
|
||||||
"boolean",
|
|
||||||
"object",
|
|
||||||
"arrayString",
|
|
||||||
"arrayNumber",
|
|
||||||
"arrayBoolean",
|
|
||||||
"arrayObject",
|
|
||||||
"arrayAny",
|
|
||||||
"any",
|
|
||||||
"chatHistory",
|
|
||||||
"datasetQuote",
|
|
||||||
"dynamic",
|
|
||||||
"selectApp",
|
|
||||||
"selectDataset"
|
|
||||||
],
|
|
||||||
"showDescription": false,
|
|
||||||
"showDefaultValue": true
|
|
||||||
},
|
|
||||||
"value": [
|
|
||||||
"pluginInput",
|
|
||||||
"include"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"valueType": "string",
|
|
||||||
"renderTypeList": [
|
|
||||||
"reference"
|
|
||||||
],
|
|
||||||
"key": "exclude",
|
|
||||||
"label": "exclude",
|
|
||||||
"toolDescription": "排除搜索的网站范围",
|
|
||||||
"required": false,
|
|
||||||
"canEdit": true,
|
|
||||||
"editField": {
|
|
||||||
"key": true,
|
|
||||||
"description": true
|
|
||||||
},
|
|
||||||
"customInputConfig": {
|
|
||||||
"selectValueTypeList": [
|
|
||||||
"string",
|
|
||||||
"number",
|
|
||||||
"boolean",
|
|
||||||
"object",
|
|
||||||
"arrayString",
|
|
||||||
"arrayNumber",
|
|
||||||
"arrayBoolean",
|
|
||||||
"arrayObject",
|
|
||||||
"arrayAny",
|
|
||||||
"any",
|
|
||||||
"chatHistory",
|
|
||||||
"datasetQuote",
|
|
||||||
"dynamic",
|
|
||||||
"selectApp",
|
|
||||||
"selectDataset"
|
|
||||||
],
|
|
||||||
"showDescription": false,
|
|
||||||
"showDefaultValue": true
|
|
||||||
},
|
|
||||||
"value": [
|
|
||||||
"pluginInput",
|
|
||||||
"exclude"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"valueType": "number",
|
|
||||||
"renderTypeList": [
|
|
||||||
"reference"
|
|
||||||
],
|
|
||||||
"key": "count",
|
|
||||||
"label": "count",
|
|
||||||
"toolDescription": "返回结果条数",
|
|
||||||
"required": false,
|
|
||||||
"canEdit": true,
|
|
||||||
"editField": {
|
|
||||||
"key": true,
|
|
||||||
"description": true
|
|
||||||
},
|
|
||||||
"customInputConfig": {
|
|
||||||
"selectValueTypeList": [
|
|
||||||
"string",
|
|
||||||
"number",
|
|
||||||
"boolean",
|
|
||||||
"object",
|
|
||||||
"arrayString",
|
|
||||||
"arrayNumber",
|
|
||||||
"arrayBoolean",
|
|
||||||
"arrayObject",
|
|
||||||
"arrayAny",
|
|
||||||
"any",
|
|
||||||
"chatHistory",
|
|
||||||
"datasetQuote",
|
|
||||||
"dynamic",
|
|
||||||
"selectApp",
|
|
||||||
"selectDataset"
|
|
||||||
],
|
|
||||||
"showDescription": false,
|
|
||||||
"showDefaultValue": true
|
|
||||||
},
|
|
||||||
"value": [
|
|
||||||
"pluginInput",
|
|
||||||
"count"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"id": "error",
|
|
||||||
"key": "error",
|
|
||||||
"label": "workflow:request_error",
|
|
||||||
"description": "HTTP请求错误信息,成功时返回空",
|
|
||||||
"valueType": "object",
|
|
||||||
"type": "static"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "httpRawResponse",
|
|
||||||
"key": "httpRawResponse",
|
|
||||||
"required": true,
|
|
||||||
"label": "workflow:raw_response",
|
|
||||||
"description": "HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。",
|
|
||||||
"valueType": "any",
|
|
||||||
"type": "static"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "system_addOutputParam",
|
|
||||||
"key": "system_addOutputParam",
|
|
||||||
"type": "dynamic",
|
|
||||||
"valueType": "dynamic",
|
|
||||||
"label": "",
|
|
||||||
"editField": {
|
|
||||||
"key": true,
|
|
||||||
"valueType": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"edges": [
|
|
||||||
{
|
|
||||||
"source": "pluginInput",
|
|
||||||
"target": "nyA6oA8mF1iW",
|
|
||||||
"sourceHandle": "pluginInput-source-right",
|
|
||||||
"targetHandle": "nyA6oA8mF1iW-target-left"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"source": "nyA6oA8mF1iW",
|
|
||||||
"target": "pluginOutput",
|
|
||||||
"sourceHandle": "nyA6oA8mF1iW-source-right",
|
|
||||||
"targetHandle": "pluginOutput-target-left"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"chatConfig": {}
|
|
||||||
}
|
|
||||||
@ -1,178 +0,0 @@
|
|||||||
import { retryFn } from '@fastgpt/global/common/system/utils';
|
|
||||||
import { connectionMongo } from '../../mongo';
|
|
||||||
import { MongoRawTextBufferSchema, bucketName } from './schema';
|
|
||||||
import { addLog } from '../../system/log';
|
|
||||||
import { setCron } from '../../system/cron';
|
|
||||||
import { checkTimerLock } from '../../system/timerLock/utils';
|
|
||||||
import { TimerIdEnum } from '../../system/timerLock/constants';
|
|
||||||
|
|
||||||
const getGridBucket = () => {
|
|
||||||
return new connectionMongo.mongo.GridFSBucket(connectionMongo.connection.db!, {
|
|
||||||
bucketName: bucketName
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const addRawTextBuffer = async ({
|
|
||||||
sourceId,
|
|
||||||
sourceName,
|
|
||||||
text,
|
|
||||||
expiredTime
|
|
||||||
}: {
|
|
||||||
sourceId: string;
|
|
||||||
sourceName: string;
|
|
||||||
text: string;
|
|
||||||
expiredTime: Date;
|
|
||||||
}) => {
|
|
||||||
const gridBucket = getGridBucket();
|
|
||||||
const metadata = {
|
|
||||||
sourceId,
|
|
||||||
sourceName,
|
|
||||||
expiredTime
|
|
||||||
};
|
|
||||||
|
|
||||||
const buffer = Buffer.from(text);
|
|
||||||
|
|
||||||
const fileSize = buffer.length;
|
|
||||||
// 单块大小:尽可能大,但不超过 14MB,不小于128KB
|
|
||||||
const chunkSizeBytes = (() => {
|
|
||||||
// 计算理想块大小:文件大小 ÷ 目标块数(10)。 并且每个块需要小于 14MB
|
|
||||||
const idealChunkSize = Math.min(Math.ceil(fileSize / 10), 14 * 1024 * 1024);
|
|
||||||
|
|
||||||
// 确保块大小至少为128KB
|
|
||||||
const minChunkSize = 128 * 1024; // 128KB
|
|
||||||
|
|
||||||
// 取理想块大小和最小块大小中的较大值
|
|
||||||
let chunkSize = Math.max(idealChunkSize, minChunkSize);
|
|
||||||
|
|
||||||
// 将块大小向上取整到最接近的64KB的倍数,使其更整齐
|
|
||||||
chunkSize = Math.ceil(chunkSize / (64 * 1024)) * (64 * 1024);
|
|
||||||
|
|
||||||
return chunkSize;
|
|
||||||
})();
|
|
||||||
|
|
||||||
const uploadStream = gridBucket.openUploadStream(sourceId, {
|
|
||||||
metadata,
|
|
||||||
chunkSizeBytes
|
|
||||||
});
|
|
||||||
|
|
||||||
return retryFn(async () => {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
uploadStream.end(buffer);
|
|
||||||
uploadStream.on('finish', () => {
|
|
||||||
resolve(uploadStream.id);
|
|
||||||
});
|
|
||||||
uploadStream.on('error', (error) => {
|
|
||||||
addLog.error('addRawTextBuffer error', error);
|
|
||||||
resolve('');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const getRawTextBuffer = async (sourceId: string) => {
|
|
||||||
const gridBucket = getGridBucket();
|
|
||||||
|
|
||||||
return retryFn(async () => {
|
|
||||||
const bufferData = await MongoRawTextBufferSchema.findOne(
|
|
||||||
{
|
|
||||||
'metadata.sourceId': sourceId
|
|
||||||
},
|
|
||||||
'_id metadata'
|
|
||||||
).lean();
|
|
||||||
if (!bufferData) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Read file content
|
|
||||||
const downloadStream = gridBucket.openDownloadStream(bufferData._id);
|
|
||||||
const chunks: Buffer[] = [];
|
|
||||||
|
|
||||||
return new Promise<{
|
|
||||||
text: string;
|
|
||||||
sourceName: string;
|
|
||||||
} | null>((resolve, reject) => {
|
|
||||||
downloadStream.on('data', (chunk) => {
|
|
||||||
chunks.push(chunk);
|
|
||||||
});
|
|
||||||
|
|
||||||
downloadStream.on('end', () => {
|
|
||||||
const buffer = Buffer.concat(chunks);
|
|
||||||
const text = buffer.toString('utf8');
|
|
||||||
resolve({
|
|
||||||
text,
|
|
||||||
sourceName: bufferData.metadata?.sourceName || ''
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
downloadStream.on('error', (error) => {
|
|
||||||
addLog.error('getRawTextBuffer error', error);
|
|
||||||
resolve(null);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const deleteRawTextBuffer = async (sourceId: string): Promise<boolean> => {
|
|
||||||
const gridBucket = getGridBucket();
|
|
||||||
|
|
||||||
return retryFn(async () => {
|
|
||||||
const buffer = await MongoRawTextBufferSchema.findOne({ 'metadata.sourceId': sourceId });
|
|
||||||
if (!buffer) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
await gridBucket.delete(buffer._id);
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const updateRawTextBufferExpiredTime = async ({
|
|
||||||
sourceId,
|
|
||||||
expiredTime
|
|
||||||
}: {
|
|
||||||
sourceId: string;
|
|
||||||
expiredTime: Date;
|
|
||||||
}) => {
|
|
||||||
return retryFn(async () => {
|
|
||||||
return MongoRawTextBufferSchema.updateOne(
|
|
||||||
{ 'metadata.sourceId': sourceId },
|
|
||||||
{ $set: { 'metadata.expiredTime': expiredTime } }
|
|
||||||
);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const clearExpiredRawTextBufferCron = async () => {
|
|
||||||
const clearExpiredRawTextBuffer = async () => {
|
|
||||||
addLog.debug('Clear expired raw text buffer start');
|
|
||||||
const gridBucket = getGridBucket();
|
|
||||||
|
|
||||||
return retryFn(async () => {
|
|
||||||
const data = await MongoRawTextBufferSchema.find(
|
|
||||||
{
|
|
||||||
'metadata.expiredTime': { $lt: new Date() }
|
|
||||||
},
|
|
||||||
'_id'
|
|
||||||
).lean();
|
|
||||||
|
|
||||||
for (const item of data) {
|
|
||||||
await gridBucket.delete(item._id);
|
|
||||||
}
|
|
||||||
addLog.debug('Clear expired raw text buffer end');
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
setCron('*/10 * * * *', async () => {
|
|
||||||
if (
|
|
||||||
await checkTimerLock({
|
|
||||||
timerId: TimerIdEnum.clearExpiredRawTextBuffer,
|
|
||||||
lockMinuted: 9
|
|
||||||
})
|
|
||||||
) {
|
|
||||||
try {
|
|
||||||
await clearExpiredRawTextBuffer();
|
|
||||||
} catch (error) {
|
|
||||||
addLog.error('clearExpiredRawTextBufferCron error', error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@ -1,22 +1,33 @@
|
|||||||
import { getMongoModel, type Types, Schema } from '../../mongo';
|
import { getMongoModel, Schema } from '../../mongo';
|
||||||
|
import { type RawTextBufferSchemaType } from './type';
|
||||||
|
|
||||||
export const bucketName = 'buffer_rawtext';
|
export const collectionName = 'buffer_rawtexts';
|
||||||
|
|
||||||
const RawTextBufferSchema = new Schema({
|
const RawTextBufferSchema = new Schema({
|
||||||
metadata: {
|
sourceId: {
|
||||||
sourceId: { type: String, required: true },
|
type: String,
|
||||||
sourceName: { type: String, required: true },
|
required: true
|
||||||
expiredTime: { type: Date, required: true }
|
},
|
||||||
}
|
rawText: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
createTime: {
|
||||||
|
type: Date,
|
||||||
|
default: () => new Date()
|
||||||
|
},
|
||||||
|
metadata: Object
|
||||||
});
|
});
|
||||||
RawTextBufferSchema.index({ 'metadata.sourceId': 'hashed' });
|
|
||||||
RawTextBufferSchema.index({ 'metadata.expiredTime': -1 });
|
|
||||||
|
|
||||||
export const MongoRawTextBufferSchema = getMongoModel<{
|
try {
|
||||||
_id: Types.ObjectId;
|
RawTextBufferSchema.index({ sourceId: 1 });
|
||||||
metadata: {
|
// 20 minutes
|
||||||
sourceId: string;
|
RawTextBufferSchema.index({ createTime: 1 }, { expireAfterSeconds: 20 * 60 });
|
||||||
sourceName: string;
|
} catch (error) {
|
||||||
expiredTime: Date;
|
console.log(error);
|
||||||
};
|
}
|
||||||
}>(`${bucketName}.files`, RawTextBufferSchema);
|
|
||||||
|
export const MongoRawTextBuffer = getMongoModel<RawTextBufferSchemaType>(
|
||||||
|
collectionName,
|
||||||
|
RawTextBufferSchema
|
||||||
|
);
|
||||||
|
|||||||
8
packages/service/common/buffer/rawText/type.d.ts
vendored
Normal file
8
packages/service/common/buffer/rawText/type.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
export type RawTextBufferSchemaType = {
|
||||||
|
sourceId: string;
|
||||||
|
rawText: string;
|
||||||
|
createTime: Date;
|
||||||
|
metadata?: {
|
||||||
|
filename: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
@ -6,13 +6,13 @@ import { type DatasetFileSchema } from '@fastgpt/global/core/dataset/type';
|
|||||||
import { MongoChatFileSchema, MongoDatasetFileSchema } from './schema';
|
import { MongoChatFileSchema, MongoDatasetFileSchema } from './schema';
|
||||||
import { detectFileEncoding, detectFileEncodingByPath } from '@fastgpt/global/common/file/tools';
|
import { detectFileEncoding, detectFileEncodingByPath } from '@fastgpt/global/common/file/tools';
|
||||||
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
|
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
|
||||||
|
import { MongoRawTextBuffer } from '../../buffer/rawText/schema';
|
||||||
import { readRawContentByFileBuffer } from '../read/utils';
|
import { readRawContentByFileBuffer } from '../read/utils';
|
||||||
import { gridFsStream2Buffer, stream2Encoding } from './utils';
|
import { gridFsStream2Buffer, stream2Encoding } from './utils';
|
||||||
import { addLog } from '../../system/log';
|
import { addLog } from '../../system/log';
|
||||||
|
import { readFromSecondary } from '../../mongo/utils';
|
||||||
import { parseFileExtensionFromUrl } from '@fastgpt/global/common/string/tools';
|
import { parseFileExtensionFromUrl } from '@fastgpt/global/common/string/tools';
|
||||||
import { Readable } from 'stream';
|
import { Readable } from 'stream';
|
||||||
import { addRawTextBuffer, getRawTextBuffer } from '../../buffer/rawText/controller';
|
|
||||||
import { addMinutes } from 'date-fns';
|
|
||||||
|
|
||||||
export function getGFSCollection(bucket: `${BucketNameEnum}`) {
|
export function getGFSCollection(bucket: `${BucketNameEnum}`) {
|
||||||
MongoDatasetFileSchema;
|
MongoDatasetFileSchema;
|
||||||
@ -223,13 +223,15 @@ export const readFileContentFromMongo = async ({
|
|||||||
rawText: string;
|
rawText: string;
|
||||||
filename: string;
|
filename: string;
|
||||||
}> => {
|
}> => {
|
||||||
const bufferId = `${String(fileId)}-${customPdfParse}`;
|
const bufferId = `${fileId}-${customPdfParse}`;
|
||||||
// read buffer
|
// read buffer
|
||||||
const fileBuffer = await getRawTextBuffer(bufferId);
|
const fileBuffer = await MongoRawTextBuffer.findOne({ sourceId: bufferId }, undefined, {
|
||||||
|
...readFromSecondary
|
||||||
|
}).lean();
|
||||||
if (fileBuffer) {
|
if (fileBuffer) {
|
||||||
return {
|
return {
|
||||||
rawText: fileBuffer.text,
|
rawText: fileBuffer.rawText,
|
||||||
filename: fileBuffer?.sourceName
|
filename: fileBuffer.metadata?.filename || ''
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,13 +265,16 @@ export const readFileContentFromMongo = async ({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add buffer
|
// < 14M
|
||||||
addRawTextBuffer({
|
if (fileBuffers.length < 14 * 1024 * 1024 && rawText.trim()) {
|
||||||
sourceId: bufferId,
|
MongoRawTextBuffer.create({
|
||||||
sourceName: file.filename,
|
sourceId: bufferId,
|
||||||
text: rawText,
|
rawText,
|
||||||
expiredTime: addMinutes(new Date(), 20)
|
metadata: {
|
||||||
});
|
filename: file.filename
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
rawText,
|
rawText,
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
import { Schema, getMongoModel } from '../../mongo';
|
import { Schema, getMongoModel } from '../../mongo';
|
||||||
|
|
||||||
const DatasetFileSchema = new Schema({
|
const DatasetFileSchema = new Schema({});
|
||||||
metadata: Object
|
const ChatFileSchema = new Schema({});
|
||||||
});
|
|
||||||
const ChatFileSchema = new Schema({
|
|
||||||
metadata: Object
|
|
||||||
});
|
|
||||||
|
|
||||||
DatasetFileSchema.index({ uploadDate: -1 });
|
try {
|
||||||
|
DatasetFileSchema.index({ uploadDate: -1 });
|
||||||
|
|
||||||
ChatFileSchema.index({ uploadDate: -1 });
|
ChatFileSchema.index({ uploadDate: -1 });
|
||||||
ChatFileSchema.index({ 'metadata.chatId': 1 });
|
ChatFileSchema.index({ 'metadata.chatId': 1 });
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
|
||||||
export const MongoDatasetFileSchema = getMongoModel('dataset.files', DatasetFileSchema);
|
export const MongoDatasetFileSchema = getMongoModel('dataset.files', DatasetFileSchema);
|
||||||
export const MongoChatFileSchema = getMongoModel('chat.files', ChatFileSchema);
|
export const MongoChatFileSchema = getMongoModel('chat.files', ChatFileSchema);
|
||||||
|
|||||||
@ -1,57 +1,5 @@
|
|||||||
import { detectFileEncoding } from '@fastgpt/global/common/file/tools';
|
import { detectFileEncoding } from '@fastgpt/global/common/file/tools';
|
||||||
import { PassThrough } from 'stream';
|
import { PassThrough } from 'stream';
|
||||||
import { getGridBucket } from './controller';
|
|
||||||
import { type BucketNameEnum } from '@fastgpt/global/common/file/constants';
|
|
||||||
import { retryFn } from '@fastgpt/global/common/system/utils';
|
|
||||||
|
|
||||||
export const createFileFromText = async ({
|
|
||||||
bucket,
|
|
||||||
filename,
|
|
||||||
text,
|
|
||||||
metadata
|
|
||||||
}: {
|
|
||||||
bucket: `${BucketNameEnum}`;
|
|
||||||
filename: string;
|
|
||||||
text: string;
|
|
||||||
metadata: Record<string, any>;
|
|
||||||
}) => {
|
|
||||||
const gridBucket = getGridBucket(bucket);
|
|
||||||
|
|
||||||
const buffer = Buffer.from(text);
|
|
||||||
|
|
||||||
const fileSize = buffer.length;
|
|
||||||
// 单块大小:尽可能大,但不超过 14MB,不小于128KB
|
|
||||||
const chunkSizeBytes = (() => {
|
|
||||||
// 计算理想块大小:文件大小 ÷ 目标块数(10)。 并且每个块需要小于 14MB
|
|
||||||
const idealChunkSize = Math.min(Math.ceil(fileSize / 10), 14 * 1024 * 1024);
|
|
||||||
|
|
||||||
// 确保块大小至少为128KB
|
|
||||||
const minChunkSize = 128 * 1024; // 128KB
|
|
||||||
|
|
||||||
// 取理想块大小和最小块大小中的较大值
|
|
||||||
let chunkSize = Math.max(idealChunkSize, minChunkSize);
|
|
||||||
|
|
||||||
// 将块大小向上取整到最接近的64KB的倍数,使其更整齐
|
|
||||||
chunkSize = Math.ceil(chunkSize / (64 * 1024)) * (64 * 1024);
|
|
||||||
|
|
||||||
return chunkSize;
|
|
||||||
})();
|
|
||||||
|
|
||||||
const uploadStream = gridBucket.openUploadStream(filename, {
|
|
||||||
metadata,
|
|
||||||
chunkSizeBytes
|
|
||||||
});
|
|
||||||
|
|
||||||
return retryFn(async () => {
|
|
||||||
return new Promise<{ fileId: string }>((resolve, reject) => {
|
|
||||||
uploadStream.end(buffer);
|
|
||||||
uploadStream.on('finish', () => {
|
|
||||||
resolve({ fileId: String(uploadStream.id) });
|
|
||||||
});
|
|
||||||
uploadStream.on('error', reject);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const gridFsStream2Buffer = (stream: NodeJS.ReadableStream) => {
|
export const gridFsStream2Buffer = (stream: NodeJS.ReadableStream) => {
|
||||||
return new Promise<Buffer>((resolve, reject) => {
|
return new Promise<Buffer>((resolve, reject) => {
|
||||||
|
|||||||
@ -110,7 +110,7 @@ export const readRawContentByFileBuffer = async ({
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
rawText: text,
|
rawText: text,
|
||||||
formatText: text,
|
formatText: rawText,
|
||||||
imageList
|
imageList
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -5,8 +5,7 @@ export enum TimerIdEnum {
|
|||||||
clearExpiredSubPlan = 'clearExpiredSubPlan',
|
clearExpiredSubPlan = 'clearExpiredSubPlan',
|
||||||
updateStandardPlan = 'updateStandardPlan',
|
updateStandardPlan = 'updateStandardPlan',
|
||||||
scheduleTriggerApp = 'scheduleTriggerApp',
|
scheduleTriggerApp = 'scheduleTriggerApp',
|
||||||
notification = 'notification',
|
notification = 'notification'
|
||||||
clearExpiredRawTextBuffer = 'clearExpiredRawTextBuffer'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum LockNotificationEnum {
|
export enum LockNotificationEnum {
|
||||||
|
|||||||
@ -3,5 +3,6 @@ export const DatasetVectorTableName = 'modeldata';
|
|||||||
|
|
||||||
export const PG_ADDRESS = process.env.PG_URL;
|
export const PG_ADDRESS = process.env.PG_URL;
|
||||||
export const OCEANBASE_ADDRESS = process.env.OCEANBASE_URL;
|
export const OCEANBASE_ADDRESS = process.env.OCEANBASE_URL;
|
||||||
|
export const OPENGAUSS_ADDRESS = process.env.OPENGAUSS_URL;
|
||||||
export const MILVUS_ADDRESS = process.env.MILVUS_ADDRESS;
|
export const MILVUS_ADDRESS = process.env.MILVUS_ADDRESS;
|
||||||
export const MILVUS_TOKEN = process.env.MILVUS_TOKEN;
|
export const MILVUS_TOKEN = process.env.MILVUS_TOKEN;
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
/* vector crud */
|
/* vector crud */
|
||||||
import { PgVectorCtrl } from './pg';
|
import { PgVectorCtrl } from './pg';
|
||||||
import { ObVectorCtrl } from './oceanbase';
|
import { ObVectorCtrl } from './oceanbase';
|
||||||
|
import { GsVectorCtrl } from './opengauss';
|
||||||
import { getVectorsByText } from '../../core/ai/embedding';
|
import { getVectorsByText } from '../../core/ai/embedding';
|
||||||
import { type DelDatasetVectorCtrlProps, type InsertVectorProps } from './controller.d';
|
import { type DelDatasetVectorCtrlProps, type InsertVectorProps } from './controller.d';
|
||||||
import { type EmbeddingModelItemType } from '@fastgpt/global/core/ai/model.d';
|
import { type EmbeddingModelItemType } from '@fastgpt/global/core/ai/model.d';
|
||||||
import { MILVUS_ADDRESS, PG_ADDRESS, OCEANBASE_ADDRESS } from './constants';
|
import { MILVUS_ADDRESS, PG_ADDRESS, OCEANBASE_ADDRESS, OPENGAUSS_ADDRESS } from './constants';
|
||||||
import { MilvusCtrl } from './milvus';
|
import { MilvusCtrl } from './milvus';
|
||||||
import { setRedisCache, getRedisCache, delRedisCache, CacheKeyEnum } from '../redis/cache';
|
import { setRedisCache, getRedisCache, delRedisCache, CacheKeyEnum } from '../redis/cache';
|
||||||
import { throttle } from 'lodash';
|
import { throttle } from 'lodash';
|
||||||
@ -14,6 +15,7 @@ const getVectorObj = () => {
|
|||||||
if (PG_ADDRESS) return new PgVectorCtrl();
|
if (PG_ADDRESS) return new PgVectorCtrl();
|
||||||
if (OCEANBASE_ADDRESS) return new ObVectorCtrl();
|
if (OCEANBASE_ADDRESS) return new ObVectorCtrl();
|
||||||
if (MILVUS_ADDRESS) return new MilvusCtrl();
|
if (MILVUS_ADDRESS) return new MilvusCtrl();
|
||||||
|
if (OPENGAUSS_ADDRESS) return new GsVectorCtrl();
|
||||||
|
|
||||||
return new PgVectorCtrl();
|
return new PgVectorCtrl();
|
||||||
};
|
};
|
||||||
|
|||||||
188
packages/service/common/vectorDB/opengauss/controller.ts
Normal file
188
packages/service/common/vectorDB/opengauss/controller.ts
Normal file
@ -0,0 +1,188 @@
|
|||||||
|
import { delay } from '@fastgpt/global/common/system/utils';
|
||||||
|
import { addLog } from '../../system/log';
|
||||||
|
import { Pool } from 'pg';
|
||||||
|
import type { QueryResultRow } from 'pg';
|
||||||
|
import { OPENGAUSS_ADDRESS } from '../constants';
|
||||||
|
|
||||||
|
export const connectGs = async (): Promise<Pool> => {
|
||||||
|
if (global.gsClient) {
|
||||||
|
return global.gsClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
global.gsClient = new Pool({
|
||||||
|
connectionString: OPENGAUSS_ADDRESS,
|
||||||
|
max: Number(process.env.DB_MAX_LINK || 20),
|
||||||
|
min: 10,
|
||||||
|
keepAlive: true,
|
||||||
|
idleTimeoutMillis: 600000,
|
||||||
|
connectionTimeoutMillis: 20000,
|
||||||
|
query_timeout: 30000,
|
||||||
|
statement_timeout: 40000,
|
||||||
|
idle_in_transaction_session_timeout: 60000
|
||||||
|
});
|
||||||
|
|
||||||
|
global.gsClient.on('error', async (err) => {
|
||||||
|
addLog.error(`openGauss error`, err);
|
||||||
|
global.gsClient?.end();
|
||||||
|
global.gsClient = null;
|
||||||
|
|
||||||
|
await delay(1000);
|
||||||
|
addLog.info(`Retry connect openGauss`);
|
||||||
|
connectGs();
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
await global.gsClient.connect();
|
||||||
|
console.log('openGauss connected');
|
||||||
|
return global.gsClient;
|
||||||
|
} catch (error) {
|
||||||
|
addLog.error(`openGauss connect error`, error);
|
||||||
|
global.gsClient?.end();
|
||||||
|
global.gsClient = null;
|
||||||
|
|
||||||
|
await delay(1000);
|
||||||
|
addLog.info(`Retry connect openGauss`);
|
||||||
|
|
||||||
|
return connectGs();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
type WhereProps = (string | [string, string | number])[];
|
||||||
|
type GetProps = {
|
||||||
|
fields?: string[];
|
||||||
|
where?: WhereProps;
|
||||||
|
order?: { field: string; mode: 'DESC' | 'ASC' | string }[];
|
||||||
|
limit?: number;
|
||||||
|
offset?: number;
|
||||||
|
};
|
||||||
|
|
||||||
|
type DeleteProps = {
|
||||||
|
where: WhereProps;
|
||||||
|
};
|
||||||
|
|
||||||
|
type ValuesProps = { key: string; value?: string | number }[];
|
||||||
|
type UpdateProps = {
|
||||||
|
values: ValuesProps;
|
||||||
|
where: WhereProps;
|
||||||
|
};
|
||||||
|
type InsertProps = {
|
||||||
|
values: ValuesProps[];
|
||||||
|
};
|
||||||
|
|
||||||
|
class GsClass {
|
||||||
|
private getWhereStr(where?: WhereProps) {
|
||||||
|
return where
|
||||||
|
? `WHERE ${where
|
||||||
|
.map((item) => {
|
||||||
|
if (typeof item === 'string') {
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
const val = typeof item[1] === 'number' ? item[1] : `'${String(item[1])}'`;
|
||||||
|
return `${item[0]}=${val}`;
|
||||||
|
})
|
||||||
|
.join(' ')}`
|
||||||
|
: '';
|
||||||
|
}
|
||||||
|
private getUpdateValStr(values: ValuesProps) {
|
||||||
|
return values
|
||||||
|
.map((item) => {
|
||||||
|
const val =
|
||||||
|
typeof item.value === 'number'
|
||||||
|
? item.value
|
||||||
|
: `'${String(item.value).replace(/\'/g, '"')}'`;
|
||||||
|
|
||||||
|
return `${item.key}=${val}`;
|
||||||
|
})
|
||||||
|
.join(',');
|
||||||
|
}
|
||||||
|
private getInsertValStr(values: ValuesProps[]) {
|
||||||
|
return values
|
||||||
|
.map(
|
||||||
|
(items) =>
|
||||||
|
`(${items
|
||||||
|
.map((item) =>
|
||||||
|
typeof item.value === 'number'
|
||||||
|
? item.value
|
||||||
|
: `'${String(item.value).replace(/\'/g, '"')}'`
|
||||||
|
)
|
||||||
|
.join(',')})`
|
||||||
|
)
|
||||||
|
.join(',');
|
||||||
|
}
|
||||||
|
async select<T extends QueryResultRow = any>(table: string, props: GetProps) {
|
||||||
|
const sql = `SELECT ${
|
||||||
|
!props.fields || props.fields?.length === 0 ? '*' : props.fields?.join(',')
|
||||||
|
}
|
||||||
|
FROM ${table}
|
||||||
|
${this.getWhereStr(props.where)}
|
||||||
|
${
|
||||||
|
props.order
|
||||||
|
? `ORDER BY ${props.order.map((item) => `${item.field} ${item.mode}`).join(',')}`
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
LIMIT ${props.limit || 10} OFFSET ${props.offset || 0}
|
||||||
|
`;
|
||||||
|
|
||||||
|
const gs = await connectGs();
|
||||||
|
return gs.query<T>(sql);
|
||||||
|
}
|
||||||
|
async count(table: string, props: GetProps) {
|
||||||
|
const sql = `SELECT COUNT(${props?.fields?.[0] || '*'})
|
||||||
|
FROM ${table}
|
||||||
|
${this.getWhereStr(props.where)}
|
||||||
|
`;
|
||||||
|
|
||||||
|
const gs = await connectGs();
|
||||||
|
return gs.query(sql).then((res) => Number(res.rows[0]?.count || 0));
|
||||||
|
}
|
||||||
|
async delete(table: string, props: DeleteProps) {
|
||||||
|
const sql = `DELETE FROM ${table} ${this.getWhereStr(props.where)}`;
|
||||||
|
const gs = await connectGs();
|
||||||
|
return gs.query(sql);
|
||||||
|
}
|
||||||
|
async update(table: string, props: UpdateProps) {
|
||||||
|
if (props.values.length === 0) {
|
||||||
|
return {
|
||||||
|
rowCount: 0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const sql = `UPDATE ${table} SET ${this.getUpdateValStr(props.values)} ${this.getWhereStr(
|
||||||
|
props.where
|
||||||
|
)}`;
|
||||||
|
const gs = await connectGs();
|
||||||
|
return gs.query(sql);
|
||||||
|
}
|
||||||
|
async insert(table: string, props: InsertProps) {
|
||||||
|
if (props.values.length === 0) {
|
||||||
|
return {
|
||||||
|
rowCount: 0,
|
||||||
|
rows: []
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const fields = props.values[0].map((item) => item.key).join(',');
|
||||||
|
const sql = `INSERT INTO ${table} (${fields}) VALUES ${this.getInsertValStr(
|
||||||
|
props.values
|
||||||
|
)} RETURNING id`;
|
||||||
|
|
||||||
|
const gs = await connectGs();
|
||||||
|
return gs.query<{ id: string }>(sql);
|
||||||
|
}
|
||||||
|
async query<T extends QueryResultRow = any>(sql: string) {
|
||||||
|
const gs = await connectGs();
|
||||||
|
const start = Date.now();
|
||||||
|
return gs.query<T>(sql).then((res) => {
|
||||||
|
const time = Date.now() - start;
|
||||||
|
|
||||||
|
if (time > 300) {
|
||||||
|
addLog.warn(`gs query time: ${time}ms, sql: ${sql}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const GsClient = new GsClass();
|
||||||
|
export const Gs = global.gsClient;
|
||||||
253
packages/service/common/vectorDB/opengauss/index.ts
Normal file
253
packages/service/common/vectorDB/opengauss/index.ts
Normal file
@ -0,0 +1,253 @@
|
|||||||
|
/* pg vector crud */
|
||||||
|
import { DatasetVectorTableName } from '../constants';
|
||||||
|
import { delay } from '@fastgpt/global/common/system/utils';
|
||||||
|
import { GsClient, connectGs } from './controller';
|
||||||
|
import { GsSearchRawType } from '@fastgpt/global/core/dataset/api';
|
||||||
|
import type {
|
||||||
|
DelDatasetVectorCtrlProps,
|
||||||
|
EmbeddingRecallCtrlProps,
|
||||||
|
EmbeddingRecallResponse,
|
||||||
|
InsertVectorControllerProps
|
||||||
|
} from '../controller.d';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
import { addLog } from '../../system/log';
|
||||||
|
|
||||||
|
export class GsVectorCtrl {
|
||||||
|
constructor() {}
|
||||||
|
init = async () => {
|
||||||
|
try {
|
||||||
|
await connectGs();
|
||||||
|
await GsClient.query(`
|
||||||
|
CREATE EXTENSION IF NOT EXISTS vector;
|
||||||
|
CREATE TABLE IF NOT EXISTS ${DatasetVectorTableName} (
|
||||||
|
id BIGSERIAL PRIMARY KEY,
|
||||||
|
vector VECTOR(1536) NOT NULL,
|
||||||
|
team_id VARCHAR(50) NOT NULL,
|
||||||
|
dataset_id VARCHAR(50) NOT NULL,
|
||||||
|
collection_id VARCHAR(50) NOT NULL,
|
||||||
|
createtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
|
`);
|
||||||
|
|
||||||
|
await GsClient.query(
|
||||||
|
`CREATE INDEX CONCURRENTLY IF NOT EXISTS vector_index ON ${DatasetVectorTableName} USING hnsw (vector vector_ip_ops) WITH (m = 32, ef_construction = 128);`
|
||||||
|
);
|
||||||
|
await GsClient.query(
|
||||||
|
`CREATE INDEX CONCURRENTLY IF NOT EXISTS team_dataset_collection_index ON ${DatasetVectorTableName} USING btree(team_id, dataset_id, collection_id);`
|
||||||
|
);
|
||||||
|
await GsClient.query(
|
||||||
|
`CREATE INDEX CONCURRENTLY IF NOT EXISTS create_time_index ON ${DatasetVectorTableName} USING btree(createtime);`
|
||||||
|
);
|
||||||
|
|
||||||
|
addLog.info('init pg successful');
|
||||||
|
} catch (error) {
|
||||||
|
addLog.error('init pg error', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
insert = async (props: InsertVectorControllerProps): Promise<{ insertId: string }> => {
|
||||||
|
const { teamId, datasetId, collectionId, vector, retry = 3 } = props;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const { rowCount, rows } = await GsClient.insert(DatasetVectorTableName, {
|
||||||
|
values: [
|
||||||
|
[
|
||||||
|
{ key: 'vector', value: `[${vector}]` },
|
||||||
|
{ key: 'team_id', value: String(teamId) },
|
||||||
|
{ key: 'dataset_id', value: String(datasetId) },
|
||||||
|
{ key: 'collection_id', value: String(collectionId) }
|
||||||
|
]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
if (rowCount === 0) {
|
||||||
|
return Promise.reject('insertDatasetData: no insert');
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
insertId: rows[0].id
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
if (retry <= 0) {
|
||||||
|
return Promise.reject(error);
|
||||||
|
}
|
||||||
|
await delay(500);
|
||||||
|
return this.insert({
|
||||||
|
...props,
|
||||||
|
retry: retry - 1
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
delete = async (props: DelDatasetVectorCtrlProps): Promise<any> => {
|
||||||
|
const { teamId, retry = 2 } = props;
|
||||||
|
|
||||||
|
const teamIdWhere = `team_id='${String(teamId)}' AND`;
|
||||||
|
|
||||||
|
const where = await (() => {
|
||||||
|
if ('id' in props && props.id) return `${teamIdWhere} id=${props.id}`;
|
||||||
|
|
||||||
|
if ('datasetIds' in props && props.datasetIds) {
|
||||||
|
const datasetIdWhere = `dataset_id IN (${props.datasetIds
|
||||||
|
.map((id) => `'${String(id)}'`)
|
||||||
|
.join(',')})`;
|
||||||
|
|
||||||
|
if ('collectionIds' in props && props.collectionIds) {
|
||||||
|
return `${teamIdWhere} ${datasetIdWhere} AND collection_id IN (${props.collectionIds
|
||||||
|
.map((id) => `'${String(id)}'`)
|
||||||
|
.join(',')})`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return `${teamIdWhere} ${datasetIdWhere}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('idList' in props && Array.isArray(props.idList)) {
|
||||||
|
if (props.idList.length === 0) return;
|
||||||
|
return `${teamIdWhere} id IN (${props.idList.map((id) => String(id)).join(',')})`;
|
||||||
|
}
|
||||||
|
return Promise.reject('deleteDatasetData: no where');
|
||||||
|
})();
|
||||||
|
|
||||||
|
if (!where) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
await GsClient.delete(DatasetVectorTableName, {
|
||||||
|
where: [where]
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
if (retry <= 0) {
|
||||||
|
return Promise.reject(error);
|
||||||
|
}
|
||||||
|
await delay(500);
|
||||||
|
return this.delete({
|
||||||
|
...props,
|
||||||
|
retry: retry - 1
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
embRecall = async (props: EmbeddingRecallCtrlProps): Promise<EmbeddingRecallResponse> => {
|
||||||
|
const {
|
||||||
|
teamId,
|
||||||
|
datasetIds,
|
||||||
|
vector,
|
||||||
|
limit,
|
||||||
|
forbidCollectionIdList,
|
||||||
|
filterCollectionIdList,
|
||||||
|
retry = 2
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
// Get forbid collection
|
||||||
|
const formatForbidCollectionIdList = (() => {
|
||||||
|
if (!filterCollectionIdList) return forbidCollectionIdList;
|
||||||
|
const list = forbidCollectionIdList
|
||||||
|
.map((id) => String(id))
|
||||||
|
.filter((id) => !filterCollectionIdList.includes(id));
|
||||||
|
return list;
|
||||||
|
})();
|
||||||
|
const forbidCollectionSql =
|
||||||
|
formatForbidCollectionIdList.length > 0
|
||||||
|
? `AND collection_id NOT IN (${formatForbidCollectionIdList.map((id) => `'${id}'`).join(',')})`
|
||||||
|
: '';
|
||||||
|
|
||||||
|
// Filter by collectionId
|
||||||
|
const formatFilterCollectionId = (() => {
|
||||||
|
if (!filterCollectionIdList) return;
|
||||||
|
|
||||||
|
return filterCollectionIdList
|
||||||
|
.map((id) => String(id))
|
||||||
|
.filter((id) => !forbidCollectionIdList.includes(id));
|
||||||
|
})();
|
||||||
|
const filterCollectionIdSql = formatFilterCollectionId
|
||||||
|
? `AND collection_id IN (${formatFilterCollectionId.map((id) => `'${id}'`).join(',')})`
|
||||||
|
: '';
|
||||||
|
// Empty data
|
||||||
|
if (formatFilterCollectionId && formatFilterCollectionId.length === 0) {
|
||||||
|
return { results: [] };
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const results: any = await GsClient.query(
|
||||||
|
`BEGIN;
|
||||||
|
SET ob_hnsw_ef_search = ${global.systemEnv?.hnswEfSearch || 100};
|
||||||
|
SELECT id, collection_id, inner_product(vector, [${vector}]) AS score
|
||||||
|
FROM ${DatasetVectorTableName}
|
||||||
|
WHERE team_id='${teamId}'
|
||||||
|
AND dataset_id IN (${datasetIds.map((id) => `'${String(id)}'`).join(',')})
|
||||||
|
${filterCollectionIdSql}
|
||||||
|
${forbidCollectionSql}
|
||||||
|
ORDER BY score desc APPROXIMATE LIMIT ${limit};
|
||||||
|
COMMIT;`
|
||||||
|
);
|
||||||
|
const rows = results?.[3]?.rows as GsSearchRawType[];
|
||||||
|
|
||||||
|
if (!Array.isArray(rows)) {
|
||||||
|
return {
|
||||||
|
results: []
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
results: rows.map((item) => ({
|
||||||
|
id: String(item.id),
|
||||||
|
collectionId: item.collection_id,
|
||||||
|
score: item.score * -1
|
||||||
|
}))
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
if (retry <= 0) {
|
||||||
|
return Promise.reject(error);
|
||||||
|
}
|
||||||
|
return this.embRecall({
|
||||||
|
...props,
|
||||||
|
retry: retry - 1
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
getVectorDataByTime = async (start: Date, end: Date) => {
|
||||||
|
const { rows } = await GsClient.query<{
|
||||||
|
id: string;
|
||||||
|
team_id: string;
|
||||||
|
dataset_id: string;
|
||||||
|
}>(`SELECT id, team_id, dataset_id
|
||||||
|
FROM ${DatasetVectorTableName}
|
||||||
|
WHERE createtime BETWEEN '${dayjs(start).format('YYYY-MM-DD HH:mm:ss')}' AND '${dayjs(
|
||||||
|
end
|
||||||
|
).format('YYYY-MM-DD HH:mm:ss')}';
|
||||||
|
`);
|
||||||
|
|
||||||
|
return rows.map((item) => ({
|
||||||
|
id: String(item.id),
|
||||||
|
teamId: item.team_id,
|
||||||
|
datasetId: item.dataset_id
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
getVectorCountByTeamId = async (teamId: string) => {
|
||||||
|
const total = await GsClient.count(DatasetVectorTableName, {
|
||||||
|
where: [['team_id', String(teamId)]]
|
||||||
|
});
|
||||||
|
|
||||||
|
return total;
|
||||||
|
};
|
||||||
|
getVectorCountByDatasetId = async (teamId: string, datasetId: string) => {
|
||||||
|
const total = await GsClient.count(DatasetVectorTableName, {
|
||||||
|
where: [['team_id', String(teamId)], 'and', ['dataset_id', String(datasetId)]]
|
||||||
|
});
|
||||||
|
|
||||||
|
return total;
|
||||||
|
};
|
||||||
|
getVectorCountByCollectionId = async (
|
||||||
|
teamId: string,
|
||||||
|
datasetId: string,
|
||||||
|
collectionId: string
|
||||||
|
) => {
|
||||||
|
const total = await GsClient.count(DatasetVectorTableName, {
|
||||||
|
where: [
|
||||||
|
['team_id', String(teamId)],
|
||||||
|
'and',
|
||||||
|
['dataset_id', String(datasetId)],
|
||||||
|
'and',
|
||||||
|
['collection_id', String(collectionId)]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
return total;
|
||||||
|
};
|
||||||
|
}
|
||||||
1
packages/service/common/vectorDB/type.d.ts
vendored
1
packages/service/common/vectorDB/type.d.ts
vendored
@ -6,6 +6,7 @@ declare global {
|
|||||||
var pgClient: Pool | null;
|
var pgClient: Pool | null;
|
||||||
var obClient: MysqlPool | null;
|
var obClient: MysqlPool | null;
|
||||||
var milvusClient: MilvusClient | null;
|
var milvusClient: MilvusClient | null;
|
||||||
|
var gsClient: Pool | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type EmbeddingRecallItemType = {
|
export type EmbeddingRecallItemType = {
|
||||||
|
|||||||
@ -77,10 +77,7 @@ export const createCollectionAndInsertData = async ({
|
|||||||
const chunkSplitter = computeChunkSplitter(createCollectionParams);
|
const chunkSplitter = computeChunkSplitter(createCollectionParams);
|
||||||
const paragraphChunkDeep = computeParagraphChunkDeep(createCollectionParams);
|
const paragraphChunkDeep = computeParagraphChunkDeep(createCollectionParams);
|
||||||
|
|
||||||
if (
|
if (trainingType === DatasetCollectionDataProcessModeEnum.qa) {
|
||||||
trainingType === DatasetCollectionDataProcessModeEnum.qa ||
|
|
||||||
trainingType === DatasetCollectionDataProcessModeEnum.backup
|
|
||||||
) {
|
|
||||||
delete createCollectionParams.chunkTriggerType;
|
delete createCollectionParams.chunkTriggerType;
|
||||||
delete createCollectionParams.chunkTriggerMinSize;
|
delete createCollectionParams.chunkTriggerMinSize;
|
||||||
delete createCollectionParams.dataEnhanceCollectionName;
|
delete createCollectionParams.dataEnhanceCollectionName;
|
||||||
|
|||||||
@ -218,10 +218,6 @@ export const rawText2Chunks = ({
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if (backupParse) {
|
|
||||||
return parseDatasetBackup2Chunks(rawText).chunks;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Chunk condition
|
// Chunk condition
|
||||||
// 1. 选择最大值条件,只有超过了最大值(默认为模型的最大值*0.7),才会触发分块
|
// 1. 选择最大值条件,只有超过了最大值(默认为模型的最大值*0.7),才会触发分块
|
||||||
if (chunkTriggerType === ChunkTriggerConfigTypeEnum.maxSize) {
|
if (chunkTriggerType === ChunkTriggerConfigTypeEnum.maxSize) {
|
||||||
@ -244,6 +240,10 @@ export const rawText2Chunks = ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (backupParse) {
|
||||||
|
return parseDatasetBackup2Chunks(rawText).chunks;
|
||||||
|
}
|
||||||
|
|
||||||
const { chunks } = splitText2Chunks({
|
const { chunks } = splitText2Chunks({
|
||||||
text: rawText,
|
text: rawText,
|
||||||
chunkSize,
|
chunkSize,
|
||||||
|
|||||||
@ -86,6 +86,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Check interactive entry
|
// Check interactive entry
|
||||||
|
const interactiveResponse = lastInteractive;
|
||||||
props.node.isEntry = false;
|
props.node.isEntry = false;
|
||||||
const hasReadFilesTool = toolNodes.some(
|
const hasReadFilesTool = toolNodes.some(
|
||||||
(item) => item.flowNodeType === FlowNodeTypeEnum.readFiles
|
(item) => item.flowNodeType === FlowNodeTypeEnum.readFiles
|
||||||
@ -142,7 +143,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
if (lastInteractive && isEntry) {
|
if (interactiveResponse) {
|
||||||
return value.slice(0, -2);
|
return value.slice(0, -2);
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
@ -182,7 +183,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
|
|||||||
toolModel,
|
toolModel,
|
||||||
maxRunToolTimes: 30,
|
maxRunToolTimes: 30,
|
||||||
messages: adaptMessages,
|
messages: adaptMessages,
|
||||||
interactiveEntryToolParams: lastInteractive?.toolParams
|
interactiveEntryToolParams: interactiveResponse?.toolParams
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (toolModel.functionCall) {
|
if (toolModel.functionCall) {
|
||||||
@ -193,7 +194,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
|
|||||||
toolNodes,
|
toolNodes,
|
||||||
toolModel,
|
toolModel,
|
||||||
messages: adaptMessages,
|
messages: adaptMessages,
|
||||||
interactiveEntryToolParams: lastInteractive?.toolParams
|
interactiveEntryToolParams: interactiveResponse?.toolParams
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,7 +224,7 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
|
|||||||
toolNodes,
|
toolNodes,
|
||||||
toolModel,
|
toolModel,
|
||||||
messages: adaptMessages,
|
messages: adaptMessages,
|
||||||
interactiveEntryToolParams: lastInteractive?.toolParams
|
interactiveEntryToolParams: interactiveResponse?.toolParams
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import type {
|
|||||||
SystemVariablesType
|
SystemVariablesType
|
||||||
} from '@fastgpt/global/core/workflow/runtime/type';
|
} from '@fastgpt/global/core/workflow/runtime/type';
|
||||||
import type { RuntimeNodeItemType } from '@fastgpt/global/core/workflow/runtime/type.d';
|
import type { RuntimeNodeItemType } from '@fastgpt/global/core/workflow/runtime/type.d';
|
||||||
|
import type { FlowNodeOutputItemType } from '@fastgpt/global/core/workflow/type/io.d';
|
||||||
import type {
|
import type {
|
||||||
AIChatItemValueItemType,
|
AIChatItemValueItemType,
|
||||||
ChatHistoryItemResType,
|
ChatHistoryItemResType,
|
||||||
|
|||||||
@ -17,7 +17,6 @@ import { chatValue2RuntimePrompt } from '@fastgpt/global/core/chat/adapt';
|
|||||||
import { getPluginRunUserQuery } from '@fastgpt/global/core/workflow/utils';
|
import { getPluginRunUserQuery } from '@fastgpt/global/core/workflow/utils';
|
||||||
import { getPluginInputsFromStoreNodes } from '@fastgpt/global/core/app/plugin/utils';
|
import { getPluginInputsFromStoreNodes } from '@fastgpt/global/core/app/plugin/utils';
|
||||||
import type { NodeInputKeyEnum } from '@fastgpt/global/core/workflow/constants';
|
import type { NodeInputKeyEnum } from '@fastgpt/global/core/workflow/constants';
|
||||||
import { getUserChatInfoAndAuthTeamPoints } from '../../../../support/permission/auth/team';
|
|
||||||
|
|
||||||
type RunPluginProps = ModuleDispatchProps<{
|
type RunPluginProps = ModuleDispatchProps<{
|
||||||
[NodeInputKeyEnum.forbidStream]?: boolean;
|
[NodeInputKeyEnum.forbidStream]?: boolean;
|
||||||
@ -74,11 +73,9 @@ export const dispatchRunPlugin = async (props: RunPluginProps): Promise<RunPlugi
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
const { externalProvider } = await getUserChatInfoAndAuthTeamPoints(runningAppInfo.tmbId);
|
|
||||||
const runtimeVariables = {
|
const runtimeVariables = {
|
||||||
...filterSystemVariables(props.variables),
|
...filterSystemVariables(props.variables),
|
||||||
appId: String(plugin.id),
|
appId: String(plugin.id)
|
||||||
...(externalProvider ? externalProvider.externalWorkflowVariables : {})
|
|
||||||
};
|
};
|
||||||
const { flowResponses, flowUsages, assistantResponses, runTimes } = await dispatchWorkFlow({
|
const { flowResponses, flowUsages, assistantResponses, runTimes } = await dispatchWorkFlow({
|
||||||
...props,
|
...props,
|
||||||
|
|||||||
@ -20,7 +20,6 @@ import { ReadPermissionVal } from '@fastgpt/global/support/permission/constant';
|
|||||||
import { getAppVersionById } from '../../../app/version/controller';
|
import { getAppVersionById } from '../../../app/version/controller';
|
||||||
import { parseUrlToFileType } from '@fastgpt/global/common/file/tools';
|
import { parseUrlToFileType } from '@fastgpt/global/common/file/tools';
|
||||||
import { type ChildrenInteractive } from '@fastgpt/global/core/workflow/template/system/interactive/type';
|
import { type ChildrenInteractive } from '@fastgpt/global/core/workflow/template/system/interactive/type';
|
||||||
import { getUserChatInfoAndAuthTeamPoints } from '../../../../support/permission/auth/team';
|
|
||||||
|
|
||||||
type Props = ModuleDispatchProps<{
|
type Props = ModuleDispatchProps<{
|
||||||
[NodeInputKeyEnum.userChatInput]: string;
|
[NodeInputKeyEnum.userChatInput]: string;
|
||||||
@ -98,13 +97,11 @@ export const dispatchRunAppNode = async (props: Props): Promise<Response> => {
|
|||||||
|
|
||||||
// Rewrite children app variables
|
// Rewrite children app variables
|
||||||
const systemVariables = filterSystemVariables(variables);
|
const systemVariables = filterSystemVariables(variables);
|
||||||
const { externalProvider } = await getUserChatInfoAndAuthTeamPoints(appData.tmbId);
|
|
||||||
const childrenRunVariables = {
|
const childrenRunVariables = {
|
||||||
...systemVariables,
|
...systemVariables,
|
||||||
...childrenAppVariables,
|
...childrenAppVariables,
|
||||||
histories: chatHistories,
|
histories: chatHistories,
|
||||||
appId: String(appData._id),
|
appId: String(appData._id)
|
||||||
...(externalProvider ? externalProvider.externalWorkflowVariables : {})
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const childrenInteractive =
|
const childrenInteractive =
|
||||||
|
|||||||
@ -5,6 +5,8 @@ import { NodeOutputKeyEnum } from '@fastgpt/global/core/workflow/constants';
|
|||||||
import { type DispatchNodeResultType } from '@fastgpt/global/core/workflow/runtime/type';
|
import { type DispatchNodeResultType } from '@fastgpt/global/core/workflow/runtime/type';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { serverRequestBaseUrl } from '../../../../common/api/serverRequest';
|
import { serverRequestBaseUrl } from '../../../../common/api/serverRequest';
|
||||||
|
import { MongoRawTextBuffer } from '../../../../common/buffer/rawText/schema';
|
||||||
|
import { readFromSecondary } from '../../../../common/mongo/utils';
|
||||||
import { getErrText } from '@fastgpt/global/common/error/utils';
|
import { getErrText } from '@fastgpt/global/common/error/utils';
|
||||||
import { detectFileEncoding, parseUrlToFileType } from '@fastgpt/global/common/file/tools';
|
import { detectFileEncoding, parseUrlToFileType } from '@fastgpt/global/common/file/tools';
|
||||||
import { readRawContentByFileBuffer } from '../../../../common/file/read/utils';
|
import { readRawContentByFileBuffer } from '../../../../common/file/read/utils';
|
||||||
@ -12,8 +14,6 @@ import { ChatRoleEnum } from '@fastgpt/global/core/chat/constants';
|
|||||||
import { type ChatItemType, type UserChatItemValueItemType } from '@fastgpt/global/core/chat/type';
|
import { type ChatItemType, type UserChatItemValueItemType } from '@fastgpt/global/core/chat/type';
|
||||||
import { parseFileExtensionFromUrl } from '@fastgpt/global/common/string/tools';
|
import { parseFileExtensionFromUrl } from '@fastgpt/global/common/string/tools';
|
||||||
import { addLog } from '../../../../common/system/log';
|
import { addLog } from '../../../../common/system/log';
|
||||||
import { addRawTextBuffer, getRawTextBuffer } from '../../../../common/buffer/rawText/controller';
|
|
||||||
import { addMinutes } from 'date-fns';
|
|
||||||
|
|
||||||
type Props = ModuleDispatchProps<{
|
type Props = ModuleDispatchProps<{
|
||||||
[NodeInputKeyEnum.fileUrlList]: string[];
|
[NodeInputKeyEnum.fileUrlList]: string[];
|
||||||
@ -158,12 +158,14 @@ export const getFileContentFromLinks = async ({
|
|||||||
parseUrlList
|
parseUrlList
|
||||||
.map(async (url) => {
|
.map(async (url) => {
|
||||||
// Get from buffer
|
// Get from buffer
|
||||||
const fileBuffer = await getRawTextBuffer(url);
|
const fileBuffer = await MongoRawTextBuffer.findOne({ sourceId: url }, undefined, {
|
||||||
|
...readFromSecondary
|
||||||
|
}).lean();
|
||||||
if (fileBuffer) {
|
if (fileBuffer) {
|
||||||
return formatResponseObject({
|
return formatResponseObject({
|
||||||
filename: fileBuffer.sourceName || url,
|
filename: fileBuffer.metadata?.filename || url,
|
||||||
url,
|
url,
|
||||||
content: fileBuffer.text
|
content: fileBuffer.rawText
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -218,12 +220,17 @@ export const getFileContentFromLinks = async ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Add to buffer
|
// Add to buffer
|
||||||
addRawTextBuffer({
|
try {
|
||||||
sourceId: url,
|
if (buffer.length < 14 * 1024 * 1024 && rawText.trim()) {
|
||||||
sourceName: filename,
|
MongoRawTextBuffer.create({
|
||||||
text: rawText,
|
sourceId: url,
|
||||||
expiredTime: addMinutes(new Date(), 20)
|
rawText,
|
||||||
});
|
metadata: {
|
||||||
|
filename: filename
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {}
|
||||||
|
|
||||||
return formatResponseObject({ filename, url, content: rawText });
|
return formatResponseObject({ filename, url, content: rawText });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@ -2,7 +2,6 @@ import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/cons
|
|||||||
import { i18nT } from '../../../web/i18n/utils';
|
import { i18nT } from '../../../web/i18n/utils';
|
||||||
|
|
||||||
export const operationLogMap = {
|
export const operationLogMap = {
|
||||||
//Team
|
|
||||||
[OperationLogEventEnum.LOGIN]: {
|
[OperationLogEventEnum.LOGIN]: {
|
||||||
content: i18nT('account_team:log_login'),
|
content: i18nT('account_team:log_login'),
|
||||||
typeLabel: i18nT('account_team:login'),
|
typeLabel: i18nT('account_team:login'),
|
||||||
@ -67,309 +66,6 @@ export const operationLogMap = {
|
|||||||
content: i18nT('account_team:log_assign_permission'),
|
content: i18nT('account_team:log_assign_permission'),
|
||||||
typeLabel: i18nT('account_team:assign_permission'),
|
typeLabel: i18nT('account_team:assign_permission'),
|
||||||
params: {} as { name?: string; objectName: string; permission: string }
|
params: {} as { name?: string; objectName: string; permission: string }
|
||||||
},
|
|
||||||
//APP
|
|
||||||
[OperationLogEventEnum.CREATE_APP]: {
|
|
||||||
content: i18nT('account_team:log_create_app'),
|
|
||||||
typeLabel: i18nT('account_team:create_app'),
|
|
||||||
params: {} as { name?: string; appName: string; appType: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.UPDATE_APP_INFO]: {
|
|
||||||
content: i18nT('account_team:log_update_app_info'),
|
|
||||||
typeLabel: i18nT('account_team:update_app_info'),
|
|
||||||
params: {} as {
|
|
||||||
name?: string;
|
|
||||||
appName: string;
|
|
||||||
newItemNames: string[];
|
|
||||||
newItemValues: string[];
|
|
||||||
appType: string;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.MOVE_APP]: {
|
|
||||||
content: i18nT('account_team:log_move_app'),
|
|
||||||
typeLabel: i18nT('account_team:move_app'),
|
|
||||||
params: {} as { name?: string; appName: string; targetFolderName: string; appType: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.DELETE_APP]: {
|
|
||||||
content: i18nT('account_team:log_delete_app'),
|
|
||||||
typeLabel: i18nT('account_team:delete_app'),
|
|
||||||
params: {} as { name?: string; appName: string; appType: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.UPDATE_APP_COLLABORATOR]: {
|
|
||||||
content: i18nT('account_team:log_update_app_collaborator'),
|
|
||||||
typeLabel: i18nT('account_team:update_app_collaborator'),
|
|
||||||
params: {} as {
|
|
||||||
name?: string;
|
|
||||||
appName: string;
|
|
||||||
appType: string;
|
|
||||||
tmbList: string[];
|
|
||||||
groupList: string[];
|
|
||||||
orgList: string[];
|
|
||||||
permission: string;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.DELETE_APP_COLLABORATOR]: {
|
|
||||||
content: i18nT('account_team:log_delete_app_collaborator'),
|
|
||||||
typeLabel: i18nT('account_team:delete_app_collaborator'),
|
|
||||||
params: {} as {
|
|
||||||
name?: string;
|
|
||||||
appName: string;
|
|
||||||
appType: string;
|
|
||||||
itemName: string;
|
|
||||||
itemValueName: string;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.TRANSFER_APP_OWNERSHIP]: {
|
|
||||||
content: i18nT('account_team:log_transfer_app_ownership'),
|
|
||||||
typeLabel: i18nT('account_team:transfer_app_ownership'),
|
|
||||||
params: {} as {
|
|
||||||
name?: string;
|
|
||||||
appName: string;
|
|
||||||
appType: string;
|
|
||||||
oldOwnerName: string;
|
|
||||||
newOwnerName: string;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.CREATE_APP_COPY]: {
|
|
||||||
content: i18nT('account_team:log_create_app_copy'),
|
|
||||||
typeLabel: i18nT('account_team:create_app_copy'),
|
|
||||||
params: {} as { name?: string; appName: string; appType: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.CREATE_APP_FOLDER]: {
|
|
||||||
content: i18nT('account_team:log_create_app_folder'),
|
|
||||||
typeLabel: i18nT('account_team:create_app_folder'),
|
|
||||||
params: {} as { name?: string; folderName: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.UPDATE_PUBLISH_APP]: {
|
|
||||||
content: i18nT('account_team:log_update_publish_app'),
|
|
||||||
typeLabel: i18nT('account_team:update_publish_app'),
|
|
||||||
params: {} as {
|
|
||||||
name?: string;
|
|
||||||
operationName: string;
|
|
||||||
appName: string;
|
|
||||||
appId: string;
|
|
||||||
appType: string;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.CREATE_APP_PUBLISH_CHANNEL]: {
|
|
||||||
content: i18nT('account_team:log_create_app_publish_channel'),
|
|
||||||
typeLabel: i18nT('account_team:create_app_publish_channel'),
|
|
||||||
params: {} as { name?: string; appName: string; channelName: string; appType: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.UPDATE_APP_PUBLISH_CHANNEL]: {
|
|
||||||
content: i18nT('account_team:log_update_app_publish_channel'),
|
|
||||||
typeLabel: i18nT('account_team:update_app_publish_channel'),
|
|
||||||
params: {} as { name?: string; appName: string; channelName: string; appType: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.DELETE_APP_PUBLISH_CHANNEL]: {
|
|
||||||
content: i18nT('account_team:log_delete_app_publish_channel'),
|
|
||||||
typeLabel: i18nT('account_team:delete_app_publish_channel'),
|
|
||||||
params: {} as { name?: string; appName: string; channelName: string; appType: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.EXPORT_APP_CHAT_LOG]: {
|
|
||||||
content: i18nT('account_team:log_export_app_chat_log'),
|
|
||||||
typeLabel: i18nT('account_team:export_app_chat_log'),
|
|
||||||
params: {} as { name?: string; appName: string; appType: string }
|
|
||||||
},
|
|
||||||
//Dataset
|
|
||||||
[OperationLogEventEnum.CREATE_DATASET]: {
|
|
||||||
content: i18nT('account_team:log_create_dataset'),
|
|
||||||
typeLabel: i18nT('account_team:create_dataset'),
|
|
||||||
params: {} as { name?: string; datasetName: string; datasetType: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.UPDATE_DATASET]: {
|
|
||||||
content: i18nT('account_team:log_update_dataset'),
|
|
||||||
typeLabel: i18nT('account_team:update_dataset'),
|
|
||||||
params: {} as { name?: string; datasetName: string; datasetType: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.DELETE_DATASET]: {
|
|
||||||
content: i18nT('account_team:log_delete_dataset'),
|
|
||||||
typeLabel: i18nT('account_team:delete_dataset'),
|
|
||||||
params: {} as { name?: string; datasetName: string; datasetType: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.MOVE_DATASET]: {
|
|
||||||
content: i18nT('account_team:log_move_dataset'),
|
|
||||||
typeLabel: i18nT('account_team:move_dataset'),
|
|
||||||
params: {} as {
|
|
||||||
name?: string;
|
|
||||||
datasetName: string;
|
|
||||||
targetFolderName: string;
|
|
||||||
datasetType: string;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.UPDATE_DATASET_COLLABORATOR]: {
|
|
||||||
content: i18nT('account_team:log_update_dataset_collaborator'),
|
|
||||||
typeLabel: i18nT('account_team:update_dataset_collaborator'),
|
|
||||||
params: {} as {
|
|
||||||
name?: string;
|
|
||||||
datasetName: string;
|
|
||||||
datasetType: string;
|
|
||||||
tmbList: string[];
|
|
||||||
groupList: string[];
|
|
||||||
orgList: string[];
|
|
||||||
permission: string;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.DELETE_DATASET_COLLABORATOR]: {
|
|
||||||
content: i18nT('account_team:log_delete_dataset_collaborator'),
|
|
||||||
typeLabel: i18nT('account_team:delete_dataset_collaborator'),
|
|
||||||
params: {} as {
|
|
||||||
name?: string;
|
|
||||||
datasetName: string;
|
|
||||||
datasetType: string;
|
|
||||||
itemName: string;
|
|
||||||
itemValueName: string;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.TRANSFER_DATASET_OWNERSHIP]: {
|
|
||||||
content: i18nT('account_team:log_transfer_dataset_ownership'),
|
|
||||||
typeLabel: i18nT('account_team:transfer_dataset_ownership'),
|
|
||||||
params: {} as {
|
|
||||||
name?: string;
|
|
||||||
datasetName: string;
|
|
||||||
datasetType: string;
|
|
||||||
oldOwnerName: string;
|
|
||||||
newOwnerName: string;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.EXPORT_DATASET]: {
|
|
||||||
content: i18nT('account_team:log_export_dataset'),
|
|
||||||
typeLabel: i18nT('account_team:export_dataset'),
|
|
||||||
params: {} as { name?: string; datasetName: string; datasetType: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.CREATE_DATASET_FOLDER]: {
|
|
||||||
content: i18nT('account_team:log_create_dataset_folder'),
|
|
||||||
typeLabel: i18nT('account_team:create_dataset_folder'),
|
|
||||||
params: {} as { name?: string; folderName: string }
|
|
||||||
},
|
|
||||||
//Collection
|
|
||||||
[OperationLogEventEnum.CREATE_COLLECTION]: {
|
|
||||||
content: i18nT('account_team:log_create_collection'),
|
|
||||||
typeLabel: i18nT('account_team:create_collection'),
|
|
||||||
params: {} as {
|
|
||||||
name?: string;
|
|
||||||
collectionName: string;
|
|
||||||
datasetName: string;
|
|
||||||
datasetType: string;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.UPDATE_COLLECTION]: {
|
|
||||||
content: i18nT('account_team:log_update_collection'),
|
|
||||||
typeLabel: i18nT('account_team:update_collection'),
|
|
||||||
params: {} as {
|
|
||||||
name?: string;
|
|
||||||
collectionName: string;
|
|
||||||
datasetName: string;
|
|
||||||
datasetType: string;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.DELETE_COLLECTION]: {
|
|
||||||
content: i18nT('account_team:log_delete_collection'),
|
|
||||||
typeLabel: i18nT('account_team:delete_collection'),
|
|
||||||
params: {} as {
|
|
||||||
name?: string;
|
|
||||||
collectionName: string;
|
|
||||||
datasetName: string;
|
|
||||||
datasetType: string;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.RETRAIN_COLLECTION]: {
|
|
||||||
content: i18nT('account_team:log_retrain_collection'),
|
|
||||||
typeLabel: i18nT('account_team:retrain_collection'),
|
|
||||||
params: {} as {
|
|
||||||
name?: string;
|
|
||||||
collectionName: string;
|
|
||||||
datasetName: string;
|
|
||||||
datasetType: string;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//Data
|
|
||||||
[OperationLogEventEnum.CREATE_DATA]: {
|
|
||||||
content: i18nT('account_team:log_create_data'),
|
|
||||||
typeLabel: i18nT('account_team:create_data'),
|
|
||||||
params: {} as {
|
|
||||||
name?: string;
|
|
||||||
collectionName: string;
|
|
||||||
datasetName: string;
|
|
||||||
datasetType: string;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.UPDATE_DATA]: {
|
|
||||||
content: i18nT('account_team:log_update_data'),
|
|
||||||
typeLabel: i18nT('account_team:update_data'),
|
|
||||||
params: {} as {
|
|
||||||
name?: string;
|
|
||||||
collectionName: string;
|
|
||||||
datasetName: string;
|
|
||||||
datasetType: string;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.DELETE_DATA]: {
|
|
||||||
content: i18nT('account_team:log_delete_data'),
|
|
||||||
typeLabel: i18nT('account_team:delete_data'),
|
|
||||||
params: {} as {
|
|
||||||
name?: string;
|
|
||||||
collectionName: string;
|
|
||||||
datasetName: string;
|
|
||||||
datasetType: string;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//SearchTest
|
|
||||||
[OperationLogEventEnum.SEARCH_TEST]: {
|
|
||||||
content: i18nT('account_team:log_search_test'),
|
|
||||||
typeLabel: i18nT('account_team:search_test'),
|
|
||||||
params: {} as { name?: string; datasetName: string; datasetType: string }
|
|
||||||
},
|
|
||||||
//Account
|
|
||||||
[OperationLogEventEnum.CHANGE_PASSWORD]: {
|
|
||||||
content: i18nT('account_team:log_change_password'),
|
|
||||||
typeLabel: i18nT('account_team:change_password'),
|
|
||||||
params: {} as { name?: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.CHANGE_NOTIFICATION_SETTINGS]: {
|
|
||||||
content: i18nT('account_team:log_change_notification_settings'),
|
|
||||||
typeLabel: i18nT('account_team:change_notification_settings'),
|
|
||||||
params: {} as { name?: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.CHANGE_MEMBER_NAME_ACCOUNT]: {
|
|
||||||
content: i18nT('account_team:log_change_member_name_self'),
|
|
||||||
typeLabel: i18nT('account_team:change_member_name_self'),
|
|
||||||
params: {} as { name?: string; oldName: string; newName: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.PURCHASE_PLAN]: {
|
|
||||||
content: i18nT('account_team:log_purchase_plan'),
|
|
||||||
typeLabel: i18nT('account_team:purchase_plan'),
|
|
||||||
params: {} as { name?: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.EXPORT_BILL_RECORDS]: {
|
|
||||||
content: i18nT('account_team:log_export_bill_records'),
|
|
||||||
typeLabel: i18nT('account_team:export_bill_records'),
|
|
||||||
params: {} as { name?: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.CREATE_INVOICE]: {
|
|
||||||
content: i18nT('account_team:log_create_invoice'),
|
|
||||||
typeLabel: i18nT('account_team:create_invoice'),
|
|
||||||
params: {} as { name?: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.SET_INVOICE_HEADER]: {
|
|
||||||
content: i18nT('account_team:log_set_invoice_header'),
|
|
||||||
typeLabel: i18nT('account_team:set_invoice_header'),
|
|
||||||
params: {} as { name?: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.CREATE_API_KEY]: {
|
|
||||||
content: i18nT('account_team:log_create_api_key'),
|
|
||||||
typeLabel: i18nT('account_team:create_api_key'),
|
|
||||||
params: {} as { name?: string; keyName: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.UPDATE_API_KEY]: {
|
|
||||||
content: i18nT('account_team:log_update_api_key'),
|
|
||||||
typeLabel: i18nT('account_team:update_api_key'),
|
|
||||||
params: {} as { name?: string; keyName: string }
|
|
||||||
},
|
|
||||||
[OperationLogEventEnum.DELETE_API_KEY]: {
|
|
||||||
content: i18nT('account_team:log_delete_api_key'),
|
|
||||||
typeLabel: i18nT('account_team:delete_api_key'),
|
|
||||||
params: {} as { name?: string; keyName: string }
|
|
||||||
}
|
}
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
|||||||
@ -1,36 +0,0 @@
|
|||||||
import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
|
|
||||||
import { DatasetTypeEnum } from '@fastgpt/global/core/dataset/constants';
|
|
||||||
import { i18nT } from '../../../web/i18n/utils';
|
|
||||||
|
|
||||||
export function getI18nAppType(type: AppTypeEnum): string {
|
|
||||||
if (type === AppTypeEnum.folder) return i18nT('account_team:type.Folder');
|
|
||||||
if (type === AppTypeEnum.simple) return i18nT('account_team:type.Simple bot');
|
|
||||||
if (type === AppTypeEnum.workflow) return i18nT('account_team:type.Workflow bot');
|
|
||||||
if (type === AppTypeEnum.plugin) return i18nT('account_team:type.Plugin');
|
|
||||||
if (type === AppTypeEnum.httpPlugin) return i18nT('account_team:type.Http plugin');
|
|
||||||
if (type === AppTypeEnum.toolSet) return i18nT('account_team:type.Tool set');
|
|
||||||
if (type === AppTypeEnum.tool) return i18nT('account_team:type.Tool');
|
|
||||||
return i18nT('common:UnKnow');
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getI18nCollaboratorItemType(
|
|
||||||
tmbId: string | undefined,
|
|
||||||
groupId: string | undefined,
|
|
||||||
orgId: string | undefined
|
|
||||||
): string {
|
|
||||||
if (tmbId) return i18nT('account_team:member');
|
|
||||||
if (groupId) return i18nT('account_team:group');
|
|
||||||
if (orgId) return i18nT('account_team:department');
|
|
||||||
return i18nT('common:UnKnow');
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getI18nDatasetType(type: DatasetTypeEnum | string): string {
|
|
||||||
if (type === DatasetTypeEnum.folder) return i18nT('account_team:dataset.folder_dataset');
|
|
||||||
if (type === DatasetTypeEnum.dataset) return i18nT('account_team:dataset.common_dataset');
|
|
||||||
if (type === DatasetTypeEnum.websiteDataset) return i18nT('account_team:dataset.website_dataset');
|
|
||||||
if (type === DatasetTypeEnum.externalFile) return i18nT('account_team:dataset.external_file');
|
|
||||||
if (type === DatasetTypeEnum.apiDataset) return i18nT('account_team:dataset.api_file');
|
|
||||||
if (type === DatasetTypeEnum.feishu) return i18nT('account_team:dataset.feishu_dataset');
|
|
||||||
if (type === DatasetTypeEnum.yuque) return i18nT('account_team:dataset.yuque_dataset');
|
|
||||||
return i18nT('common:UnKnow');
|
|
||||||
}
|
|
||||||
@ -287,7 +287,6 @@ export const iconPaths = {
|
|||||||
'core/workflow/template/aiChat': () => import('./icons/core/workflow/template/aiChat.svg'),
|
'core/workflow/template/aiChat': () => import('./icons/core/workflow/template/aiChat.svg'),
|
||||||
'core/workflow/template/baseChart': () => import('./icons/core/workflow/template/baseChart.svg'),
|
'core/workflow/template/baseChart': () => import('./icons/core/workflow/template/baseChart.svg'),
|
||||||
'core/workflow/template/bing': () => import('./icons/core/workflow/template/bing.svg'),
|
'core/workflow/template/bing': () => import('./icons/core/workflow/template/bing.svg'),
|
||||||
'core/workflow/template/bocha': () => import('./icons/core/workflow/template/bocha.svg'),
|
|
||||||
'core/workflow/template/codeRun': () => import('./icons/core/workflow/template/codeRun.svg'),
|
'core/workflow/template/codeRun': () => import('./icons/core/workflow/template/codeRun.svg'),
|
||||||
'core/workflow/template/customFeedback': () =>
|
'core/workflow/template/customFeedback': () =>
|
||||||
import('./icons/core/workflow/template/customFeedback.svg'),
|
import('./icons/core/workflow/template/customFeedback.svg'),
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
<svg width="113" height="97" viewBox="0 0 113 97" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path d="M0 31.7259C1.80046 29.9255 3.82784 28.3872 5.96621 27.1988C8.10469 26.0103 10.3126 25.1947 12.4634 24.7992C14.6143 24.4037 16.6664 24.4361 18.5022 24.8938C20.2678 25.334 21.7994 26.1604 23.0183 27.3272L23.021 27.3245L47.189 51.4924L33.4778 65.2037L0 31.7259Z" fill="#C4DEFE"/>
|
|
||||||
<path d="M9.15662 11.5625C11.3617 10.2893 13.7181 9.32825 16.0912 8.73374C18.4645 8.13923 20.8082 7.92284 22.9882 8.09751C25.1681 8.27217 27.1419 8.83457 28.7966 9.75182C30.3881 10.6341 31.6537 11.8287 32.529 13.2712L32.5316 13.2697L32.6082 13.4025C32.6162 13.4162 32.6251 13.4297 32.633 13.4435L49.886 43.3286L33.0941 53.0234L9.15662 11.5625Z" fill="#A6CBFF"/>
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M31.1377 0C33.6839 4.40811e-05 36.2052 0.345872 38.5576 1.01758C40.9099 1.68929 43.0472 2.67394 44.8477 3.91504C46.6482 5.15627 48.0773 6.63021 49.0518 8.25195C49.9888 9.81168 50.4867 11.4792 50.5234 13.166H50.5273V21.4072C56.6623 17.6586 63.874 15.498 71.5898 15.498C93.9304 15.4984 112.042 33.6087 112.042 55.9492C112.042 78.29 93.9305 96.401 71.5898 96.4014C49.3907 96.4014 31.3704 78.5193 31.1426 56.374H31.1377V0ZM71.9473 35.0439C60.1187 35.0441 50.5295 44.6334 50.5293 56.4619C50.5293 63.5338 53.9569 69.8057 59.2412 73.7061C66.4989 79.0625 76.5515 75.3841 85.3955 77.1592C92.613 78.608 97.2369 82.6827 98.3652 83.7686C97.3562 82.731 93.791 78.7138 92.2715 72.3291C89.8011 61.9479 94.8744 49.6043 87.5771 41.8184C83.6695 37.6493 78.1122 35.0441 71.9473 35.0439Z" fill="#006EFF"/>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.6 KiB |
@ -1,26 +1,17 @@
|
|||||||
import { Box } from '@chakra-ui/react';
|
import { Box } from '@chakra-ui/react';
|
||||||
import React, { useMemo } from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
const HighlightText = ({
|
const HighlightText = ({
|
||||||
rawText,
|
rawText,
|
||||||
matchText,
|
matchText,
|
||||||
color = 'primary.600',
|
color = 'primary.600'
|
||||||
mode = 'text'
|
|
||||||
}: {
|
}: {
|
||||||
rawText: string;
|
rawText: string;
|
||||||
matchText: string;
|
matchText: string;
|
||||||
color?: string;
|
color?: string;
|
||||||
mode?: 'text' | 'bg';
|
|
||||||
}) => {
|
}) => {
|
||||||
const { parts } = useMemo(() => {
|
const regex = new RegExp(`(${matchText})`, 'gi');
|
||||||
const regx = new RegExp(`(${matchText})`, 'gi');
|
const parts = rawText.split(regex);
|
||||||
const parts = rawText.split(regx);
|
|
||||||
|
|
||||||
return {
|
|
||||||
regx,
|
|
||||||
parts
|
|
||||||
};
|
|
||||||
}, [rawText, matchText]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
@ -37,17 +28,7 @@ const HighlightText = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box as="span" key={index} color={highLight ? color : 'inherit'}>
|
||||||
as="span"
|
|
||||||
key={index}
|
|
||||||
{...(mode === 'bg'
|
|
||||||
? {
|
|
||||||
bg: highLight ? color : 'transparent'
|
|
||||||
}
|
|
||||||
: {
|
|
||||||
color: highLight ? color : 'inherit'
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
{part}
|
{part}
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
@ -56,4 +37,4 @@ const HighlightText = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default React.memo(HighlightText);
|
export default HighlightText;
|
||||||
|
|||||||
@ -3,8 +3,6 @@ import { useContextSelector } from 'use-context-selector';
|
|||||||
|
|
||||||
export const useSystem = () => {
|
export const useSystem = () => {
|
||||||
const isPc = useContextSelector(useSystemStoreContext, (state) => state.isPc);
|
const isPc = useContextSelector(useSystemStoreContext, (state) => state.isPc);
|
||||||
const isMac =
|
|
||||||
typeof window !== 'undefined' && window.navigator.userAgent.toLocaleLowerCase().includes('mac');
|
|
||||||
|
|
||||||
return { isPc, isMac };
|
return { isPc };
|
||||||
};
|
};
|
||||||
|
|||||||
@ -8,9 +8,6 @@
|
|||||||
"assign_permission": "Permission change",
|
"assign_permission": "Permission change",
|
||||||
"change_department_name": "Department Editor",
|
"change_department_name": "Department Editor",
|
||||||
"change_member_name": "Member name change",
|
"change_member_name": "Member name change",
|
||||||
"change_member_name_self": "Change member name",
|
|
||||||
"change_notification_settings": "Change the way to receive notifications",
|
|
||||||
"change_password": "change password",
|
|
||||||
"confirm_delete_from_org": "Confirm to move {{username}} out of the department?",
|
"confirm_delete_from_org": "Confirm to move {{username}} out of the department?",
|
||||||
"confirm_delete_from_team": "Confirm to move {{username}} out of the team?",
|
"confirm_delete_from_team": "Confirm to move {{username}} out of the team?",
|
||||||
"confirm_delete_group": "Confirm to delete group?",
|
"confirm_delete_group": "Confirm to delete group?",
|
||||||
@ -18,29 +15,12 @@
|
|||||||
"confirm_forbidden": "Confirm forbidden",
|
"confirm_forbidden": "Confirm forbidden",
|
||||||
"confirm_leave_team": "Confirmed to leave the team? \nAfter exiting, all your resources in the team are transferred to the team owner.",
|
"confirm_leave_team": "Confirmed to leave the team? \nAfter exiting, all your resources in the team are transferred to the team owner.",
|
||||||
"copy_link": "Copy link",
|
"copy_link": "Copy link",
|
||||||
"create_api_key": "Create API key",
|
|
||||||
"create_app": "Create an application",
|
|
||||||
"create_app_copy": "Create a copy of the application",
|
|
||||||
"create_app_folder": "Create an application folder",
|
|
||||||
"create_app_publish_channel": "Create a sharing channel",
|
|
||||||
"create_data": "Insert data",
|
|
||||||
"create_dataset": "Create a knowledge base",
|
|
||||||
"create_dataset_folder": "Create a Knowledge Base Folder",
|
|
||||||
"create_department": "Create a sub-department",
|
"create_department": "Create a sub-department",
|
||||||
"create_group": "Create group",
|
"create_group": "Create group",
|
||||||
"create_invitation_link": "Create Invitation Link",
|
"create_invitation_link": "Create Invitation Link",
|
||||||
"create_invoice": "Issuing invoices",
|
|
||||||
"create_org": "Create organization",
|
"create_org": "Create organization",
|
||||||
"create_sub_org": "Create sub-organization",
|
"create_sub_org": "Create sub-organization",
|
||||||
"delete": "delete",
|
"delete": "delete",
|
||||||
"delete_api_key": "Delete the API key",
|
|
||||||
"delete_app": "Delete the workbench application",
|
|
||||||
"delete_app_collaborator": "App permissions delete",
|
|
||||||
"delete_app_publish_channel": "Delete the publishing channel",
|
|
||||||
"delete_collection": "Delete a collection",
|
|
||||||
"delete_data": "Delete data",
|
|
||||||
"delete_dataset": "Delete the knowledge base",
|
|
||||||
"delete_dataset_collaborator": "Knowledge Base Permission Deletion",
|
|
||||||
"delete_department": "Delete sub-department",
|
"delete_department": "Delete sub-department",
|
||||||
"delete_from_org": "Move out of department",
|
"delete_from_org": "Move out of department",
|
||||||
"delete_from_team": "Move out of the team",
|
"delete_from_team": "Move out of the team",
|
||||||
@ -51,9 +31,6 @@
|
|||||||
"edit_member_tip": "Name",
|
"edit_member_tip": "Name",
|
||||||
"edit_org_info": "Edit organization information",
|
"edit_org_info": "Edit organization information",
|
||||||
"expires": "Expiration time",
|
"expires": "Expiration time",
|
||||||
"export_app_chat_log": "Export the app chat history",
|
|
||||||
"export_bill_records": "Export billing history",
|
|
||||||
"export_dataset": "Export knowledge base",
|
|
||||||
"export_members": "Export members",
|
"export_members": "Export members",
|
||||||
"forbid_hint": "After forbidden, this invitation link will become invalid. This action is irreversible. Are you sure you want to deactivate?",
|
"forbid_hint": "After forbidden, this invitation link will become invalid. This action is irreversible. Are you sure you want to deactivate?",
|
||||||
"forbid_success": "Forbid success",
|
"forbid_success": "Forbid success",
|
||||||
@ -79,69 +56,24 @@
|
|||||||
"log_assign_permission": "[{{name}}] Updated the permissions of [{{objectName}}]: [Application creation: [{{appCreate}}], Knowledge Base: [{{datasetCreate}}], API Key: [{{apiKeyCreate}}], Management: [{{manage}}]]",
|
"log_assign_permission": "[{{name}}] Updated the permissions of [{{objectName}}]: [Application creation: [{{appCreate}}], Knowledge Base: [{{datasetCreate}}], API Key: [{{apiKeyCreate}}], Management: [{{manage}}]]",
|
||||||
"log_change_department": "【{{name}}】Updated department【{{departmentName}}】",
|
"log_change_department": "【{{name}}】Updated department【{{departmentName}}】",
|
||||||
"log_change_member_name": "【{{name}}】Rename member [{{memberName}}] to 【{{newName}}】",
|
"log_change_member_name": "【{{name}}】Rename member [{{memberName}}] to 【{{newName}}】",
|
||||||
"log_change_member_name_self": "【{{name}}】Change your member name to 【{{newName}}】",
|
|
||||||
"log_change_notification_settings": "【{{name}}】A change notification receiving method operation was carried out",
|
|
||||||
"log_change_password": "【{{name}}】The password change operation was performed",
|
|
||||||
"log_create_api_key": "【{{name}}】Create an API key named [{{keyName}}]",
|
|
||||||
"log_create_app": "【{{name}}】Created [{{appType}}] named [{{appName}}]",
|
|
||||||
"log_create_app_copy": "【{{name}}] Created a copy of [{{appType}}] named [{{appName}}]",
|
|
||||||
"log_create_app_folder": "【{{name}}】Create a folder named [{{folderName}}]",
|
|
||||||
"log_create_app_publish_channel": "[{{name}}] Created a channel named [{{channelName}}] for [{{appType}}] called [{{appName}}].",
|
|
||||||
"log_create_collection": "[{{name}}] Create a collection named [{{collectionName}}] in [{{datasetType}}] called [{{datasetName}}].",
|
|
||||||
"log_create_data": "[{{name}}] Insert data into a collection named [{{datasetName}}] in [{{datasetType}}] called [{{datasetName}}] into a collection named [{{collectionName}}]",
|
|
||||||
"log_create_dataset": "【{{name}}】Created 【{{datasetType}}】 named 【{{datasetName}}】",
|
|
||||||
"log_create_dataset_folder": "【{{name}}】Created a folder named {{folderName}}】",
|
|
||||||
"log_create_department": "【{{name}}】Department【{{departmentName}}】",
|
"log_create_department": "【{{name}}】Department【{{departmentName}}】",
|
||||||
"log_create_group": "【{{name}}】Created group [{{groupName}}]",
|
"log_create_group": "【{{name}}】Created group [{{groupName}}]",
|
||||||
"log_create_invitation_link": "【{{name}}】Created invitation link【{{link}}】",
|
"log_create_invitation_link": "【{{name}}】Created invitation link【{{link}}】",
|
||||||
"log_create_invoice": "【{{name}}】Invoice operation was carried out",
|
|
||||||
"log_delete_api_key": "【{{name}}】Deleted the API key named [{{keyName}}]",
|
|
||||||
"log_delete_app": "【{{name}}】Delete the [{{appType}}] named [{{appName}}]",
|
|
||||||
"log_delete_app_collaborator": "【{{name}}】Delete the [itemName] permission named [itemValueName] in [{{appType}}] named [{{appName}}] delete the [itemName] permission named [{{appName}}] named [{{appName}}] named [{{appName}}] deleted the [{{itemName}}] permission named [{{itemValueName}}] named [{{appType}}] named [{{appName}}].",
|
|
||||||
"log_delete_app_publish_channel": "[{{name}}] [{{appType}}] named [{{appName}}] deleted the channel named [{{channelName}}]",
|
|
||||||
"log_delete_collection": "[{{name}}] Deleted a collection named [{{collectionName}}] in [{{datasetType}}] named [{{datasetName}}].",
|
|
||||||
"log_delete_data": "[{{name}}] Delete data in a collection named [{{datasetName}}] in a collection named [{{datasetName}}]",
|
|
||||||
"log_delete_dataset": "【{{name}}】Deleted 【{{datasetType}}】 named [{{datasetName}}]",
|
|
||||||
"log_delete_dataset_collaborator": "【{{name}}】Updated the collaborators of 【{{appType}}】 named 【{{appName}}】 to: Organization: 【{{orgList}}】, Group: 【{{groupList}}】, Member 【{{tmbList}}】; updated the permissions to: Read permission: 【{{readPermission}}】, Write permission: 【{{writePermission}}】, Administrator permission: 【{{managePermission}}】",
|
|
||||||
"log_delete_department": "{{name}} deleted department {{departmentName}}",
|
"log_delete_department": "{{name}} deleted department {{departmentName}}",
|
||||||
"log_delete_group": "{{name}} deleted group {{groupName}}",
|
"log_delete_group": "{{name}} deleted group {{groupName}}",
|
||||||
"log_details": "Details",
|
"log_details": "Details",
|
||||||
"log_export_app_chat_log": "【{{name}}】Export a chat history called [{{appName}}] called [{{appType}}]",
|
|
||||||
"log_export_bill_records": "【{{name}}】Export the billing record",
|
|
||||||
"log_export_dataset": "[{{name}}] Export [{{datasetType}}] called [{{datasetName}}]",
|
|
||||||
"log_join_team": "【{{name}}】Join the team through the invitation link 【{{link}}】",
|
"log_join_team": "【{{name}}】Join the team through the invitation link 【{{link}}】",
|
||||||
"log_kick_out_team": "{{name}} removed member {{memberName}}",
|
"log_kick_out_team": "{{name}} removed member {{memberName}}",
|
||||||
"log_login": "【{{name}}】Logined in the system",
|
"log_login": "【{{name}}】Logined in the system",
|
||||||
"log_move_app": "【{{name}}】Move [{{appType}}] named [{{appName}}] to [{{targetFolderName}}]",
|
|
||||||
"log_move_dataset": "【{{name}}】Move [{{datasetType}}] named [{{datasetName}}] to [{{targetFolderName}}]",
|
|
||||||
"log_recover_team_member": "【{{name}}】Restored member【{{memberName}}】",
|
"log_recover_team_member": "【{{name}}】Restored member【{{memberName}}】",
|
||||||
"log_relocate_department": "【{{name}}】Displayed department【{{departmentName}}】",
|
"log_relocate_department": "【{{name}}】Displayed department【{{departmentName}}】",
|
||||||
"log_retrain_collection": "[{{name}}] Retrained the collection named [{{collectionName}}] in [{{datasetType}}] called [{{datasetName}}].",
|
|
||||||
"log_search_test": "【{{name}}】Perform a search test operation on [{{datasetType}}] named [{{datasetName}}]",
|
|
||||||
"log_set_invoice_header": "【{{name}}】The invoice header operation was set up",
|
|
||||||
"log_time": "Operation time",
|
"log_time": "Operation time",
|
||||||
"log_transfer_app_ownership": "【{{name}}] Transfer ownership of [{{appType}}] named [{{appName}}] from [{oldOwnerName}}] to [{{newOwnerName}}]",
|
|
||||||
"log_transfer_dataset_ownership": "[{{name}}] Transfer ownership of [{{datasetType}}] named [{{datasetName}}] from [{oldOwnerName}}] to [{{newOwnerName}}]",
|
|
||||||
"log_type": "Operation Type",
|
"log_type": "Operation Type",
|
||||||
"log_update_api_key": "【{{name}}】Updated the API key named [{{keyName}}]",
|
|
||||||
"log_update_app_collaborator": "[{{name}}] Updated the collaborator named [{{appName}}] to: Organization: [{{orgList}}], Group: [{{groupList}}], Member [{{tmbList}}]; permissions updated to: Read permission: [{{readPermission}}], Write permission: [{{writePermission}}], Administrator permission: [{{managePermission}}]",
|
|
||||||
"log_update_app_info": "[{{name}}] updated [{{appType}}] named [{{appName}}]: [{{newItemNames}}] to [{{newItemValues}}]",
|
|
||||||
"log_update_app_publish_channel": "[{{name}}] Updated a channel named [{{channelName}}] for [{{appType}}] called [{{appName}}].",
|
|
||||||
"log_update_collection": "[{{name}}] Updated a collection named [{{collectionName}}] in [{{datasetType}}] called [{{datasetName}}].",
|
|
||||||
"log_update_data": "【{{name}}】Update data in a collection named 【{{datasetName}}】[{{datasetType}}] with [{{datasetType}}] with [{{collectionName}}]",
|
|
||||||
"log_update_dataset": "【{{name}}】Updated [{{datasetType}}] named [{{datasetName}}]",
|
|
||||||
"log_update_dataset_collaborator": "[{{name}}] Updated the collaborator named [{{datasetName}}] to: Organization: [{{orgList}}], Group: [{{groupList}}], Member [{{tmbList}}]; permissions updated to: [{{readPermission}}], [{{writePermission}}], [{{managePermission}}]",
|
|
||||||
"log_update_publish_app": "【{{name}}】【{{operationName}}】【{{appType}}】 named [{{appName}}】",
|
|
||||||
"log_user": "Operator",
|
"log_user": "Operator",
|
||||||
"login": "Log in",
|
"login": "Log in",
|
||||||
"manage_member": "Managing members",
|
"manage_member": "Managing members",
|
||||||
"member": "member",
|
"member": "member",
|
||||||
"department": "department",
|
|
||||||
"update": "update",
|
|
||||||
"save_and_publish": "save and publish",
|
|
||||||
"member_group": "Belonging to member group",
|
"member_group": "Belonging to member group",
|
||||||
"move_app": "App location movement",
|
|
||||||
"move_dataset": "Mobile Knowledge Base",
|
|
||||||
"move_member": "Move member",
|
"move_member": "Move member",
|
||||||
"move_org": "Move organization",
|
"move_org": "Move organization",
|
||||||
"notification_recieve": "Team notification reception",
|
"notification_recieve": "Team notification reception",
|
||||||
@ -160,7 +92,6 @@
|
|||||||
"permission_manage": "Admin",
|
"permission_manage": "Admin",
|
||||||
"permission_manage_tip": "Can manage members, create groups, manage all groups, and assign permissions to groups and members",
|
"permission_manage_tip": "Can manage members, create groups, manage all groups, and assign permissions to groups and members",
|
||||||
"please_bind_contact": "Please bind the contact information",
|
"please_bind_contact": "Please bind the contact information",
|
||||||
"purchase_plan": "Upgrade package",
|
|
||||||
"recover_team_member": "Member Recovery",
|
"recover_team_member": "Member Recovery",
|
||||||
"relocate_department": "Department Mobile",
|
"relocate_department": "Department Mobile",
|
||||||
"remark": "remark",
|
"remark": "remark",
|
||||||
@ -168,45 +99,17 @@
|
|||||||
"restore_tip": "Confirm to join the team {{username}}? \nOnly the availability and related permissions of this member account are restored, and the resources under the account cannot be restored.",
|
"restore_tip": "Confirm to join the team {{username}}? \nOnly the availability and related permissions of this member account are restored, and the resources under the account cannot be restored.",
|
||||||
"restore_tip_title": "Recovery confirmation",
|
"restore_tip_title": "Recovery confirmation",
|
||||||
"retain_admin_permissions": "Keep administrator rights",
|
"retain_admin_permissions": "Keep administrator rights",
|
||||||
"retrain_collection": "Retrain the set",
|
|
||||||
"search_log": "Search log",
|
"search_log": "Search log",
|
||||||
"search_member": "Search for members",
|
"search_member": "Search for members",
|
||||||
"search_member_group_name": "Search member/group name",
|
"search_member_group_name": "Search member/group name",
|
||||||
"search_org": "Search Department",
|
"search_org": "Search Department",
|
||||||
"search_test": "Search Test",
|
|
||||||
"set_invoice_header": "Set up invoice header",
|
|
||||||
"set_name_avatar": "Team avatar",
|
"set_name_avatar": "Team avatar",
|
||||||
"sync_immediately": "Synchronize now",
|
"sync_immediately": "Synchronize now",
|
||||||
"sync_member_failed": "Synchronization of members failed",
|
"sync_member_failed": "Synchronization of members failed",
|
||||||
"sync_member_success": "Synchronize members successfully",
|
"sync_member_success": "Synchronize members successfully",
|
||||||
"total_team_members": "Total {{amount}} members",
|
"total_team_members": "{{amount}} members in total",
|
||||||
"transfer_app_ownership": "Transfer app ownership",
|
"transfer_ownership": "transfer owner",
|
||||||
"transfer_dataset_ownership": "Transfer dataset ownership",
|
|
||||||
"transfer_ownership": "Transfer ownership",
|
|
||||||
"type.Folder": "Folder",
|
|
||||||
"type.Http plugin": "HTTP Plugin",
|
|
||||||
"type.Plugin": "Plugin",
|
|
||||||
"type.Simple bot": "Simple App",
|
|
||||||
"type.Tool": "Tool",
|
|
||||||
"type.Tool set": "Toolset",
|
|
||||||
"type.Workflow bot": "Workflow",
|
|
||||||
"dataset.folder_dataset": "Folder",
|
|
||||||
"dataset.common_dataset": "Dataset",
|
|
||||||
"dataset.website_dataset": "Website Sync",
|
|
||||||
"dataset.external_file": "External File",
|
|
||||||
"dataset.api_file": "API Import",
|
|
||||||
"dataset.feishu_dataset": "Feishu Spreadsheet",
|
|
||||||
"dataset.yuque_dataset": "Yuque Knowledge Base",
|
|
||||||
"unlimited": "Unlimited",
|
"unlimited": "Unlimited",
|
||||||
"update_api_key": "Update API key",
|
|
||||||
"update_app_collaborator": "Apply permission changes",
|
|
||||||
"update_app_info": "Application information modification",
|
|
||||||
"update_app_publish_channel": "Update the release channel",
|
|
||||||
"update_collection": "Update the collection",
|
|
||||||
"update_data": "Update data",
|
|
||||||
"update_dataset": "Update the knowledge base",
|
|
||||||
"update_dataset_collaborator": "Knowledge Base Permission Changes",
|
|
||||||
"update_publish_app": "Application update",
|
|
||||||
"used_times_limit": "Limit",
|
"used_times_limit": "Limit",
|
||||||
"user_name": "username",
|
"user_name": "username",
|
||||||
"user_team_invite_member": "Invite members",
|
"user_team_invite_member": "Invite members",
|
||||||
|
|||||||
@ -197,9 +197,6 @@
|
|||||||
"type.MCP tools": "MCP Toolset",
|
"type.MCP tools": "MCP Toolset",
|
||||||
"type.MCP_tools_url": "MCP Address",
|
"type.MCP_tools_url": "MCP Address",
|
||||||
"type.Plugin": "Plugin",
|
"type.Plugin": "Plugin",
|
||||||
"type.Folder": "Folder",
|
|
||||||
"type.Tool set": "Toolset",
|
|
||||||
"type.Tool": "Tool",
|
|
||||||
"type.Simple bot": "Simple App",
|
"type.Simple bot": "Simple App",
|
||||||
"type.Workflow bot": "Workflow",
|
"type.Workflow bot": "Workflow",
|
||||||
"type.error.Workflow data is empty": "No workflow data was obtained",
|
"type.error.Workflow data is empty": "No workflow data was obtained",
|
||||||
|
|||||||
@ -215,7 +215,6 @@
|
|||||||
"core.app.Interval timer run": "Scheduled Execution",
|
"core.app.Interval timer run": "Scheduled Execution",
|
||||||
"core.app.Interval timer tip": "Can Execute App on Schedule",
|
"core.app.Interval timer tip": "Can Execute App on Schedule",
|
||||||
"core.app.Make a brief introduction of your app": "Give Your AI App an Introduction",
|
"core.app.Make a brief introduction of your app": "Give Your AI App an Introduction",
|
||||||
"core.app.name": "name",
|
|
||||||
"core.app.Name and avatar": "Avatar & Name",
|
"core.app.Name and avatar": "Avatar & Name",
|
||||||
"core.app.Publish": "Publish",
|
"core.app.Publish": "Publish",
|
||||||
"core.app.Publish Confirm": "Confirm to Publish App? This Will Immediately Update the App Status on All Publishing Channels.",
|
"core.app.Publish Confirm": "Confirm to Publish App? This Will Immediately Update the App Status on All Publishing Channels.",
|
||||||
|
|||||||
@ -63,8 +63,6 @@
|
|||||||
"field_required": "Required",
|
"field_required": "Required",
|
||||||
"field_used_as_tool_input": "Used as Tool Call Parameter",
|
"field_used_as_tool_input": "Used as Tool Call Parameter",
|
||||||
"filter_description": "Currently supports filtering by tags and creation time. Fill in the format as follows:\n{\n \"tags\": {\n \"$and\": [\"Tag 1\",\"Tag 2\"],\n \"$or\": [\"When there are $and tags, and is effective, or is not effective\"]\n },\n \"createTime\": {\n \"$gte\": \"YYYY-MM-DD HH:mm format, collection creation time greater than this time\",\n \"$lte\": \"YYYY-MM-DD HH:mm format, collection creation time less than this time, can be used with $gte\"\n }\n}",
|
"filter_description": "Currently supports filtering by tags and creation time. Fill in the format as follows:\n{\n \"tags\": {\n \"$and\": [\"Tag 1\",\"Tag 2\"],\n \"$or\": [\"When there are $and tags, and is effective, or is not effective\"]\n },\n \"createTime\": {\n \"$gte\": \"YYYY-MM-DD HH:mm format, collection creation time greater than this time\",\n \"$lte\": \"YYYY-MM-DD HH:mm format, collection creation time less than this time, can be used with $gte\"\n }\n}",
|
||||||
"find_tip": "Find node ctrl f",
|
|
||||||
"find_tip_mac": "Find node ⌘ f",
|
|
||||||
"foldAll": "Collapse all",
|
"foldAll": "Collapse all",
|
||||||
"form_input_result": "User complete input result",
|
"form_input_result": "User complete input result",
|
||||||
"form_input_result_tip": "an object containing the complete result",
|
"form_input_result_tip": "an object containing the complete result",
|
||||||
@ -125,23 +123,18 @@
|
|||||||
"max_tokens": "Maximum Tokens",
|
"max_tokens": "Maximum Tokens",
|
||||||
"mouse_priority": "Mouse first\n- Press the left button to drag the canvas\n- Hold down shift and left click to select batches",
|
"mouse_priority": "Mouse first\n- Press the left button to drag the canvas\n- Hold down shift and left click to select batches",
|
||||||
"new_context": "New Context",
|
"new_context": "New Context",
|
||||||
"next": "Next",
|
|
||||||
"no_match_node": "No results",
|
|
||||||
"no_node_found": "No node was not found",
|
|
||||||
"not_contains": "Does Not Contain",
|
"not_contains": "Does Not Contain",
|
||||||
"only_the_reference_type_is_supported": "Only reference type is supported",
|
"only_the_reference_type_is_supported": "Only reference type is supported",
|
||||||
"optional_value_type": "Optional Value Type",
|
"optional_value_type": "Optional Value Type",
|
||||||
"optional_value_type_tip": "You can specify one or more data types. When dynamically adding fields, users can only select the configured types.",
|
"optional_value_type_tip": "You can specify one or more data types. When dynamically adding fields, users can only select the configured types.",
|
||||||
"pan_priority": "Touchpad first\n- Click to batch select\n- Move the canvas with two fingers",
|
"pan_priority": "Touchpad first\n- Click to batch select\n- Move the canvas with two fingers",
|
||||||
"pass_returned_object_as_output_to_next_nodes": "Pass the object returned in the code as output to the next nodes. The variable name needs to correspond to the return key.",
|
"pass_returned_object_as_output_to_next_nodes": "Pass the object returned in the code as output to the next nodes. The variable name needs to correspond to the return key.",
|
||||||
"please_enter_node_name": "Enter the node name",
|
|
||||||
"plugin.Instruction_Tip": "You can configure an instruction to explain the purpose of the plugin. This instruction will be displayed each time the plugin is used. Supports standard Markdown syntax.",
|
"plugin.Instruction_Tip": "You can configure an instruction to explain the purpose of the plugin. This instruction will be displayed each time the plugin is used. Supports standard Markdown syntax.",
|
||||||
"plugin.Instructions": "Instructions",
|
"plugin.Instructions": "Instructions",
|
||||||
"plugin.global_file_input": "File links (deprecated)",
|
"plugin.global_file_input": "File links (deprecated)",
|
||||||
"plugin_file_abandon_tip": "Plugin global file upload has been deprecated, please adjust it as soon as possible. \nRelated functions can be achieved through plug-in input and adding image type input.",
|
"plugin_file_abandon_tip": "Plugin global file upload has been deprecated, please adjust it as soon as possible. \nRelated functions can be achieved through plug-in input and adding image type input.",
|
||||||
"plugin_input": "Plugin Input",
|
"plugin_input": "Plugin Input",
|
||||||
"plugin_output_tool": "When the plug-in is executed as a tool, whether this field responds as a result of the tool",
|
"plugin_output_tool": "When the plug-in is executed as a tool, whether this field responds as a result of the tool",
|
||||||
"previous": "Previous",
|
|
||||||
"question_classification": "Classify",
|
"question_classification": "Classify",
|
||||||
"question_optimization": "Query extension",
|
"question_optimization": "Query extension",
|
||||||
"quote_content_placeholder": "The structure of the reference content can be customized to better suit different scenarios. \nSome variables can be used for template configuration\n\n{{q}} - main content\n\n{{a}} - auxiliary data\n\n{{source}} - source name\n\n{{sourceId}} - source ID\n\n{{index}} - nth reference",
|
"quote_content_placeholder": "The structure of the reference content can be customized to better suit different scenarios. \nSome variables can be used for template configuration\n\n{{q}} - main content\n\n{{a}} - auxiliary data\n\n{{source}} - source name\n\n{{sourceId}} - source ID\n\n{{index}} - nth reference",
|
||||||
@ -184,9 +177,9 @@
|
|||||||
"text_content_extraction": "Text Extract",
|
"text_content_extraction": "Text Extract",
|
||||||
"text_to_extract": "Text to Extract",
|
"text_to_extract": "Text to Extract",
|
||||||
"these_variables_will_be_input_parameters_for_code_execution": "These variables will be input parameters for code execution",
|
"these_variables_will_be_input_parameters_for_code_execution": "These variables will be input parameters for code execution",
|
||||||
|
"tool.tool_result": "Tool operation results",
|
||||||
"to_add_node": "to add",
|
"to_add_node": "to add",
|
||||||
"to_connect_node": "to connect",
|
"to_connect_node": "to connect",
|
||||||
"tool.tool_result": "Tool operation results",
|
|
||||||
"tool_call_termination": "Stop ToolCall",
|
"tool_call_termination": "Stop ToolCall",
|
||||||
"tool_custom_field": "Custom Tool",
|
"tool_custom_field": "Custom Tool",
|
||||||
"tool_field": " Tool Field Parameter Configuration",
|
"tool_field": " Tool Field Parameter Configuration",
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"account_team.delete_dataset": "删除知识库",
|
|
||||||
"active_model": "可用模型",
|
"active_model": "可用模型",
|
||||||
"add_default_model": "添加预设模型",
|
"add_default_model": "添加预设模型",
|
||||||
"api_key": "API 密钥",
|
"api_key": "API 密钥",
|
||||||
|
|||||||
@ -8,9 +8,6 @@
|
|||||||
"assign_permission": "权限变更",
|
"assign_permission": "权限变更",
|
||||||
"change_department_name": "部门编辑",
|
"change_department_name": "部门编辑",
|
||||||
"change_member_name": "成员改名",
|
"change_member_name": "成员改名",
|
||||||
"change_member_name_self": "变更成员名",
|
|
||||||
"change_notification_settings": "变更通知接收途径",
|
|
||||||
"change_password": "更改密码",
|
|
||||||
"confirm_delete_from_org": "确认将 {{username}} 移出部门?",
|
"confirm_delete_from_org": "确认将 {{username}} 移出部门?",
|
||||||
"confirm_delete_from_team": "确认将 {{username}} 移出团队?",
|
"confirm_delete_from_team": "确认将 {{username}} 移出团队?",
|
||||||
"confirm_delete_group": "确认删除群组?",
|
"confirm_delete_group": "确认删除群组?",
|
||||||
@ -18,30 +15,12 @@
|
|||||||
"confirm_forbidden": "确认停用",
|
"confirm_forbidden": "确认停用",
|
||||||
"confirm_leave_team": "确认离开该团队? \n退出后,您在该团队所有的资源均转让给团队所有者。",
|
"confirm_leave_team": "确认离开该团队? \n退出后,您在该团队所有的资源均转让给团队所有者。",
|
||||||
"copy_link": "复制链接",
|
"copy_link": "复制链接",
|
||||||
"create_api_key": "创建api密钥",
|
|
||||||
"create_app": "创建应用",
|
|
||||||
"create_app_copy": "创建应用副本",
|
|
||||||
"create_app_folder": "创建应用文件夹",
|
|
||||||
"create_app_publish_channel": "创建分享渠道",
|
|
||||||
"create_collection": "创建集合",
|
|
||||||
"create_data": "插入数据",
|
|
||||||
"create_dataset": "创建知识库",
|
|
||||||
"create_dataset_folder": "创建知识库文件夹",
|
|
||||||
"create_department": "创建子部门",
|
"create_department": "创建子部门",
|
||||||
"create_group": "创建群组",
|
"create_group": "创建群组",
|
||||||
"create_invitation_link": "创建邀请链接",
|
"create_invitation_link": "创建邀请链接",
|
||||||
"create_invoice": "开发票",
|
|
||||||
"create_org": "创建部门",
|
"create_org": "创建部门",
|
||||||
"create_sub_org": "创建子部门",
|
"create_sub_org": "创建子部门",
|
||||||
"delete": "删除",
|
"delete": "删除",
|
||||||
"delete_api_key": "删除api密钥",
|
|
||||||
"delete_app": "删除工作台应用",
|
|
||||||
"delete_app_collaborator": "应用权限删除",
|
|
||||||
"delete_app_publish_channel": "删除发布渠道",
|
|
||||||
"delete_collection": "删除集合",
|
|
||||||
"delete_data": "删除数据",
|
|
||||||
"delete_dataset": "删除知识库",
|
|
||||||
"delete_dataset_collaborator": "知识库权限删除",
|
|
||||||
"delete_department": "删除子部门",
|
"delete_department": "删除子部门",
|
||||||
"delete_from_org": "移出部门",
|
"delete_from_org": "移出部门",
|
||||||
"delete_from_team": "移出团队",
|
"delete_from_team": "移出团队",
|
||||||
@ -52,9 +31,6 @@
|
|||||||
"edit_member_tip": "成员名",
|
"edit_member_tip": "成员名",
|
||||||
"edit_org_info": "编辑部门信息",
|
"edit_org_info": "编辑部门信息",
|
||||||
"expires": "过期时间",
|
"expires": "过期时间",
|
||||||
"export_app_chat_log": "导出应用聊天记录",
|
|
||||||
"export_bill_records": "导出账单记录",
|
|
||||||
"export_dataset": "导出知识库",
|
|
||||||
"export_members": "导出成员",
|
"export_members": "导出成员",
|
||||||
"forbid_hint": "停用后,该邀请链接将失效。 该操作不可撤销,是否确认停用?",
|
"forbid_hint": "停用后,该邀请链接将失效。 该操作不可撤销,是否确认停用?",
|
||||||
"forbid_success": "停用成功",
|
"forbid_success": "停用成功",
|
||||||
@ -80,70 +56,24 @@
|
|||||||
"log_assign_permission": "【{{name}}】更新了【{{objectName}}】的权限:[应用创建:【{{appCreate}}】, 知识库:【{{datasetCreate}}】, API密钥:【{{apiKeyCreate}}】, 管理:【{{manage}}】]",
|
"log_assign_permission": "【{{name}}】更新了【{{objectName}}】的权限:[应用创建:【{{appCreate}}】, 知识库:【{{datasetCreate}}】, API密钥:【{{apiKeyCreate}}】, 管理:【{{manage}}】]",
|
||||||
"log_change_department": "【{{name}}】更新了部门【{{departmentName}}】",
|
"log_change_department": "【{{name}}】更新了部门【{{departmentName}}】",
|
||||||
"log_change_member_name": "【{{name}}】将成员【{{memberName}}】重命名为【{{newName}}】",
|
"log_change_member_name": "【{{name}}】将成员【{{memberName}}】重命名为【{{newName}}】",
|
||||||
"log_change_member_name_self": "【{{name}}】把自己的成员名从【{{oldName}}】变更为【{{newName}}】",
|
|
||||||
"log_change_notification_settings": "【{{name}}】进行了变更通知接收途径操作",
|
|
||||||
"log_change_password": "【{{name}}】进行了变更密码操作",
|
|
||||||
"log_create_api_key": "【{{name}}】创建了名为【{{keyName}}】的api密钥",
|
|
||||||
"log_create_app": "【{{name}}】创建了名为【{{appName}}】的【{{appType}}】",
|
|
||||||
"log_create_app_copy": "【{{name}}】给名为【{{appName}}】的【{{appType}}】创建了一个副本",
|
|
||||||
"log_create_app_folder": "【{{name}}】创建了名为【{{folderName}}】的文件夹",
|
|
||||||
"log_create_app_publish_channel": "【{{name}}】给名为【{{appName}}】的【{{appType}}】创建了名为【{{channelName}}】的渠道",
|
|
||||||
"log_create_collection": "【{{name}}】在名为【{{datasetName}}】的【{{datasetType}}】创建了名为【{{collectionName}}】的集合",
|
|
||||||
"log_create_data": "【{{name}}】在名为【{{datasetName}}】的【{{datasetType}}】往名为【{{collectionName}}】的集合插入数据",
|
|
||||||
"log_create_dataset": "【{{name}}】创建了名为【{{datasetName}}】的【{{datasetType}}】",
|
|
||||||
"log_create_dataset_folder": "【{{name}}】创建了名为{{folderName}}】的文件夹",
|
|
||||||
"log_create_department": "【{{name}}】创建了部门【{{departmentName}}】",
|
"log_create_department": "【{{name}}】创建了部门【{{departmentName}}】",
|
||||||
"log_create_group": "【{{name}}】创建了群组【{{groupName}}】",
|
"log_create_group": "【{{name}}】创建了群组【{{groupName}}】",
|
||||||
"log_create_invitation_link": "【{{name}}】创建了邀请链接【{{link}}】",
|
"log_create_invitation_link": "【{{name}}】创建了邀请链接【{{link}}】",
|
||||||
"log_create_invoice": "【{{name}}】进行了开发票操作",
|
|
||||||
"log_delete_api_key": "【{{name}}】删除了名为【{{keyName}}】的api密钥",
|
|
||||||
"log_delete_app": "【{{name}}】将名为【{{appName}}】的【{{appType}}】删除",
|
|
||||||
"log_delete_app_collaborator": "【{{name}}】将名为【{{appName}}】的【{{appType}}】中名为【{{itemValueName}}】的【{{itemName}}】权限删除",
|
|
||||||
"log_delete_app_publish_channel": "【{{name}}】名为【{{appName}}】的【{{appType}}】删除了名为【{{channelName}}】的渠道",
|
|
||||||
"log_delete_collection": "【{{name}}】在名为【{{datasetName}}】的【{{datasetType}}】删除了名为【{{collectionName}}】的集合",
|
|
||||||
"log_delete_data": "【{{name}}】在名为【{{datasetName}}】的【{{datasetType}}】在名为【{{collectionName}}】的集合删除数据",
|
|
||||||
"log_delete_dataset": "【{{name}}】删除了名为【{{datasetName}}】的【{{datasetType}}】",
|
|
||||||
"log_delete_dataset_collaborator": "【{{name}}】将名为【{{datasetName}}】的【{{datasetType}}】中名为【itemValueName】的【itemName】权限删除",
|
|
||||||
"log_delete_department": "【{{name}}】删除了部门【{{departmentName}}】",
|
"log_delete_department": "【{{name}}】删除了部门【{{departmentName}}】",
|
||||||
"log_delete_group": "【{{name}}】删除了群组【{{groupName}}】",
|
"log_delete_group": "【{{name}}】删除了群组【{{groupName}}】",
|
||||||
"log_details": "详情",
|
"log_details": "详情",
|
||||||
"log_export_app_chat_log": "【{{name}}】导出了名为【{{appName}}】的【{{appType}}】的聊天记录",
|
|
||||||
"log_export_bill_records": "【{{name}}】导出了账单记录",
|
|
||||||
"log_export_dataset": "【{{name}}】导出了名为【{{datasetName}}】的【{{datasetType}}】",
|
|
||||||
"log_join_team": "【{{name}}】通过邀请链接【{{link}}】加入团队",
|
"log_join_team": "【{{name}}】通过邀请链接【{{link}}】加入团队",
|
||||||
"log_kick_out_team": "【{{name}}】移除了成员【{{memberName}}】",
|
"log_kick_out_team": "【{{name}}】移除了成员【{{memberName}}】",
|
||||||
"log_login": "【{{name}}】登录了系统",
|
"log_login": "【{{name}}】登录了系统",
|
||||||
"log_move_app": "【{{name}}】将名为【{{appName}}】的【{{appType}}】移动到【{{targetFolderName}}】",
|
|
||||||
"log_move_dataset": "【{{name}}】将名为【{{datasetName}}】的【{{datasetType}}】移动到【{{targetFolderName}}】",
|
|
||||||
"log_purchase_plan": "【{{name}}】购买了套餐",
|
|
||||||
"log_recover_team_member": "【{{name}}】恢复了成员【{{memberName}}】",
|
"log_recover_team_member": "【{{name}}】恢复了成员【{{memberName}}】",
|
||||||
"log_relocate_department": "【{{name}}】移动了部门【{{departmentName}}】",
|
"log_relocate_department": "【{{name}}】移动了部门【{{departmentName}}】",
|
||||||
"log_retrain_collection": "【{{name}}】在名为【{{datasetName}}】的【{{datasetType}}】重新训练了名为【{{collectionName}}】的集合",
|
|
||||||
"log_search_test": "【{{name}}】在名为【{{datasetName}}】的【{{datasetType}}】执行搜索测试操作",
|
|
||||||
"log_set_invoice_header": "【{{name}}】进行了设置发票抬头操作",
|
|
||||||
"log_time": "操作时间",
|
"log_time": "操作时间",
|
||||||
"log_transfer_app_ownership": "【{{name}}】将名为【{{appName}}】的【{{appType}}】的所有权从【{{oldOwnerName}}】转移到【{{newOwnerName}}】",
|
|
||||||
"log_transfer_dataset_ownership": "【{{name}}】将名为【{{datasetName}}】的【{{datasetType}}】的所有权从【{{oldOwnerName}}】转移到【{{newOwnerName}}】",
|
|
||||||
"log_type": "操作类型",
|
"log_type": "操作类型",
|
||||||
"log_update_api_key": "【{{name}}】更新了名为【{{keyName}}】的api密钥",
|
|
||||||
"log_update_app_collaborator": "【{{name}}】将名为【{{appName}}】的【{{appType}}】的合作者更新为:组织:【{{orgList}}】,群组:【{{groupList}}】,成员【{{tmbList}}】;权限更新为:读权限:【{{readPermission}}】,写权限:【{{writePermission}}】,管理员权限:【{{managePermission}}】",
|
|
||||||
"log_update_app_info": "【{{name}}】更新了名为【{{appName}}】的【{{appType}}】:【{{newItemNames}}】为【{{newItemValues}}】",
|
|
||||||
"log_update_app_publish_channel": "【{{name}}】给名为【{{appName}}】的【{{appType}}】更新了名为【{{channelName}}】的渠道",
|
|
||||||
"log_update_collection": "【{{name}}】在名为【{{datasetName}}】的【{{datasetType}}】更新了名为【{{collectionName}}】的集合",
|
|
||||||
"log_update_data": "【{{name}}】在名为【{{datasetName}}】的【{{datasetType}}】在名为【{{collectionName}}】的集合更新数据",
|
|
||||||
"log_update_dataset": "【{{name}}】更新了名为【{{datasetName}}】的【{{datasetType}}】",
|
|
||||||
"log_update_dataset_collaborator": "【{{name}}】将名为【{{datasetName}}】的【{{datasetType}}】的合作者更新为:组织:【{{orgList}}】,群组:【{{groupList}}】,成员【{{tmbList}}】;权限更新为:【{{readPermission}}】,【{{writePermission}}】,【{{managePermission}}】",
|
|
||||||
"log_update_publish_app": "【{{name}}】【{{operationName}}】名为【{{appName}}】的【{{appType}}】",
|
|
||||||
"log_user": "操作人员",
|
"log_user": "操作人员",
|
||||||
"login": "登录",
|
"login": "登录",
|
||||||
"manage_member": "管理成员",
|
"manage_member": "管理成员",
|
||||||
"member": "成员",
|
"member": "成员",
|
||||||
"department": "部门",
|
|
||||||
"update": "更新",
|
|
||||||
"save_and_publish": "保存并发布",
|
|
||||||
"member_group": "所属群组",
|
"member_group": "所属群组",
|
||||||
"move_app": "应用位置移动",
|
|
||||||
"move_dataset": "移动知识库",
|
|
||||||
"move_member": "移动成员",
|
"move_member": "移动成员",
|
||||||
"move_org": "移动部门",
|
"move_org": "移动部门",
|
||||||
"notification_recieve": "团队通知接收",
|
"notification_recieve": "团队通知接收",
|
||||||
@ -162,7 +92,6 @@
|
|||||||
"permission_manage": "管理员",
|
"permission_manage": "管理员",
|
||||||
"permission_manage_tip": "可以管理成员、创建群组、管理所有群组、为群组和成员分配权限",
|
"permission_manage_tip": "可以管理成员、创建群组、管理所有群组、为群组和成员分配权限",
|
||||||
"please_bind_contact": "请绑定联系方式",
|
"please_bind_contact": "请绑定联系方式",
|
||||||
"purchase_plan": "升级套餐",
|
|
||||||
"recover_team_member": "成员恢复",
|
"recover_team_member": "成员恢复",
|
||||||
"relocate_department": "部门移动",
|
"relocate_department": "部门移动",
|
||||||
"remark": "备注",
|
"remark": "备注",
|
||||||
@ -170,45 +99,17 @@
|
|||||||
"restore_tip": "确认将 {{username}} 加入团队吗?仅恢复该成员账号可用性及相关权限,无法恢复账号下资源。",
|
"restore_tip": "确认将 {{username}} 加入团队吗?仅恢复该成员账号可用性及相关权限,无法恢复账号下资源。",
|
||||||
"restore_tip_title": "恢复确认",
|
"restore_tip_title": "恢复确认",
|
||||||
"retain_admin_permissions": "保留管理员权限",
|
"retain_admin_permissions": "保留管理员权限",
|
||||||
"retrain_collection": "重新训练集合",
|
|
||||||
"search_log": "搜索日志",
|
"search_log": "搜索日志",
|
||||||
"search_member": "搜索成员",
|
"search_member": "搜索成员",
|
||||||
"search_member_group_name": "搜索成员/群组名称",
|
"search_member_group_name": "搜索成员/群组名称",
|
||||||
"search_org": "搜索部门",
|
"search_org": "搜索部门",
|
||||||
"search_test": "搜索测试",
|
|
||||||
"set_invoice_header": "设置发票抬头",
|
|
||||||
"set_name_avatar": "团队头像 & 团队名",
|
"set_name_avatar": "团队头像 & 团队名",
|
||||||
"sync_immediately": "立即同步",
|
"sync_immediately": "立即同步",
|
||||||
"sync_member_failed": "同步成员失败",
|
"sync_member_failed": "同步成员失败",
|
||||||
"sync_member_success": "同步成员成功",
|
"sync_member_success": "同步成员成功",
|
||||||
"total_team_members": "共 {{amount}} 名成员",
|
"total_team_members": "共 {{amount}} 名成员",
|
||||||
"transfer_app_ownership": "转移应用所有权",
|
|
||||||
"transfer_dataset_ownership": "转移知识库所有权",
|
|
||||||
"transfer_ownership": "转让所有者",
|
"transfer_ownership": "转让所有者",
|
||||||
"type.Folder": "文件夹",
|
|
||||||
"type.Http plugin": "HTTP 插件",
|
|
||||||
"type.Plugin": "插件",
|
|
||||||
"type.Simple bot": "简易应用",
|
|
||||||
"type.Tool": "工具",
|
|
||||||
"type.Tool set": "工具集",
|
|
||||||
"type.Workflow bot": "工作流",
|
|
||||||
"dataset.folder_dataset": "文件夹",
|
|
||||||
"dataset.common_dataset": "知识库",
|
|
||||||
"dataset.website_dataset": "网站同步",
|
|
||||||
"dataset.external_file": "外部文件",
|
|
||||||
"dataset.api_file": "API导入",
|
|
||||||
"dataset.feishu_dataset": "飞书多维表格",
|
|
||||||
"dataset.yuque_dataset": "语雀知识库",
|
|
||||||
"unlimited": "无限制",
|
"unlimited": "无限制",
|
||||||
"update_api_key": "更新api密钥",
|
|
||||||
"update_app_collaborator": "应用权限更改",
|
|
||||||
"update_app_info": "应用信息修改",
|
|
||||||
"update_app_publish_channel": "更新发布渠道",
|
|
||||||
"update_collection": "更新集合",
|
|
||||||
"update_data": "更新数据",
|
|
||||||
"update_dataset": "更新知识库",
|
|
||||||
"update_dataset_collaborator": "知识库权限更改",
|
|
||||||
"update_publish_app": "应用更新",
|
|
||||||
"used_times_limit": "有效人数",
|
"used_times_limit": "有效人数",
|
||||||
"user_name": "用户名",
|
"user_name": "用户名",
|
||||||
"user_team_invite_member": "邀请成员",
|
"user_team_invite_member": "邀请成员",
|
||||||
|
|||||||
@ -189,7 +189,6 @@
|
|||||||
"type.Create simple bot tip": "通过填表单形式,创建简单的 AI 应用,适合新手",
|
"type.Create simple bot tip": "通过填表单形式,创建简单的 AI 应用,适合新手",
|
||||||
"type.Create workflow bot": "创建工作流",
|
"type.Create workflow bot": "创建工作流",
|
||||||
"type.Create workflow tip": "通过低代码的方式,构建逻辑复杂的多轮对话 AI 应用,推荐高级玩家使用",
|
"type.Create workflow tip": "通过低代码的方式,构建逻辑复杂的多轮对话 AI 应用,推荐高级玩家使用",
|
||||||
"type.Folder": "文件夹",
|
|
||||||
"type.Http plugin": "HTTP 插件",
|
"type.Http plugin": "HTTP 插件",
|
||||||
"type.Import from json": "导入 JSON 配置",
|
"type.Import from json": "导入 JSON 配置",
|
||||||
"type.Import from json tip": "通过 JSON 配置文件,直接创建应用",
|
"type.Import from json tip": "通过 JSON 配置文件,直接创建应用",
|
||||||
@ -199,8 +198,6 @@
|
|||||||
"type.MCP_tools_url": "MCP 地址",
|
"type.MCP_tools_url": "MCP 地址",
|
||||||
"type.Plugin": "插件",
|
"type.Plugin": "插件",
|
||||||
"type.Simple bot": "简易应用",
|
"type.Simple bot": "简易应用",
|
||||||
"type.Tool": "工具",
|
|
||||||
"type.Tool set": "工具集",
|
|
||||||
"type.Workflow bot": "工作流",
|
"type.Workflow bot": "工作流",
|
||||||
"type.error.Workflow data is empty": "没有获取到工作流数据",
|
"type.error.Workflow data is empty": "没有获取到工作流数据",
|
||||||
"type.error.workflowresponseempty": "响应内容为空",
|
"type.error.workflowresponseempty": "响应内容为空",
|
||||||
|
|||||||
@ -215,7 +215,6 @@
|
|||||||
"core.app.Interval timer run": "定时执行",
|
"core.app.Interval timer run": "定时执行",
|
||||||
"core.app.Interval timer tip": "可定时执行应用",
|
"core.app.Interval timer tip": "可定时执行应用",
|
||||||
"core.app.Make a brief introduction of your app": "给你的 AI 应用一个介绍",
|
"core.app.Make a brief introduction of your app": "给你的 AI 应用一个介绍",
|
||||||
"core.app.name": "名称",
|
|
||||||
"core.app.Name and avatar": "头像 & 名称",
|
"core.app.Name and avatar": "头像 & 名称",
|
||||||
"core.app.Publish": "发布",
|
"core.app.Publish": "发布",
|
||||||
"core.app.Publish Confirm": "确认发布应用?会立即更新所有发布渠道的应用状态。",
|
"core.app.Publish Confirm": "确认发布应用?会立即更新所有发布渠道的应用状态。",
|
||||||
|
|||||||
@ -63,8 +63,6 @@
|
|||||||
"field_required": "必填",
|
"field_required": "必填",
|
||||||
"field_used_as_tool_input": "作为工具调用参数",
|
"field_used_as_tool_input": "作为工具调用参数",
|
||||||
"filter_description": "目前支持标签和创建时间过滤,需按照以下格式填写:\n{\n \"tags\": {\n \"$and\": [\"标签 1\",\"标签 2\"],\n \"$or\": [\"有 $and 标签时,and 生效,or 不生效\"]\n },\n \"createTime\": {\n \"$gte\": \"YYYY-MM-DD HH:mm 格式即可,集合的创建时间大于该时间\",\n \"$lte\": \"YYYY-MM-DD HH:mm 格式即可,集合的创建时间小于该时间,可和 $gte 共同使用\"\n }\n}",
|
"filter_description": "目前支持标签和创建时间过滤,需按照以下格式填写:\n{\n \"tags\": {\n \"$and\": [\"标签 1\",\"标签 2\"],\n \"$or\": [\"有 $and 标签时,and 生效,or 不生效\"]\n },\n \"createTime\": {\n \"$gte\": \"YYYY-MM-DD HH:mm 格式即可,集合的创建时间大于该时间\",\n \"$lte\": \"YYYY-MM-DD HH:mm 格式即可,集合的创建时间小于该时间,可和 $gte 共同使用\"\n }\n}",
|
||||||
"find_tip": "查找节点 ctrl f",
|
|
||||||
"find_tip_mac": "查找节点 ⌘ f",
|
|
||||||
"foldAll": "全部折叠",
|
"foldAll": "全部折叠",
|
||||||
"form_input_result": "用户完整输入结果",
|
"form_input_result": "用户完整输入结果",
|
||||||
"form_input_result_tip": "一个包含完整结果的对象",
|
"form_input_result_tip": "一个包含完整结果的对象",
|
||||||
@ -125,23 +123,18 @@
|
|||||||
"max_tokens": "最大 Tokens",
|
"max_tokens": "最大 Tokens",
|
||||||
"mouse_priority": "鼠标优先\n- 左键按下后可拖动画布\n- 按住 shift 后左键可批量选择",
|
"mouse_priority": "鼠标优先\n- 左键按下后可拖动画布\n- 按住 shift 后左键可批量选择",
|
||||||
"new_context": "新的上下文",
|
"new_context": "新的上下文",
|
||||||
"next": "下一个",
|
|
||||||
"no_match_node": "无结果",
|
|
||||||
"no_node_found": "未搜索到节点",
|
|
||||||
"not_contains": "不包含",
|
"not_contains": "不包含",
|
||||||
"only_the_reference_type_is_supported": "仅支持引用类型",
|
"only_the_reference_type_is_supported": "仅支持引用类型",
|
||||||
"optional_value_type": "可选的数据类型",
|
"optional_value_type": "可选的数据类型",
|
||||||
"optional_value_type_tip": "可以指定 1 个或多个数据类型,用户在动态添加字段时,仅可选择配置的类型",
|
"optional_value_type_tip": "可以指定 1 个或多个数据类型,用户在动态添加字段时,仅可选择配置的类型",
|
||||||
"pan_priority": "触摸板优先\n- 单击批量选择\n- 双指移动画布",
|
"pan_priority": "触摸板优先\n- 单击批量选择\n- 双指移动画布",
|
||||||
"pass_returned_object_as_output_to_next_nodes": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key",
|
"pass_returned_object_as_output_to_next_nodes": "将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key",
|
||||||
"please_enter_node_name": "请输入节点名称",
|
|
||||||
"plugin.Instruction_Tip": "可以配置一段说明,以解释该插件的用途。每次使用插件前,会显示该段说明。支持标准 Markdown 语法。",
|
"plugin.Instruction_Tip": "可以配置一段说明,以解释该插件的用途。每次使用插件前,会显示该段说明。支持标准 Markdown 语法。",
|
||||||
"plugin.Instructions": "使用说明",
|
"plugin.Instructions": "使用说明",
|
||||||
"plugin.global_file_input": "文件链接(弃用)",
|
"plugin.global_file_input": "文件链接(弃用)",
|
||||||
"plugin_file_abandon_tip": "插件全局文件上传已弃用,请尽快调整。可以通过插件输入,添加图片类型输入来实现相关功能。",
|
"plugin_file_abandon_tip": "插件全局文件上传已弃用,请尽快调整。可以通过插件输入,添加图片类型输入来实现相关功能。",
|
||||||
"plugin_input": "插件输入",
|
"plugin_input": "插件输入",
|
||||||
"plugin_output_tool": "插件作为工具执行时,该字段是否作为工具响应结果",
|
"plugin_output_tool": "插件作为工具执行时,该字段是否作为工具响应结果",
|
||||||
"previous": "上一个",
|
|
||||||
"question_classification": "问题分类",
|
"question_classification": "问题分类",
|
||||||
"question_optimization": "问题优化",
|
"question_optimization": "问题优化",
|
||||||
"quote_content_placeholder": "可以自定义引用内容的结构,以更好的适配不同场景。可以使用一些变量来进行模板配置\n{{q}} - 主要内容\n{{a}} - 辅助数据\n{{source}} - 来源名\n{{sourceId}} - 来源ID\n{{index}} - 第 n 个引用",
|
"quote_content_placeholder": "可以自定义引用内容的结构,以更好的适配不同场景。可以使用一些变量来进行模板配置\n{{q}} - 主要内容\n{{a}} - 辅助数据\n{{source}} - 来源名\n{{sourceId}} - 来源ID\n{{index}} - 第 n 个引用",
|
||||||
|
|||||||
@ -8,9 +8,6 @@
|
|||||||
"assign_permission": "權限變更",
|
"assign_permission": "權限變更",
|
||||||
"change_department_name": "部門編輯",
|
"change_department_name": "部門編輯",
|
||||||
"change_member_name": "成員改名",
|
"change_member_name": "成員改名",
|
||||||
"change_member_name_self": "變更成員名",
|
|
||||||
"change_notification_settings": "變更通知接收途徑",
|
|
||||||
"change_password": "更改密碼",
|
|
||||||
"confirm_delete_from_org": "確認將 {{username}} 移出部門?",
|
"confirm_delete_from_org": "確認將 {{username}} 移出部門?",
|
||||||
"confirm_delete_from_team": "確認將 {{username}} 移出團隊?",
|
"confirm_delete_from_team": "確認將 {{username}} 移出團隊?",
|
||||||
"confirm_delete_group": "確認刪除群組?",
|
"confirm_delete_group": "確認刪除群組?",
|
||||||
@ -18,29 +15,12 @@
|
|||||||
"confirm_forbidden": "確認停用",
|
"confirm_forbidden": "確認停用",
|
||||||
"confirm_leave_team": "確認離開該團隊? \n結束後,您在該團隊所有的資源轉讓給團隊所有者。",
|
"confirm_leave_team": "確認離開該團隊? \n結束後,您在該團隊所有的資源轉讓給團隊所有者。",
|
||||||
"copy_link": "複製連結",
|
"copy_link": "複製連結",
|
||||||
"create_api_key": "創建api密鑰",
|
|
||||||
"create_app": "創建應用",
|
|
||||||
"create_app_copy": "創建應用副本",
|
|
||||||
"create_app_folder": "創建應用文件夾",
|
|
||||||
"create_app_publish_channel": "創建分享渠道",
|
|
||||||
"create_data": "插入數據",
|
|
||||||
"create_dataset": "創建知識庫",
|
|
||||||
"create_dataset_folder": "創建知識庫文件夾",
|
|
||||||
"create_department": "創建子部門",
|
"create_department": "創建子部門",
|
||||||
"create_group": "建立群組",
|
"create_group": "建立群組",
|
||||||
"create_invitation_link": "建立邀請連結",
|
"create_invitation_link": "建立邀請連結",
|
||||||
"create_invoice": "開發票",
|
|
||||||
"create_org": "建立部門",
|
"create_org": "建立部門",
|
||||||
"create_sub_org": "建立子部門",
|
"create_sub_org": "建立子部門",
|
||||||
"delete": "刪除",
|
"delete": "刪除",
|
||||||
"delete_api_key": "刪除api密鑰",
|
|
||||||
"delete_app": "刪除工作台應用",
|
|
||||||
"delete_app_collaborator": "應用權限刪除",
|
|
||||||
"delete_app_publish_channel": "刪除發布渠道",
|
|
||||||
"delete_collection": "刪除集合",
|
|
||||||
"delete_data": "刪除數據",
|
|
||||||
"delete_dataset": "刪除知識庫",
|
|
||||||
"delete_dataset_collaborator": "知識庫權限刪除",
|
|
||||||
"delete_department": "刪除子部門",
|
"delete_department": "刪除子部門",
|
||||||
"delete_from_org": "移出部門",
|
"delete_from_org": "移出部門",
|
||||||
"delete_from_team": "移出團隊",
|
"delete_from_team": "移出團隊",
|
||||||
@ -51,9 +31,6 @@
|
|||||||
"edit_member_tip": "成員名",
|
"edit_member_tip": "成員名",
|
||||||
"edit_org_info": "編輯部門資訊",
|
"edit_org_info": "編輯部門資訊",
|
||||||
"expires": "過期時間",
|
"expires": "過期時間",
|
||||||
"export_app_chat_log": "導出應用聊天記錄",
|
|
||||||
"export_bill_records": "導出賬單記錄",
|
|
||||||
"export_dataset": "導出知識庫",
|
|
||||||
"export_members": "導出成員",
|
"export_members": "導出成員",
|
||||||
"forbid_hint": "停用後,該邀請連結將失效。該操作不可撤銷,是否確認停用?",
|
"forbid_hint": "停用後,該邀請連結將失效。該操作不可撤銷,是否確認停用?",
|
||||||
"forbid_success": "停用成功",
|
"forbid_success": "停用成功",
|
||||||
@ -79,69 +56,24 @@
|
|||||||
"log_assign_permission": "【{{name}}】更新了【{{objectName}}】的權限:[應用創建:【{{appCreate}}】, 知識庫:【{{datasetCreate}}】, API密鑰:【{{apiKeyCreate}}】, 管理:【{{manage}}】]",
|
"log_assign_permission": "【{{name}}】更新了【{{objectName}}】的權限:[應用創建:【{{appCreate}}】, 知識庫:【{{datasetCreate}}】, API密鑰:【{{apiKeyCreate}}】, 管理:【{{manage}}】]",
|
||||||
"log_change_department": "【{{name}}】更新了部門【{{departmentName}}】",
|
"log_change_department": "【{{name}}】更新了部門【{{departmentName}}】",
|
||||||
"log_change_member_name": "【{{name}}】將成員【{{memberName}}】重命名為【{{newName}}】",
|
"log_change_member_name": "【{{name}}】將成員【{{memberName}}】重命名為【{{newName}}】",
|
||||||
"log_change_member_name_self": "【{{name}}】變更自己的成員名為【{{newName}}】",
|
|
||||||
"log_change_notification_settings": "【{{name}}】進行了變更通知接收途徑操作",
|
|
||||||
"log_change_password": "【{{name}}】進行了變更密碼操作",
|
|
||||||
"log_create_api_key": "【{{name}}】創建了名為【{{keyName}}】的api密鑰",
|
|
||||||
"log_create_app": "【{{name}}】創建了名為【{{appName}}】的【{{appType}}】",
|
|
||||||
"log_create_app_copy": "【{{name}}】給名為【{{appName}}】的【{{appType}}】創建了一個副本",
|
|
||||||
"log_create_app_folder": "【{{name}}】創建了名為【{{folderName}}】的文件夾",
|
|
||||||
"log_create_app_publish_channel": "【{{name}}】給名為【{{appName}}】的【{{appType}}】創建了名為【{{channelName}}】的渠道",
|
|
||||||
"log_create_collection": "【{{name}}】在名為【{{datasetName}}】的【{{datasetType}}】創建了名為【{{collectionName}}】的集合",
|
|
||||||
"log_create_data": "【{{name}}】在名為【{{datasetName}}】的【{{datasetType}}】往名為【{{collectionName}}】的集合插入數據",
|
|
||||||
"log_create_dataset": "【{{name}}】創建了名為【{{datasetName}}】的【{{datasetType}}】",
|
|
||||||
"log_create_dataset_folder": "【{{name}}】創建了名為{{folderName}}】的文件夾",
|
|
||||||
"log_create_department": "【{{name}}】創建了部門【{{departmentName}}】",
|
"log_create_department": "【{{name}}】創建了部門【{{departmentName}}】",
|
||||||
"log_create_group": "【{{name}}】創建了群組【{{groupName}}】",
|
"log_create_group": "【{{name}}】創建了群組【{{groupName}}】",
|
||||||
"log_create_invitation_link": "【{{name}}】創建了邀請鏈接【{{link}}】",
|
"log_create_invitation_link": "【{{name}}】創建了邀請鏈接【{{link}}】",
|
||||||
"log_create_invoice": "【{{name}}】進行了開發票操作",
|
|
||||||
"log_delete_api_key": "【{{name}}】刪除了名為【{{keyName}}】的api密鑰",
|
|
||||||
"log_delete_app": "【{{name}}】將名為【{{appName}}】的【{{appType}}】刪除",
|
|
||||||
"log_delete_app_collaborator": "【{{name}}】將名為【{{appName}}】的【{{appType}}】中名為【{{itemValueName}}】的【{{itemName}}】權限刪除",
|
|
||||||
"log_delete_app_publish_channel": "【{{name}}】名為【{{appName}}】的【{{appType}}】刪除了名為【{{channelName}}】的渠道",
|
|
||||||
"log_delete_collection": "【{{name}}】在名為【{{datasetName}}】的【{{datasetType}}】刪除了名為【{{collectionName}}】的集合",
|
|
||||||
"log_delete_data": "【{{name}}】在名為【{{datasetName}}】的【{{datasetType}}】在名為【{{collectionName}}】的集合刪除數據",
|
|
||||||
"log_delete_dataset": "【{{name}}】刪除了名為【{{datasetName}}】的【{{datasetType}}】",
|
|
||||||
"log_delete_dataset_collaborator": "【{{name}}】將名為【{{datasetName}}】的【{{datasetType}}】中名為【itemValueName】的【itemName】權限刪除",
|
|
||||||
"log_delete_department": "{{name}} 刪除了部門 {{departmentName}}",
|
"log_delete_department": "{{name}} 刪除了部門 {{departmentName}}",
|
||||||
"log_delete_group": "{{name}} 刪除了群組 {{groupName}}",
|
"log_delete_group": "{{name}} 刪除了群組 {{groupName}}",
|
||||||
"log_details": "詳情",
|
"log_details": "詳情",
|
||||||
"log_export_app_chat_log": "【{{name}}】導出了名為【{{appName}}】的【{{appType}}】的聊天記錄",
|
|
||||||
"log_export_bill_records": "【{{name}}】導出了賬單記錄",
|
|
||||||
"log_export_dataset": "【{{name}}】導出了名為【{{datasetName}}】的【{{datasetType}}】",
|
|
||||||
"log_join_team": "【{{name}}】通過邀請鏈接【{{link}}】加入團隊",
|
"log_join_team": "【{{name}}】通過邀請鏈接【{{link}}】加入團隊",
|
||||||
"log_kick_out_team": "{{name}} 移除了成員 {{memberName}}",
|
"log_kick_out_team": "{{name}} 移除了成員 {{memberName}}",
|
||||||
"log_login": "【{{name}}】登錄了系統",
|
"log_login": "【{{name}}】登錄了系統",
|
||||||
"log_move_app": "【{{name}}】將名為【{{appName}}】的【{{appType}}】移動到【{{targetFolderName}}】",
|
|
||||||
"log_move_dataset": "【{{name}}】將名為【{{datasetName}}】的【{{datasetType}}】移動到【{{targetFolderName}}】",
|
|
||||||
"log_recover_team_member": "【{{name}}】恢復了成員【{{memberName}}】",
|
"log_recover_team_member": "【{{name}}】恢復了成員【{{memberName}}】",
|
||||||
"log_relocate_department": "【{{name}}】移動了部門【{{departmentName}}】",
|
"log_relocate_department": "【{{name}}】移動了部門【{{departmentName}}】",
|
||||||
"log_retrain_collection": "【{{name}}】在名為【{{datasetName}}】的【{{datasetType}}】重新訓練了名為【{{collectionName}}】的集合",
|
|
||||||
"log_search_test": "【{{name}}】在名為【{{datasetName}}】的【{{datasetType}}】執行搜索測試操作",
|
|
||||||
"log_set_invoice_header": "【{{name}}】進行了設置發票抬頭操作",
|
|
||||||
"log_time": "操作時間",
|
"log_time": "操作時間",
|
||||||
"log_transfer_app_ownership": "【{{name}}】將名為【{{appName}}】的【{{appType}}】的所有權從【{{oldOwnerName}}】轉移到【{{newOwnerName}}】",
|
|
||||||
"log_transfer_dataset_ownership": "【{{name}}】將名為【{{datasetName}}】的【{{datasetType}}】的所有權從【{{oldOwnerName}}】轉移到【{{newOwnerName}}】",
|
|
||||||
"log_type": "操作類型",
|
"log_type": "操作類型",
|
||||||
"log_update_api_key": "【{{name}}】更新了名為【{{keyName}}】的api密鑰",
|
|
||||||
"log_update_app_collaborator": "【{{name}}】將名為【{{appName}}】的【{{appType}}】的合作者更新為:組織:【{{orgList}}】,群組:【{{groupList}}】,成員【{{tmbList}}】;權限更新為:讀權限:【{{readPermission}}】,寫權限:【{{writePermission}}】,管理員權限:【{{managePermission}}】",
|
|
||||||
"log_update_app_info": "【{{name}}】更新了名為【{{appName}}】的【{{appType}}】:【{{newItemNames}}】為【{{newItemValues}}】",
|
|
||||||
"log_update_app_publish_channel": "【{{name}}】給名為【{{appName}}】的【{{appType}}】更新了名為【{{channelName}}】的渠道",
|
|
||||||
"log_update_collection": "【{{name}}】在名為【{{datasetName}}】的【{{datasetType}}】更新了名為【{{collectionName}}】的集合",
|
|
||||||
"log_update_data": "【{{name}}】在名為【{{datasetName}}】的【{{datasetType}}】在名為【{{collectionName}}】的集合更新數據",
|
|
||||||
"log_update_dataset": "【{{name}}】更新了名為【{{datasetName}}】的【{{datasetType}}】",
|
|
||||||
"log_update_dataset_collaborator": "【{{name}}】將名為【{{datasetName}}】的【{{datasetType}}】的合作者更新為:組織:【{{orgList}}】,群組:【{{groupList}}】,成員【{{tmbList}}】;權限更新為:【{{readPermission}}】,【{{writePermission}}】,【{{managePermission}}】",
|
|
||||||
"log_update_publish_app": "【{{name}}】【{{operationName}}】名為【{{appName}}】的【{{appType}}】",
|
|
||||||
"log_user": "操作人員",
|
"log_user": "操作人員",
|
||||||
"login": "登入",
|
"login": "登入",
|
||||||
"manage_member": "管理成員",
|
"manage_member": "管理成員",
|
||||||
"member": "成員",
|
"member": "成員",
|
||||||
"department": "部門",
|
|
||||||
"update": "更新",
|
|
||||||
"save_and_publish": "儲存並發布",
|
|
||||||
"member_group": "所屬成員組",
|
"member_group": "所屬成員組",
|
||||||
"move_app": "應用位置移動",
|
|
||||||
"move_dataset": "移動知識庫",
|
|
||||||
"move_member": "移動成員",
|
"move_member": "移動成員",
|
||||||
"move_org": "行動部門",
|
"move_org": "行動部門",
|
||||||
"notification_recieve": "團隊通知接收",
|
"notification_recieve": "團隊通知接收",
|
||||||
@ -160,7 +92,6 @@
|
|||||||
"permission_manage": "管理員",
|
"permission_manage": "管理員",
|
||||||
"permission_manage_tip": "可以管理成員、建立群組、管理所有群組、為群組和成員分配權限",
|
"permission_manage_tip": "可以管理成員、建立群組、管理所有群組、為群組和成員分配權限",
|
||||||
"please_bind_contact": "請綁定聯繫方式",
|
"please_bind_contact": "請綁定聯繫方式",
|
||||||
"purchase_plan": "升級套餐",
|
|
||||||
"recover_team_member": "成員恢復",
|
"recover_team_member": "成員恢復",
|
||||||
"relocate_department": "部門移動",
|
"relocate_department": "部門移動",
|
||||||
"remark": "備註",
|
"remark": "備註",
|
||||||
@ -168,45 +99,17 @@
|
|||||||
"restore_tip": "確認將 {{username}} 加入團隊嗎?\n僅恢復該成員賬號可用性及相關權限,無法恢復賬號下資源。",
|
"restore_tip": "確認將 {{username}} 加入團隊嗎?\n僅恢復該成員賬號可用性及相關權限,無法恢復賬號下資源。",
|
||||||
"restore_tip_title": "恢復確認",
|
"restore_tip_title": "恢復確認",
|
||||||
"retain_admin_permissions": "保留管理員權限",
|
"retain_admin_permissions": "保留管理員權限",
|
||||||
"retrain_collection": "重新訓練集合",
|
|
||||||
"search_log": "搜索日誌",
|
"search_log": "搜索日誌",
|
||||||
"search_member": "搜索成員",
|
"search_member": "搜索成員",
|
||||||
"search_member_group_name": "搜尋成員/群組名稱",
|
"search_member_group_name": "搜尋成員/群組名稱",
|
||||||
"search_org": "搜索部門",
|
"search_org": "搜索部門",
|
||||||
"search_test": "搜索測試",
|
|
||||||
"set_invoice_header": "設置發票抬頭",
|
|
||||||
"set_name_avatar": "團隊頭像",
|
"set_name_avatar": "團隊頭像",
|
||||||
"sync_immediately": "立即同步",
|
"sync_immediately": "立即同步",
|
||||||
"sync_member_failed": "同步成員失敗",
|
"sync_member_failed": "同步成員失敗",
|
||||||
"sync_member_success": "同步成員成功",
|
"sync_member_success": "同步成員成功",
|
||||||
"total_team_members": "共 {{amount}} 名成員",
|
"total_team_members": "共 {{amount}} 名成員",
|
||||||
"transfer_app_ownership": "轉移應用程式所有權",
|
|
||||||
"transfer_dataset_ownership": "轉移知識庫所有權",
|
|
||||||
"transfer_ownership": "轉讓所有者",
|
"transfer_ownership": "轉讓所有者",
|
||||||
"type.Folder": "資料夾",
|
|
||||||
"type.Http plugin": "HTTP 外掛",
|
|
||||||
"type.Plugin": "外掛",
|
|
||||||
"type.Simple bot": "簡易應用程式",
|
|
||||||
"type.Tool": "工具",
|
|
||||||
"type.Tool set": "工具集",
|
|
||||||
"type.Workflow bot": "工作流程",
|
|
||||||
"dataset.folder_dataset": "資料夾",
|
|
||||||
"dataset.common_dataset": "知識庫",
|
|
||||||
"dataset.website_dataset": "網站同步",
|
|
||||||
"dataset.external_file": "外部文件",
|
|
||||||
"dataset.api_file": "API 匯入",
|
|
||||||
"dataset.feishu_dataset": "飛書多維表格",
|
|
||||||
"dataset.yuque_dataset": "語雀知識庫",
|
|
||||||
"unlimited": "無限制",
|
"unlimited": "無限制",
|
||||||
"update_api_key": "更新api密鑰",
|
|
||||||
"update_app_collaborator": "應用權限更改",
|
|
||||||
"update_app_info": "應用信息修改",
|
|
||||||
"update_app_publish_channel": "更新發布渠道",
|
|
||||||
"update_collection": "更新集合",
|
|
||||||
"update_data": "更新數據",
|
|
||||||
"update_dataset": "更新知識庫",
|
|
||||||
"update_dataset_collaborator": "知識庫權限更改",
|
|
||||||
"update_publish_app": "應用更新",
|
|
||||||
"used_times_limit": "有效人數",
|
"used_times_limit": "有效人數",
|
||||||
"user_name": "使用者名稱",
|
"user_name": "使用者名稱",
|
||||||
"user_team_invite_member": "邀請成員",
|
"user_team_invite_member": "邀請成員",
|
||||||
|
|||||||
@ -198,9 +198,6 @@
|
|||||||
"type.MCP_tools_url": "MCP 地址",
|
"type.MCP_tools_url": "MCP 地址",
|
||||||
"type.Plugin": "外掛",
|
"type.Plugin": "外掛",
|
||||||
"type.Simple bot": "簡易應用程式",
|
"type.Simple bot": "簡易應用程式",
|
||||||
"type.Folder": "資料夾",
|
|
||||||
"type.Tool set": "工具集",
|
|
||||||
"type.Tool": "工具",
|
|
||||||
"type.Workflow bot": "工作流程",
|
"type.Workflow bot": "工作流程",
|
||||||
"type.error.Workflow data is empty": "沒有獲取到工作流數據",
|
"type.error.Workflow data is empty": "沒有獲取到工作流數據",
|
||||||
"type.error.workflowresponseempty": "響應內容為空",
|
"type.error.workflowresponseempty": "響應內容為空",
|
||||||
|
|||||||
@ -215,7 +215,6 @@
|
|||||||
"core.app.Interval timer run": "排程執行",
|
"core.app.Interval timer run": "排程執行",
|
||||||
"core.app.Interval timer tip": "可排程執行應用程式",
|
"core.app.Interval timer tip": "可排程執行應用程式",
|
||||||
"core.app.Make a brief introduction of your app": "為您的 AI 應用程式寫一段介紹",
|
"core.app.Make a brief introduction of your app": "為您的 AI 應用程式寫一段介紹",
|
||||||
"core.app.name": "名稱",
|
|
||||||
"core.app.Name and avatar": "頭像與名稱",
|
"core.app.Name and avatar": "頭像與名稱",
|
||||||
"core.app.Publish": "發布",
|
"core.app.Publish": "發布",
|
||||||
"core.app.Publish Confirm": "確認發布應用程式?這將立即更新所有發布管道的應用程式狀態。",
|
"core.app.Publish Confirm": "確認發布應用程式?這將立即更新所有發布管道的應用程式狀態。",
|
||||||
|
|||||||
@ -63,8 +63,6 @@
|
|||||||
"field_required": "必填",
|
"field_required": "必填",
|
||||||
"field_used_as_tool_input": "作為工具呼叫參數",
|
"field_used_as_tool_input": "作為工具呼叫參數",
|
||||||
"filter_description": "目前支援標籤和建立時間篩選,需按照以下格式填寫:\n{\n \"tags\": {\n \"$and\": [\"標籤 1\",\"標籤 2\"],\n \"$or\": [\"當有 $and 標籤時,$and 才會生效,$or 不會生效\"]\n },\n \"createTime\": {\n \"$gte\": \"YYYY-MM-DD HH:mm 格式,資料集的建立時間大於這個時間\",\n \"$lte\": \"YYYY-MM-DD HH:mm 格式,資料集的建立時間小於這個時間,可以和 $gte 一起使用\"\n }\n}",
|
"filter_description": "目前支援標籤和建立時間篩選,需按照以下格式填寫:\n{\n \"tags\": {\n \"$and\": [\"標籤 1\",\"標籤 2\"],\n \"$or\": [\"當有 $and 標籤時,$and 才會生效,$or 不會生效\"]\n },\n \"createTime\": {\n \"$gte\": \"YYYY-MM-DD HH:mm 格式,資料集的建立時間大於這個時間\",\n \"$lte\": \"YYYY-MM-DD HH:mm 格式,資料集的建立時間小於這個時間,可以和 $gte 一起使用\"\n }\n}",
|
||||||
"find_tip": "查找節點 ctrl f",
|
|
||||||
"find_tip_mac": "查找節點 ⌘ f",
|
|
||||||
"foldAll": "全部折疊",
|
"foldAll": "全部折疊",
|
||||||
"form_input_result": "使用者完整輸入結果",
|
"form_input_result": "使用者完整輸入結果",
|
||||||
"form_input_result_tip": "一個包含完整結果的物件",
|
"form_input_result_tip": "一個包含完整結果的物件",
|
||||||
@ -125,23 +123,18 @@
|
|||||||
"max_tokens": "最大 Token 數",
|
"max_tokens": "最大 Token 數",
|
||||||
"mouse_priority": "滑鼠優先\n- 按下左鍵拖曳畫布\n- 按住 Shift 鍵並點選左鍵可批次選取",
|
"mouse_priority": "滑鼠優先\n- 按下左鍵拖曳畫布\n- 按住 Shift 鍵並點選左鍵可批次選取",
|
||||||
"new_context": "新的脈絡",
|
"new_context": "新的脈絡",
|
||||||
"next": "下一個",
|
|
||||||
"no_match_node": "無結果",
|
|
||||||
"no_node_found": "未搜索到節點",
|
|
||||||
"not_contains": "不包含",
|
"not_contains": "不包含",
|
||||||
"only_the_reference_type_is_supported": "僅支援引用類型",
|
"only_the_reference_type_is_supported": "僅支援引用類型",
|
||||||
"optional_value_type": "可選的資料類型",
|
"optional_value_type": "可選的資料類型",
|
||||||
"optional_value_type_tip": "可以指定一或多個資料類型,使用者在動態新增欄位時,只能選擇已設定的類型",
|
"optional_value_type_tip": "可以指定一或多個資料類型,使用者在動態新增欄位時,只能選擇已設定的類型",
|
||||||
"pan_priority": "觸控板優先\n- 點選可批次選取\n- 使用兩指移動畫布",
|
"pan_priority": "觸控板優先\n- 點選可批次選取\n- 使用兩指移動畫布",
|
||||||
"pass_returned_object_as_output_to_next_nodes": "將程式碼中 return 的物件作為輸出,傳遞給後續的節點。變數名稱需要對應 return 的鍵值",
|
"pass_returned_object_as_output_to_next_nodes": "將程式碼中 return 的物件作為輸出,傳遞給後續的節點。變數名稱需要對應 return 的鍵值",
|
||||||
"please_enter_node_name": "請輸入節點名稱",
|
|
||||||
"plugin.Instruction_Tip": "您可以設定一段說明來解釋這個外掛程式的用途。每次使用外掛程式前,都會顯示這段說明。支援標準 Markdown 語法。",
|
"plugin.Instruction_Tip": "您可以設定一段說明來解釋這個外掛程式的用途。每次使用外掛程式前,都會顯示這段說明。支援標準 Markdown 語法。",
|
||||||
"plugin.Instructions": "使用說明",
|
"plugin.Instructions": "使用說明",
|
||||||
"plugin.global_file_input": "檔案連結(已淘汰)",
|
"plugin.global_file_input": "檔案連結(已淘汰)",
|
||||||
"plugin_file_abandon_tip": "外掛程式全域檔案上傳功能已淘汰,請儘速調整。您可以透過外掛程式輸入,新增圖片類型輸入來達成相關功能。",
|
"plugin_file_abandon_tip": "外掛程式全域檔案上傳功能已淘汰,請儘速調整。您可以透過外掛程式輸入,新增圖片類型輸入來達成相關功能。",
|
||||||
"plugin_input": "外掛程式輸入",
|
"plugin_input": "外掛程式輸入",
|
||||||
"plugin_output_tool": "外掛程式作為工具執行時,這個欄位是否作為工具的回應結果",
|
"plugin_output_tool": "外掛程式作為工具執行時,這個欄位是否作為工具的回應結果",
|
||||||
"previous": "上一個",
|
|
||||||
"question_classification": "問題分類",
|
"question_classification": "問題分類",
|
||||||
"question_optimization": "問題最佳化",
|
"question_optimization": "問題最佳化",
|
||||||
"quote_content_placeholder": "可以自訂引用內容的結構,以便更好地適應不同場景。可以使用一些變數來設定範本\n{{q}} - 主要內容\n{{a}} - 輔助資料\n{{source}} - 來源名稱\n{{sourceId}} - 來源 ID\n{{index}} - 第 n 個引用",
|
"quote_content_placeholder": "可以自訂引用內容的結構,以便更好地適應不同場景。可以使用一些變數來設定範本\n{{q}} - 主要內容\n{{a}} - 輔助資料\n{{source}} - 來源名稱\n{{sourceId}} - 來源 ID\n{{index}} - 第 n 個引用",
|
||||||
@ -184,9 +177,9 @@
|
|||||||
"text_content_extraction": "文字內容擷取",
|
"text_content_extraction": "文字內容擷取",
|
||||||
"text_to_extract": "要擷取的文字",
|
"text_to_extract": "要擷取的文字",
|
||||||
"these_variables_will_be_input_parameters_for_code_execution": "這些變數會作為程式碼執行的輸入參數",
|
"these_variables_will_be_input_parameters_for_code_execution": "這些變數會作為程式碼執行的輸入參數",
|
||||||
|
"tool.tool_result": "工具運行結果",
|
||||||
"to_add_node": "添加節點",
|
"to_add_node": "添加節點",
|
||||||
"to_connect_node": "連接節點",
|
"to_connect_node": "連接節點",
|
||||||
"tool.tool_result": "工具運行結果",
|
|
||||||
"tool_call_termination": "工具呼叫終止",
|
"tool_call_termination": "工具呼叫終止",
|
||||||
"tool_custom_field": "自訂工具變數",
|
"tool_custom_field": "自訂工具變數",
|
||||||
"tool_field": "工具參數設定",
|
"tool_field": "工具參數設定",
|
||||||
|
|||||||
7
plugins/webcrawler/SPIDER/package-lock.json
generated
7
plugins/webcrawler/SPIDER/package-lock.json
generated
@ -4992,10 +4992,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/tar-fs": {
|
"node_modules/tar-fs": {
|
||||||
"version": "3.0.9",
|
"version": "3.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.9.tgz",
|
"resolved": "https://registry.npmmirror.com/tar-fs/-/tar-fs-3.0.8.tgz",
|
||||||
"integrity": "sha512-XF4w9Xp+ZQgifKakjZYmFdkLoSWd34VGKcsTCwlNWM7QG3ZbaxnTsaBwnjFZqHRf/rROxaR8rXnbtwdvaDI+lA==",
|
"integrity": "sha512-ZoROL70jptorGAlgAYiLoBLItEKw/fUxg9BSYK/dF/GAGYFJOJJJMvjPAKDJraCXFwadD456FCuvLWgfhMsPwg==",
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"pump": "^3.0.0",
|
"pump": "^3.0.0",
|
||||||
"tar-stream": "^3.1.5"
|
"tar-stream": "^3.1.5"
|
||||||
|
|||||||
@ -29,6 +29,8 @@ MONGODB_LOG_URI=mongodb://username:password@0.0.0.0:27017/fastgpt?authSource=adm
|
|||||||
PG_URL=postgresql://username:password@host:port/postgres
|
PG_URL=postgresql://username:password@host:port/postgres
|
||||||
# OceanBase 向量库连接参数
|
# OceanBase 向量库连接参数
|
||||||
OCEANBASE_URL=
|
OCEANBASE_URL=
|
||||||
|
# openGauss 向量库连接参数
|
||||||
|
OPENGAUSS_URL=
|
||||||
# milvus 向量库连接参数
|
# milvus 向量库连接参数
|
||||||
MILVUS_ADDRESS=
|
MILVUS_ADDRESS=
|
||||||
MILVUS_TOKEN=
|
MILVUS_TOKEN=
|
||||||
|
|||||||
@ -85,10 +85,10 @@ RUN chown -R nextjs:nodejs /app/data
|
|||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
ENV PORT=3001
|
ENV PORT=3000
|
||||||
ENV NEXT_PUBLIC_BASE_URL=$base_url
|
ENV NEXT_PUBLIC_BASE_URL=$base_url
|
||||||
|
|
||||||
EXPOSE 3001
|
EXPOSE 3000
|
||||||
|
|
||||||
USER nextjs
|
USER nextjs
|
||||||
|
|
||||||
|
|||||||
@ -2,9 +2,7 @@
|
|||||||
{
|
{
|
||||||
"feConfigs": {
|
"feConfigs": {
|
||||||
"lafEnv": "https://laf.dev", // laf环境。 https://laf.run (杭州阿里云) ,或者私有化的laf环境。如果使用 Laf openapi 功能,需要最新版的 laf 。
|
"lafEnv": "https://laf.dev", // laf环境。 https://laf.run (杭州阿里云) ,或者私有化的laf环境。如果使用 Laf openapi 功能,需要最新版的 laf 。
|
||||||
"mcpServerProxyEndpoint": "", // mcp server 代理地址,例如: http://localhost:3005
|
"mcpServerProxyEndpoint": "" // mcp server 代理地址,例如: http://localhost:3005
|
||||||
"show_git":false,
|
|
||||||
"system_Title":"Test"
|
|
||||||
},
|
},
|
||||||
"systemEnv": {
|
"systemEnv": {
|
||||||
"vectorMaxProcess": 10, // 向量处理线程数量
|
"vectorMaxProcess": 10, // 向量处理线程数量
|
||||||
|
|||||||
@ -1,38 +0,0 @@
|
|||||||
version: '3.3'
|
|
||||||
|
|
||||||
services:
|
|
||||||
martin-gpt:
|
|
||||||
image: martingpt:v4.8.1 # 个人构建的镜像
|
|
||||||
container_name: martin-fastgpt
|
|
||||||
ports:
|
|
||||||
- '3001:3001'
|
|
||||||
networks:
|
|
||||||
- q00k04kgc8wk4k8okwog8owc_fastgpt
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
- FE_DOMAIN=
|
|
||||||
- DEFAULT_ROOT_PSW=Pllh@123
|
|
||||||
- 'AIPROXY_API_ENDPOINT=http://aiproxy:3000'
|
|
||||||
- AIPROXY_API_TOKEN=aiproxy
|
|
||||||
- DB_MAX_LINK=30
|
|
||||||
- TOKEN_KEY=any
|
|
||||||
- ROOT_KEY=root_key
|
|
||||||
- FILE_TOKEN_KEY=filetoken
|
|
||||||
- 'MONGODB_URI=mongodb://myusername:mypassword@mongo:27017/fastgpt?authSource=admin'
|
|
||||||
- 'PG_URL=postgresql://username:password@pg:5432/postgres'
|
|
||||||
- 'REDIS_URL=redis://default:mypassword@redis:6379'
|
|
||||||
- 'SANDBOX_URL=http://sandbox:3000'
|
|
||||||
- LOG_LEVEL=info
|
|
||||||
- STORE_LOG_LEVEL=warn
|
|
||||||
- WORKFLOW_MAX_RUN_TIMES=1000
|
|
||||||
- WORKFLOW_MAX_LOOP_TIMES=100
|
|
||||||
- ALLOWED_ORIGINS=
|
|
||||||
- USE_IP_LIMIT=false
|
|
||||||
- CHAT_FILE_EXPIRE_TIME=7
|
|
||||||
volumes:
|
|
||||||
- '/data/martingpt/config.json:/app/data/config.json'
|
|
||||||
|
|
||||||
networks:
|
|
||||||
q00k04kgc8wk4k8okwog8owc_fastgpt:
|
|
||||||
external: true # 声明使用外部网络
|
|
||||||
|
|
||||||
@ -3,9 +3,9 @@
|
|||||||
"version": "4.9.10",
|
"version": "4.9.10",
|
||||||
"private": false,
|
"private": false,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 3001",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start -p 3001",
|
"start": "next start",
|
||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@ -39,12 +39,6 @@ export async function register() {
|
|||||||
systemStartCb();
|
systemStartCb();
|
||||||
initGlobalVariables();
|
initGlobalVariables();
|
||||||
|
|
||||||
try {
|
|
||||||
await preLoadWorker();
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Preload worker error', error);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Connect to MongoDB
|
// Connect to MongoDB
|
||||||
await connectMongo(connectionMongo, MONGO_URL);
|
await connectMongo(connectionMongo, MONGO_URL);
|
||||||
connectMongo(connectionLogMongo, MONGO_LOG_URL);
|
connectMongo(connectionLogMongo, MONGO_LOG_URL);
|
||||||
@ -60,6 +54,12 @@ export async function register() {
|
|||||||
startCron();
|
startCron();
|
||||||
startTrainingQueue(true);
|
startTrainingQueue(true);
|
||||||
|
|
||||||
|
try {
|
||||||
|
await preLoadWorker();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Preload worker error', error);
|
||||||
|
}
|
||||||
|
|
||||||
console.log('Init system success');
|
console.log('Init system success');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@ -26,7 +26,6 @@ import MultipleSelect, {
|
|||||||
} from '@fastgpt/web/components/common/MySelect/MultipleSelect';
|
} from '@fastgpt/web/components/common/MySelect/MultipleSelect';
|
||||||
import Avatar from '@fastgpt/web/components/common/Avatar';
|
import Avatar from '@fastgpt/web/components/common/Avatar';
|
||||||
import { getTeamMembers } from '@/web/support/user/team/api';
|
import { getTeamMembers } from '@/web/support/user/team/api';
|
||||||
import { createMetadataProcessorMap, type MetadataProcessor } from './processors';
|
|
||||||
|
|
||||||
function OperationLogTable({ Tabs }: { Tabs: React.ReactNode }) {
|
function OperationLogTable({ Tabs }: { Tabs: React.ReactNode }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@ -59,14 +58,6 @@ function OperationLogTable({ Tabs }: { Tabs: React.ReactNode }) {
|
|||||||
[t]
|
[t]
|
||||||
);
|
);
|
||||||
|
|
||||||
const processMetadataByEvent = useMemo(() => {
|
|
||||||
const metadataProcessorMap = createMetadataProcessorMap();
|
|
||||||
return (event: string, metadata: any) => {
|
|
||||||
const processor = metadataProcessorMap[event as OperationLogEventEnum];
|
|
||||||
return processor ? processor(metadata, t) : metadata;
|
|
||||||
};
|
|
||||||
}, [t]);
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: operationLogs = [],
|
data: operationLogs = [],
|
||||||
isLoading: loadingLogs,
|
isLoading: loadingLogs,
|
||||||
@ -168,7 +159,17 @@ function OperationLogTable({ Tabs }: { Tabs: React.ReactNode }) {
|
|||||||
<Tbody>
|
<Tbody>
|
||||||
{operationLogs?.map((log) => {
|
{operationLogs?.map((log) => {
|
||||||
const i18nData = operationLogMap[log.event];
|
const i18nData = operationLogMap[log.event];
|
||||||
const metadata = processMetadataByEvent(log.event, { ...log.metadata });
|
const metadata = { ...log.metadata };
|
||||||
|
|
||||||
|
if (log.event === OperationLogEventEnum.ASSIGN_PERMISSION) {
|
||||||
|
const permissionValue = parseInt(metadata.permission, 10);
|
||||||
|
|
||||||
|
const permission = new TeamPermission({ per: permissionValue });
|
||||||
|
metadata.appCreate = permission.hasAppCreatePer ? '✔' : '✘';
|
||||||
|
metadata.datasetCreate = permission.hasDatasetCreatePer ? '✔' : '✘';
|
||||||
|
metadata.apiKeyCreate = permission.hasApikeyCreatePer ? '✔' : '✘';
|
||||||
|
metadata.manage = permission.hasManagePer ? '✔' : '✘';
|
||||||
|
}
|
||||||
|
|
||||||
return i18nData ? (
|
return i18nData ? (
|
||||||
<Tr key={log._id} overflow={'unset'}>
|
<Tr key={log._id} overflow={'unset'}>
|
||||||
|
|||||||
@ -1,17 +0,0 @@
|
|||||||
import { AppPermission } from '@fastgpt/global/support/permission/app/controller';
|
|
||||||
import { createSpecialProcessor } from './commonProcessor';
|
|
||||||
|
|
||||||
export const processUpdateAppCollaboratorSpecific = (metadata: any) => {
|
|
||||||
const permissionValue = parseInt(metadata.permission, 10);
|
|
||||||
const permission = new AppPermission({ per: permissionValue });
|
|
||||||
return {
|
|
||||||
...metadata,
|
|
||||||
readPermission: permission.hasReadPer ? '✔' : '✘',
|
|
||||||
writePermission: permission.hasWritePer ? '✔' : '✘',
|
|
||||||
managePermission: permission.hasManagePer ? '✔' : '✘'
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const createAppProcessors = () => ({
|
|
||||||
UPDATE_APP_COLLABORATOR: createSpecialProcessor(processUpdateAppCollaboratorSpecific)
|
|
||||||
});
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
export interface CommonMetadataFields {
|
|
||||||
appType?: string;
|
|
||||||
datasetType?: string;
|
|
||||||
operationName?: string;
|
|
||||||
itemName?: string;
|
|
||||||
newItemNames?: string[] | string;
|
|
||||||
[key: string]: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const defaultMetadataProcessor = (metadata: CommonMetadataFields, t: any): any => {
|
|
||||||
const result = { ...metadata };
|
|
||||||
|
|
||||||
const translatableFields = ['appType', 'datasetType', 'operationName', 'itemName'];
|
|
||||||
|
|
||||||
Object.entries(metadata)
|
|
||||||
.filter(([key, value]) => translatableFields.includes(key) && value)
|
|
||||||
.forEach(([key, value]) => {
|
|
||||||
result[key] = t(value as any);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (metadata.newItemNames) {
|
|
||||||
if (Array.isArray(metadata.newItemNames)) {
|
|
||||||
result.newItemNames = metadata.newItemNames
|
|
||||||
.map((itemName: string) => t(itemName as any))
|
|
||||||
.join(',');
|
|
||||||
} else if (typeof metadata.newItemNames === 'string') {
|
|
||||||
result.newItemNames = metadata.newItemNames
|
|
||||||
.split(',')
|
|
||||||
.map((itemName: string) => t(itemName as any))
|
|
||||||
.join(',');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const createSpecialProcessor = (specificProcessor: (metadata: any) => any) => {
|
|
||||||
return (metadata: any, t: any) => {
|
|
||||||
let processedMetadata = defaultMetadataProcessor(metadata, t);
|
|
||||||
processedMetadata = specificProcessor(processedMetadata);
|
|
||||||
return processedMetadata;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
import { DatasetPermission } from '@fastgpt/global/support/permission/dataset/controller';
|
|
||||||
import { createSpecialProcessor } from './commonProcessor';
|
|
||||||
|
|
||||||
export const processUpdateDatasetCollaboratorSpecific = (metadata: any) => {
|
|
||||||
const permissionValue = parseInt(metadata.permission, 10);
|
|
||||||
const permission = new DatasetPermission({ per: permissionValue });
|
|
||||||
return {
|
|
||||||
...metadata,
|
|
||||||
readPermission: permission.hasReadPer ? '✔' : '✘',
|
|
||||||
writePermission: permission.hasWritePer ? '✔' : '✘',
|
|
||||||
managePermission: permission.hasManagePer ? '✔' : '✘'
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const createDatasetProcessors = () => ({
|
|
||||||
UPDATE_DATASET_COLLABORATOR: createSpecialProcessor(processUpdateDatasetCollaboratorSpecific)
|
|
||||||
});
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
import { defaultMetadataProcessor } from './commonProcessor';
|
|
||||||
import { createTeamProcessors } from './teamProcessors';
|
|
||||||
import { createAppProcessors } from './appProcessors';
|
|
||||||
import { createDatasetProcessors } from './datasetProcessors';
|
|
||||||
|
|
||||||
export type MetadataProcessor = (metadata: any, t: any) => any;
|
|
||||||
|
|
||||||
export const createMetadataProcessorMap = (): Record<OperationLogEventEnum, MetadataProcessor> => {
|
|
||||||
const specialProcessors: Partial<Record<OperationLogEventEnum, MetadataProcessor>> = {
|
|
||||||
...createTeamProcessors(),
|
|
||||||
...createAppProcessors(),
|
|
||||||
...createDatasetProcessors()
|
|
||||||
};
|
|
||||||
|
|
||||||
const processorMap = {} as Record<OperationLogEventEnum, MetadataProcessor>;
|
|
||||||
|
|
||||||
Object.values(OperationLogEventEnum).forEach((event) => {
|
|
||||||
processorMap[event] =
|
|
||||||
specialProcessors[event] ||
|
|
||||||
((metadata: any, t: any) => defaultMetadataProcessor(metadata, t));
|
|
||||||
});
|
|
||||||
|
|
||||||
return processorMap;
|
|
||||||
};
|
|
||||||
|
|
||||||
export * from './commonProcessor';
|
|
||||||
export * from './teamProcessors';
|
|
||||||
export * from './appProcessors';
|
|
||||||
export * from './datasetProcessors';
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
import { TeamPermission } from '@fastgpt/global/support/permission/user/controller';
|
|
||||||
import { createSpecialProcessor } from './commonProcessor';
|
|
||||||
|
|
||||||
export const processAssignPermissionSpecific = (metadata: any) => {
|
|
||||||
const permissionValue = parseInt(metadata.permission, 10);
|
|
||||||
const permission = new TeamPermission({ per: permissionValue });
|
|
||||||
|
|
||||||
return {
|
|
||||||
...metadata,
|
|
||||||
appCreate: permission.hasAppCreatePer ? '✔' : '✘',
|
|
||||||
datasetCreate: permission.hasDatasetCreatePer ? '✔' : '✘',
|
|
||||||
apiKeyCreate: permission.hasApikeyCreatePer ? '✔' : '✘',
|
|
||||||
manage: permission.hasManagePer ? '✔' : '✘'
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const createTeamProcessors = () => ({
|
|
||||||
ASSIGN_PERMISSION: createSpecialProcessor(processAssignPermissionSpecific)
|
|
||||||
});
|
|
||||||
@ -25,20 +25,16 @@ import MyModal from '@fastgpt/web/components/common/MyModal';
|
|||||||
import { formatTime2YMDHMS } from '@fastgpt/global/common/string/time';
|
import { formatTime2YMDHMS } from '@fastgpt/global/common/string/time';
|
||||||
import { useToast } from '@fastgpt/web/hooks/useToast';
|
import { useToast } from '@fastgpt/web/hooks/useToast';
|
||||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||||
|
import SaveButton from '../Workflow/components/SaveButton';
|
||||||
import PublishHistories from '../PublishHistoriesSlider';
|
import PublishHistories from '../PublishHistoriesSlider';
|
||||||
import { WorkflowEventContext } from '../WorkflowComponents/context/workflowEventContext';
|
import { WorkflowEventContext } from '../WorkflowComponents/context/workflowEventContext';
|
||||||
import { WorkflowStatusContext } from '../WorkflowComponents/context/workflowStatusContext';
|
import { WorkflowStatusContext } from '../WorkflowComponents/context/workflowStatusContext';
|
||||||
import SaveButton from '../Workflow/components/SaveButton';
|
|
||||||
|
|
||||||
const Header = () => {
|
const Header = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { isPc } = useSystem();
|
const { isPc } = useSystem();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { toast: backSaveToast } = useToast({
|
const { toast } = useToast();
|
||||||
containerStyle: {
|
|
||||||
mt: '60px'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { appDetail, onSaveApp, currentTab } = useContextSelector(AppContext, (v) => v);
|
const { appDetail, onSaveApp, currentTab } = useContextSelector(AppContext, (v) => v);
|
||||||
const isV2Workflow = appDetail?.version === 'v2';
|
const isV2Workflow = appDetail?.version === 'v2';
|
||||||
@ -187,7 +183,6 @@ const Header = () => {
|
|||||||
size={'sm'}
|
size={'sm'}
|
||||||
leftIcon={<MyIcon name={'core/workflow/debug'} w={['14px', '16px']} />}
|
leftIcon={<MyIcon name={'core/workflow/debug'} w={['14px', '16px']} />}
|
||||||
variant={'whitePrimary'}
|
variant={'whitePrimary'}
|
||||||
flexShrink={0}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const data = flowData2StoreDataAndCheck();
|
const data = flowData2StoreDataAndCheck();
|
||||||
if (data) {
|
if (data) {
|
||||||
@ -216,12 +211,12 @@ const Header = () => {
|
|||||||
onBack,
|
onBack,
|
||||||
onOpenBackConfirm,
|
onOpenBackConfirm,
|
||||||
isV2Workflow,
|
isV2Workflow,
|
||||||
t,
|
|
||||||
showHistoryModal,
|
showHistoryModal,
|
||||||
|
t,
|
||||||
loading,
|
loading,
|
||||||
onClickSave,
|
onClickSave,
|
||||||
setShowHistoryModal,
|
|
||||||
flowData2StoreDataAndCheck,
|
flowData2StoreDataAndCheck,
|
||||||
|
setShowHistoryModal,
|
||||||
setWorkflowTestData
|
setWorkflowTestData
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -234,11 +229,10 @@ const Header = () => {
|
|||||||
setShowHistoryModal(false);
|
setShowHistoryModal(false);
|
||||||
}}
|
}}
|
||||||
past={past}
|
past={past}
|
||||||
onSwitchCloudVersion={onSwitchCloudVersion}
|
|
||||||
onSwitchTmpVersion={onSwitchTmpVersion}
|
onSwitchTmpVersion={onSwitchTmpVersion}
|
||||||
|
onSwitchCloudVersion={onSwitchCloudVersion}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<MyModal
|
<MyModal
|
||||||
isOpen={isOpenBackConfirm}
|
isOpen={isOpenBackConfirm}
|
||||||
onClose={onCloseBackConfirm}
|
onClose={onCloseBackConfirm}
|
||||||
@ -260,7 +254,7 @@ const Header = () => {
|
|||||||
await onClickSave({});
|
await onClickSave({});
|
||||||
onCloseBackConfirm();
|
onCloseBackConfirm();
|
||||||
onBack();
|
onBack();
|
||||||
backSaveToast({
|
toast({
|
||||||
status: 'success',
|
status: 'success',
|
||||||
title: t('app:saved_success'),
|
title: t('app:saved_success'),
|
||||||
position: 'top-right'
|
position: 'top-right'
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import { useTranslation } from 'next-i18next';
|
|||||||
|
|
||||||
import MyIcon from '@fastgpt/web/components/common/Icon';
|
import MyIcon from '@fastgpt/web/components/common/Icon';
|
||||||
import { useContextSelector } from 'use-context-selector';
|
import { useContextSelector } from 'use-context-selector';
|
||||||
import { WorkflowContext, type WorkflowSnapshotsType } from '../WorkflowComponents/context';
|
import { WorkflowContext } from '../WorkflowComponents/context';
|
||||||
import { AppContext, TabEnum } from '../context';
|
import { AppContext, TabEnum } from '../context';
|
||||||
import RouteTab from '../RouteTab';
|
import RouteTab from '../RouteTab';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
@ -25,10 +25,10 @@ import MyModal from '@fastgpt/web/components/common/MyModal';
|
|||||||
import { formatTime2YMDHMS } from '@fastgpt/global/common/string/time';
|
import { formatTime2YMDHMS } from '@fastgpt/global/common/string/time';
|
||||||
import { useToast } from '@fastgpt/web/hooks/useToast';
|
import { useToast } from '@fastgpt/web/hooks/useToast';
|
||||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||||
|
import SaveButton from './components/SaveButton';
|
||||||
import PublishHistories from '../PublishHistoriesSlider';
|
import PublishHistories from '../PublishHistoriesSlider';
|
||||||
import { WorkflowEventContext } from '../WorkflowComponents/context/workflowEventContext';
|
import { WorkflowEventContext } from '../WorkflowComponents/context/workflowEventContext';
|
||||||
import { WorkflowStatusContext } from '../WorkflowComponents/context/workflowStatusContext';
|
import { WorkflowStatusContext } from '../WorkflowComponents/context/workflowStatusContext';
|
||||||
import SaveButton from '../Workflow/components/SaveButton';
|
|
||||||
|
|
||||||
const Header = () => {
|
const Header = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@ -187,7 +187,6 @@ const Header = () => {
|
|||||||
size={'sm'}
|
size={'sm'}
|
||||||
leftIcon={<MyIcon name={'core/workflow/debug'} w={['14px', '16px']} />}
|
leftIcon={<MyIcon name={'core/workflow/debug'} w={['14px', '16px']} />}
|
||||||
variant={'whitePrimary'}
|
variant={'whitePrimary'}
|
||||||
flexShrink={0}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const data = flowData2StoreDataAndCheck();
|
const data = flowData2StoreDataAndCheck();
|
||||||
if (data) {
|
if (data) {
|
||||||
@ -216,12 +215,12 @@ const Header = () => {
|
|||||||
onBack,
|
onBack,
|
||||||
onOpenBackConfirm,
|
onOpenBackConfirm,
|
||||||
isV2Workflow,
|
isV2Workflow,
|
||||||
t,
|
|
||||||
showHistoryModal,
|
showHistoryModal,
|
||||||
|
t,
|
||||||
loading,
|
loading,
|
||||||
onClickSave,
|
onClickSave,
|
||||||
setShowHistoryModal,
|
|
||||||
flowData2StoreDataAndCheck,
|
flowData2StoreDataAndCheck,
|
||||||
|
setShowHistoryModal,
|
||||||
setWorkflowTestData
|
setWorkflowTestData
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -229,7 +228,7 @@ const Header = () => {
|
|||||||
<>
|
<>
|
||||||
{Render}
|
{Render}
|
||||||
{showHistoryModal && isV2Workflow && currentTab === TabEnum.appEdit && (
|
{showHistoryModal && isV2Workflow && currentTab === TabEnum.appEdit && (
|
||||||
<PublishHistories<WorkflowSnapshotsType>
|
<PublishHistories
|
||||||
onClose={() => {
|
onClose={() => {
|
||||||
setShowHistoryModal(false);
|
setShowHistoryModal(false);
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -43,7 +43,6 @@ const SaveButton = ({
|
|||||||
Trigger={
|
Trigger={
|
||||||
<Button
|
<Button
|
||||||
size={'sm'}
|
size={'sm'}
|
||||||
flexShrink={0}
|
|
||||||
rightIcon={
|
rightIcon={
|
||||||
<MyIcon
|
<MyIcon
|
||||||
name={isSave ? 'core/chat/chevronUp' : 'core/chat/chevronDown'}
|
name={isSave ? 'core/chat/chevronUp' : 'core/chat/chevronDown'}
|
||||||
|
|||||||
@ -1,220 +0,0 @@
|
|||||||
import React, { useState, useCallback } from 'react';
|
|
||||||
import { Box, Flex, Button, IconButton, type ButtonProps, Input } from '@chakra-ui/react';
|
|
||||||
import { useTranslation } from 'next-i18next';
|
|
||||||
import { useContextSelector } from 'use-context-selector';
|
|
||||||
import { WorkflowNodeEdgeContext } from '../../WorkflowComponents/context/workflowInitContext';
|
|
||||||
import { useReactFlow } from 'reactflow';
|
|
||||||
import { useKeyPress, useThrottleEffect } from 'ahooks';
|
|
||||||
import MyIcon from '@fastgpt/web/components/common/Icon';
|
|
||||||
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
|
|
||||||
import { useSystem } from '@fastgpt/web/hooks/useSystem';
|
|
||||||
|
|
||||||
const SearchButton = (props: ButtonProps) => {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const setNodes = useContextSelector(WorkflowNodeEdgeContext, (state) => state.setNodes);
|
|
||||||
const { fitView } = useReactFlow();
|
|
||||||
const { isMac } = useSystem();
|
|
||||||
|
|
||||||
const [keyword, setKeyword] = useState<string>();
|
|
||||||
const [searchIndex, setSearchIndex] = useState<number>(0);
|
|
||||||
const [searchedNodeCount, setSearchedNodeCount] = useState(0);
|
|
||||||
|
|
||||||
useKeyPress(['ctrl.f', 'meta.f'], (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
setKeyword('');
|
|
||||||
});
|
|
||||||
useKeyPress(['esc'], (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
setKeyword(undefined);
|
|
||||||
});
|
|
||||||
|
|
||||||
const onSearch = useCallback(() => {
|
|
||||||
setNodes((nodes) => {
|
|
||||||
if (!keyword) {
|
|
||||||
setSearchIndex(0);
|
|
||||||
setSearchedNodeCount(0);
|
|
||||||
return nodes.map((node) => ({
|
|
||||||
...node,
|
|
||||||
data: {
|
|
||||||
...node.data,
|
|
||||||
searchedText: undefined
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
const searchResult = nodes.filter((node) => {
|
|
||||||
const nodeName = t(node.data.name as any);
|
|
||||||
return nodeName.toLowerCase().includes(keyword.toLowerCase());
|
|
||||||
});
|
|
||||||
|
|
||||||
if (searchResult.length === 0) {
|
|
||||||
return nodes.map((node) => ({
|
|
||||||
...node,
|
|
||||||
data: {
|
|
||||||
...node.data,
|
|
||||||
searchedText: undefined
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
setSearchedNodeCount(searchResult.length);
|
|
||||||
|
|
||||||
const searchedNode = searchResult[searchIndex] ?? searchResult[0];
|
|
||||||
|
|
||||||
if (searchedNode) {
|
|
||||||
fitView({ nodes: [searchedNode], padding: 0.4 });
|
|
||||||
}
|
|
||||||
|
|
||||||
return nodes.map((node) => ({
|
|
||||||
...node,
|
|
||||||
selected: node.id === searchedNode.id,
|
|
||||||
data: {
|
|
||||||
...node.data,
|
|
||||||
searchedText: searchResult.find((item) => item.id === node.id) ? keyword : undefined
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
}, [keyword, searchIndex]);
|
|
||||||
|
|
||||||
useThrottleEffect(
|
|
||||||
() => {
|
|
||||||
onSearch();
|
|
||||||
},
|
|
||||||
[onSearch],
|
|
||||||
{
|
|
||||||
wait: 500
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
const goToNextMatch = useCallback(() => {
|
|
||||||
if (searchIndex === searchedNodeCount - 1) {
|
|
||||||
setSearchIndex(0);
|
|
||||||
} else {
|
|
||||||
setSearchIndex(searchIndex + 1);
|
|
||||||
}
|
|
||||||
}, [searchIndex, searchedNodeCount]);
|
|
||||||
|
|
||||||
const goToPreviousMatch = useCallback(() => {
|
|
||||||
if (searchIndex === 0) {
|
|
||||||
setSearchIndex(searchedNodeCount - 1);
|
|
||||||
} else {
|
|
||||||
setSearchIndex(searchIndex - 1);
|
|
||||||
}
|
|
||||||
}, [searchIndex, searchedNodeCount]);
|
|
||||||
|
|
||||||
const clearSearch = useCallback(() => {
|
|
||||||
setKeyword(undefined);
|
|
||||||
setSearchIndex(0);
|
|
||||||
setSearchedNodeCount(0);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
if (keyword === undefined) {
|
|
||||||
return (
|
|
||||||
<Box position={'absolute'} top={'72px'} left={6} zIndex={1}>
|
|
||||||
<MyTooltip label={isMac ? t('workflow:find_tip_mac') : t('workflow:find_tip')}>
|
|
||||||
<IconButton
|
|
||||||
icon={<MyIcon name="common/searchLight" w="20px" color={'#8A95A7'} />}
|
|
||||||
aria-label=""
|
|
||||||
variant="whitePrimary"
|
|
||||||
size={'mdSquare'}
|
|
||||||
borderRadius={'50%'}
|
|
||||||
bg={'white'}
|
|
||||||
_hover={{ bg: 'white', borderColor: 'primary.300' }}
|
|
||||||
boxShadow={'0px 4px 10px 0px rgba(19, 51, 107, 0.20)'}
|
|
||||||
{...props}
|
|
||||||
onClick={() => setKeyword('')}
|
|
||||||
/>
|
|
||||||
</MyTooltip>
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Flex
|
|
||||||
position="absolute"
|
|
||||||
top={3}
|
|
||||||
left="50%"
|
|
||||||
transform="translateX(-50%)"
|
|
||||||
pl={5}
|
|
||||||
pr={4}
|
|
||||||
py={4}
|
|
||||||
zIndex={1}
|
|
||||||
borderRadius={'lg'}
|
|
||||||
bg={'white'}
|
|
||||||
alignItems={'center'}
|
|
||||||
boxShadow={
|
|
||||||
'0px 20px 24px -8px rgba(19, 51, 107, 0.15), 0px 0px 1px 0px rgba(19, 51, 107, 0.15)'
|
|
||||||
}
|
|
||||||
border={'0.5px solid rgba(0, 0, 0, 0.13)'}
|
|
||||||
maxW={['90vw', '550px']}
|
|
||||||
w={'100%'}
|
|
||||||
>
|
|
||||||
<Input
|
|
||||||
flex="1 0 0"
|
|
||||||
h={8}
|
|
||||||
border={'none'}
|
|
||||||
px={0}
|
|
||||||
_focus={{
|
|
||||||
border: 'none',
|
|
||||||
boxShadow: 'none'
|
|
||||||
}}
|
|
||||||
fontSize={'16px'}
|
|
||||||
value={keyword}
|
|
||||||
placeholder={t('workflow:please_enter_node_name')}
|
|
||||||
autoFocus
|
|
||||||
onFocus={onSearch}
|
|
||||||
onChange={(e) => setKeyword(e.target.value)}
|
|
||||||
onKeyDown={(e) => {
|
|
||||||
if (e.key === 'Enter') {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
goToNextMatch();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Box fontSize="sm" color="myGray.600" whiteSpace={'nowrap'} userSelect={'none'}>
|
|
||||||
{searchedNodeCount > 0
|
|
||||||
? `${searchIndex + 1} / ${searchedNodeCount}`
|
|
||||||
: t('workflow:no_match_node')}
|
|
||||||
</Box>
|
|
||||||
|
|
||||||
{/* Border */}
|
|
||||||
<Box h={5} w={'1px'} bg={'myGray.250'} ml={3} mr={2} />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
size="xs"
|
|
||||||
variant="grayGhost"
|
|
||||||
px={2}
|
|
||||||
isDisabled={searchedNodeCount <= 1}
|
|
||||||
onClick={goToPreviousMatch}
|
|
||||||
>
|
|
||||||
{t('workflow:previous')}
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
size="xs"
|
|
||||||
variant="grayGhost"
|
|
||||||
px={2}
|
|
||||||
isDisabled={searchedNodeCount <= 1}
|
|
||||||
onClick={goToNextMatch}
|
|
||||||
>
|
|
||||||
{t('workflow:next')}
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
<Flex
|
|
||||||
ml={2}
|
|
||||||
borderRadius="sm"
|
|
||||||
_hover={{ bg: 'myGray.100' }}
|
|
||||||
p={'1'}
|
|
||||||
cursor="pointer"
|
|
||||||
onClick={clearSearch}
|
|
||||||
>
|
|
||||||
<MyIcon name="common/closeLight" w="1.2rem" />
|
|
||||||
</Flex>
|
|
||||||
</Flex>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default React.memo(SearchButton);
|
|
||||||
@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactFlow, { type NodeProps, SelectionMode } from 'reactflow';
|
import ReactFlow, { type NodeProps, SelectionMode } from 'reactflow';
|
||||||
import { Box, IconButton, useDisclosure } from '@chakra-ui/react';
|
import { Box, IconButton, useDisclosure } from '@chakra-ui/react';
|
||||||
|
import { SmallCloseIcon } from '@chakra-ui/icons';
|
||||||
import { EDGE_TYPE, FlowNodeTypeEnum } from '@fastgpt/global/core/workflow/node/constant';
|
import { EDGE_TYPE, FlowNodeTypeEnum } from '@fastgpt/global/core/workflow/node/constant';
|
||||||
|
|
||||||
import dynamic from 'next/dynamic';
|
import dynamic from 'next/dynamic';
|
||||||
@ -19,8 +20,6 @@ import ContextMenu from './components/ContextMenu';
|
|||||||
import { WorkflowNodeEdgeContext, WorkflowInitContext } from '../context/workflowInitContext';
|
import { WorkflowNodeEdgeContext, WorkflowInitContext } from '../context/workflowInitContext';
|
||||||
import { WorkflowEventContext } from '../context/workflowEventContext';
|
import { WorkflowEventContext } from '../context/workflowEventContext';
|
||||||
import NodeTemplatesPopover from './NodeTemplatesPopover';
|
import NodeTemplatesPopover from './NodeTemplatesPopover';
|
||||||
import SearchButton from '../../Workflow/components/SearchButton';
|
|
||||||
import MyIcon from '@fastgpt/web/components/common/Icon';
|
|
||||||
|
|
||||||
const NodeSimple = dynamic(() => import('./nodes/NodeSimple'));
|
const NodeSimple = dynamic(() => import('./nodes/NodeSimple'));
|
||||||
const nodeTypes: Record<FlowNodeTypeEnum, any> = {
|
const nodeTypes: Record<FlowNodeTypeEnum, any> = {
|
||||||
@ -114,22 +113,20 @@ const Workflow = () => {
|
|||||||
<>
|
<>
|
||||||
<IconButton
|
<IconButton
|
||||||
position={'absolute'}
|
position={'absolute'}
|
||||||
top={6}
|
top={5}
|
||||||
left={6}
|
left={5}
|
||||||
size={'mdSquare'}
|
size={'mdSquare'}
|
||||||
borderRadius={'50%'}
|
borderRadius={'50%'}
|
||||||
icon={<MyIcon name="common/addLight" w={'26px'} />}
|
icon={<SmallCloseIcon fontSize={'26px'} />}
|
||||||
|
transform={isOpenTemplate ? '' : 'rotate(135deg)'}
|
||||||
transition={'0.2s ease'}
|
transition={'0.2s ease'}
|
||||||
aria-label={''}
|
aria-label={''}
|
||||||
zIndex={1}
|
zIndex={1}
|
||||||
boxShadow={
|
boxShadow={'2px 2px 6px #85b1ff'}
|
||||||
'0px 4px 10px 0px rgba(19, 51, 107, 0.20), 0px 0px 1px 0px rgba(19, 51, 107, 0.50)'
|
|
||||||
}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
isOpenTemplate ? onCloseTemplate() : onOpenTemplate();
|
isOpenTemplate ? onCloseTemplate() : onOpenTemplate();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<SearchButton />
|
|
||||||
<NodeTemplatesModal isOpen={isOpenTemplate} onClose={onCloseTemplate} />
|
<NodeTemplatesModal isOpen={isOpenTemplate} onClose={onCloseTemplate} />
|
||||||
<NodeTemplatesPopover />
|
<NodeTemplatesPopover />
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -36,7 +36,6 @@ import MyTag from '@fastgpt/web/components/common/Tag/index';
|
|||||||
import MySelect from '@fastgpt/web/components/common/MySelect';
|
import MySelect from '@fastgpt/web/components/common/MySelect';
|
||||||
import { useCreation } from 'ahooks';
|
import { useCreation } from 'ahooks';
|
||||||
import { formatToolError } from '@fastgpt/global/core/app/utils';
|
import { formatToolError } from '@fastgpt/global/core/app/utils';
|
||||||
import HighlightText from '@fastgpt/web/components/common/String/HighlightText';
|
|
||||||
|
|
||||||
type Props = FlowNodeItemType & {
|
type Props = FlowNodeItemType & {
|
||||||
children?: React.ReactNode | React.ReactNode[] | string;
|
children?: React.ReactNode | React.ReactNode[] | string;
|
||||||
@ -46,7 +45,6 @@ type Props = FlowNodeItemType & {
|
|||||||
w?: string | number;
|
w?: string | number;
|
||||||
h?: string | number;
|
h?: string | number;
|
||||||
selected?: boolean;
|
selected?: boolean;
|
||||||
searchedText?: string;
|
|
||||||
menuForbid?: {
|
menuForbid?: {
|
||||||
debug?: boolean;
|
debug?: boolean;
|
||||||
copy?: boolean;
|
copy?: boolean;
|
||||||
@ -72,7 +70,6 @@ const NodeCard = (props: Props) => {
|
|||||||
h = 'full',
|
h = 'full',
|
||||||
nodeId,
|
nodeId,
|
||||||
selected,
|
selected,
|
||||||
searchedText,
|
|
||||||
menuForbid,
|
menuForbid,
|
||||||
isTool = false,
|
isTool = false,
|
||||||
isError = false,
|
isError = false,
|
||||||
@ -190,12 +187,7 @@ const NodeCard = (props: Props) => {
|
|||||||
h={'24px'}
|
h={'24px'}
|
||||||
/>
|
/>
|
||||||
<Box ml={2} fontSize={'18px'} fontWeight={'medium'} color={'myGray.900'}>
|
<Box ml={2} fontSize={'18px'} fontWeight={'medium'} color={'myGray.900'}>
|
||||||
<HighlightText
|
{t(name as any)}
|
||||||
rawText={t(name as any)}
|
|
||||||
matchText={searchedText ?? ''}
|
|
||||||
mode={'bg'}
|
|
||||||
color={'#ffe82d'}
|
|
||||||
/>
|
|
||||||
</Box>
|
</Box>
|
||||||
<Button
|
<Button
|
||||||
display={'none'}
|
display={'none'}
|
||||||
@ -288,7 +280,6 @@ const NodeCard = (props: Props) => {
|
|||||||
nodeId,
|
nodeId,
|
||||||
isFolded,
|
isFolded,
|
||||||
avatar,
|
avatar,
|
||||||
searchedText,
|
|
||||||
t,
|
t,
|
||||||
name,
|
name,
|
||||||
showVersion,
|
showVersion,
|
||||||
|
|||||||
@ -49,7 +49,7 @@ const CustomTextInput = () => {
|
|||||||
createStatus: 'waiting',
|
createStatus: 'waiting',
|
||||||
rawText: data.value,
|
rawText: data.value,
|
||||||
sourceName: data.name,
|
sourceName: data.name,
|
||||||
icon: 'file/fill/txt'
|
icon: 'file/fill/manual'
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
goToNext();
|
goToNext();
|
||||||
|
|||||||
@ -165,7 +165,7 @@ const FormLayout = ({ children, setPageType, pageType }: Props) => {
|
|||||||
<MyImage src={LOGO_ICON} w={['22.5px', '36px']} alt={'icon'} />
|
<MyImage src={LOGO_ICON} w={['22.5px', '36px']} alt={'icon'} />
|
||||||
</Flex>
|
</Flex>
|
||||||
<Box ml={[3, 5]} fontSize={['lg', 'xl']} fontWeight={'bold'} color={'myGray.900'}>
|
<Box ml={[3, 5]} fontSize={['lg', 'xl']} fontWeight={'bold'} color={'myGray.900'}>
|
||||||
测试FastGPT
|
{feConfigs?.systemTitle}
|
||||||
</Box>
|
</Box>
|
||||||
</Flex>
|
</Flex>
|
||||||
{!isPc && <I18nLngSelector />}
|
{!isPc && <I18nLngSelector />}
|
||||||
|
|||||||
@ -5,10 +5,7 @@ import { authApp } from '@fastgpt/service/support/permission/app/auth';
|
|||||||
import { authUserPer } from '@fastgpt/service/support/permission/user/auth';
|
import { authUserPer } from '@fastgpt/service/support/permission/user/auth';
|
||||||
import type { ApiRequestProps, ApiResponseType } from '@fastgpt/service/type/next';
|
import type { ApiRequestProps, ApiResponseType } from '@fastgpt/service/type/next';
|
||||||
import { onCreateApp } from './create';
|
import { onCreateApp } from './create';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
|
|
||||||
import { getI18nAppType } from '@fastgpt/service/support/operationLog/util';
|
|
||||||
export type copyAppQuery = {};
|
export type copyAppQuery = {};
|
||||||
|
|
||||||
export type copyAppBody = { appId: string };
|
export type copyAppBody = { appId: string };
|
||||||
@ -21,7 +18,7 @@ async function handler(
|
|||||||
req: ApiRequestProps<copyAppBody, copyAppQuery>,
|
req: ApiRequestProps<copyAppBody, copyAppQuery>,
|
||||||
res: ApiResponseType<any>
|
res: ApiResponseType<any>
|
||||||
): Promise<copyAppResponse> {
|
): Promise<copyAppResponse> {
|
||||||
const { app, teamId } = await authApp({
|
const { app } = await authApp({
|
||||||
req,
|
req,
|
||||||
authToken: true,
|
authToken: true,
|
||||||
per: WritePermissionVal,
|
per: WritePermissionVal,
|
||||||
@ -45,17 +42,6 @@ async function handler(
|
|||||||
tmbId,
|
tmbId,
|
||||||
pluginData: app.pluginData
|
pluginData: app.pluginData
|
||||||
});
|
});
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.CREATE_APP_COPY,
|
|
||||||
params: {
|
|
||||||
appName: app.name,
|
|
||||||
appType: getI18nAppType(app.type)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
|
|
||||||
return { appId };
|
return { appId };
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,9 +19,6 @@ import { checkTeamAppLimit } from '@fastgpt/service/support/permission/teamLimit
|
|||||||
import { authUserPer } from '@fastgpt/service/support/permission/user/auth';
|
import { authUserPer } from '@fastgpt/service/support/permission/user/auth';
|
||||||
import { MongoTeamMember } from '@fastgpt/service/support/user/team/teamMemberSchema';
|
import { MongoTeamMember } from '@fastgpt/service/support/user/team/teamMemberSchema';
|
||||||
import { type ApiRequestProps } from '@fastgpt/service/type/next';
|
import { type ApiRequestProps } from '@fastgpt/service/type/next';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
import { getI18nAppType } from '@fastgpt/service/support/operationLog/util';
|
|
||||||
|
|
||||||
export type CreateAppBody = {
|
export type CreateAppBody = {
|
||||||
parentId?: ParentIdType;
|
parentId?: ParentIdType;
|
||||||
@ -151,17 +148,6 @@ export const onCreateApp = async ({
|
|||||||
{ session, ordered: true }
|
{ session, ordered: true }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.CREATE_APP,
|
|
||||||
params: {
|
|
||||||
appName: name!,
|
|
||||||
appType: getI18nAppType(type!)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
|
|
||||||
await refreshSourceAvatar(avatar, undefined, session);
|
await refreshSourceAvatar(avatar, undefined, session);
|
||||||
|
|
||||||
|
|||||||
@ -19,10 +19,7 @@ import { deleteChatFiles } from '@fastgpt/service/core/chat/controller';
|
|||||||
import { pushTrack } from '@fastgpt/service/common/middle/tracks/utils';
|
import { pushTrack } from '@fastgpt/service/common/middle/tracks/utils';
|
||||||
import { MongoOpenApi } from '@fastgpt/service/support/openapi/schema';
|
import { MongoOpenApi } from '@fastgpt/service/support/openapi/schema';
|
||||||
import { removeImageByPath } from '@fastgpt/service/common/file/image/controller';
|
import { removeImageByPath } from '@fastgpt/service/common/file/image/controller';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
|
|
||||||
import { getI18nAppType } from '@fastgpt/service/support/operationLog/util';
|
|
||||||
async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
|
async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
|
||||||
const { appId } = req.query as { appId: string };
|
const { appId } = req.query as { appId: string };
|
||||||
|
|
||||||
@ -42,17 +39,6 @@ async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
|
|||||||
teamId,
|
teamId,
|
||||||
appId
|
appId
|
||||||
});
|
});
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.DELETE_APP,
|
|
||||||
params: {
|
|
||||||
appName: app.name,
|
|
||||||
appType: getI18nAppType(app.type)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
|
|
||||||
// Tracks
|
// Tracks
|
||||||
pushTrack.countAppNodes({ teamId, tmbId, uid: userId, appId });
|
pushTrack.countAppNodes({ teamId, tmbId, uid: userId, appId });
|
||||||
|
|||||||
@ -18,8 +18,7 @@ import { syncCollaborators } from '@fastgpt/service/support/permission/inheritPe
|
|||||||
import { MongoResourcePermission } from '@fastgpt/service/support/permission/schema';
|
import { MongoResourcePermission } from '@fastgpt/service/support/permission/schema';
|
||||||
import { authUserPer } from '@fastgpt/service/support/permission/user/auth';
|
import { authUserPer } from '@fastgpt/service/support/permission/user/auth';
|
||||||
import { type ApiRequestProps } from '@fastgpt/service/type/next';
|
import { type ApiRequestProps } from '@fastgpt/service/type/next';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
export type CreateAppFolderBody = {
|
export type CreateAppFolderBody = {
|
||||||
parentId?: ParentIdType;
|
parentId?: ParentIdType;
|
||||||
name: string;
|
name: string;
|
||||||
@ -84,16 +83,6 @@ async function handler(req: ApiRequestProps<CreateAppFolderBody>) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.CREATE_APP_FOLDER,
|
|
||||||
params: {
|
|
||||||
folderName: name
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NextAPI(handler);
|
export default NextAPI(handler);
|
||||||
|
|||||||
@ -13,9 +13,6 @@ import { parsePaginationRequest } from '@fastgpt/service/common/api/pagination';
|
|||||||
import { type PaginationResponse } from '@fastgpt/web/common/fetch/type';
|
import { type PaginationResponse } from '@fastgpt/web/common/fetch/type';
|
||||||
import { addSourceMember } from '@fastgpt/service/support/user/utils';
|
import { addSourceMember } from '@fastgpt/service/support/user/utils';
|
||||||
import { replaceRegChars } from '@fastgpt/global/common/string/tools';
|
import { replaceRegChars } from '@fastgpt/global/common/string/tools';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
import { getI18nAppType } from '@fastgpt/service/support/operationLog/util';
|
|
||||||
|
|
||||||
async function handler(
|
async function handler(
|
||||||
req: NextApiRequest,
|
req: NextApiRequest,
|
||||||
@ -36,12 +33,7 @@ async function handler(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 凭证校验
|
// 凭证校验
|
||||||
const { teamId, tmbId, app } = await authApp({
|
const { teamId } = await authApp({ req, authToken: true, appId, per: WritePermissionVal });
|
||||||
req,
|
|
||||||
authToken: true,
|
|
||||||
appId,
|
|
||||||
per: WritePermissionVal
|
|
||||||
});
|
|
||||||
|
|
||||||
const where = {
|
const where = {
|
||||||
teamId: new Types.ObjectId(teamId),
|
teamId: new Types.ObjectId(teamId),
|
||||||
@ -147,18 +139,6 @@ async function handler(
|
|||||||
|
|
||||||
const listWithoutTmbId = list.filter((item) => !item.tmbId);
|
const listWithoutTmbId = list.filter((item) => !item.tmbId);
|
||||||
|
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.EXPORT_APP_CHAT_LOG,
|
|
||||||
params: {
|
|
||||||
appName: app.name,
|
|
||||||
appType: getI18nAppType(app.type)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
list: listWithSourceMember.concat(listWithoutTmbId),
|
list: listWithSourceMember.concat(listWithoutTmbId),
|
||||||
total
|
total
|
||||||
|
|||||||
@ -138,20 +138,18 @@ async function handler(req: ApiRequestProps<ListAppBody>): Promise<AppListItemTy
|
|||||||
})();
|
})();
|
||||||
const limit = (() => {
|
const limit = (() => {
|
||||||
if (getRecentlyChat) return 15;
|
if (getRecentlyChat) return 15;
|
||||||
if (searchKey) return 50;
|
if (searchKey) return 20;
|
||||||
return;
|
return 1000;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
const myApps = await MongoApp.find(
|
const myApps = await MongoApp.find(
|
||||||
findAppsQuery,
|
findAppsQuery,
|
||||||
'_id parentId avatar type name intro tmbId updateTime pluginData inheritPermission',
|
'_id parentId avatar type name intro tmbId updateTime pluginData inheritPermission'
|
||||||
{
|
|
||||||
limit: limit
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
.sort({
|
.sort({
|
||||||
updateTime: -1
|
updateTime: -1
|
||||||
})
|
})
|
||||||
|
.limit(limit)
|
||||||
.lean();
|
.lean();
|
||||||
|
|
||||||
// Add app permission and filter apps by read permission
|
// Add app permission and filter apps by read permission
|
||||||
|
|||||||
@ -24,10 +24,6 @@ import { TeamAppCreatePermissionVal } from '@fastgpt/global/support/permission/u
|
|||||||
import { AppErrEnum } from '@fastgpt/global/common/error/code/app';
|
import { AppErrEnum } from '@fastgpt/global/common/error/code/app';
|
||||||
import { refreshSourceAvatar } from '@fastgpt/service/common/file/image/controller';
|
import { refreshSourceAvatar } from '@fastgpt/service/common/file/image/controller';
|
||||||
import { MongoResourcePermission } from '@fastgpt/service/support/permission/schema';
|
import { MongoResourcePermission } from '@fastgpt/service/support/permission/schema';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
import { getI18nAppType } from '@fastgpt/service/support/operationLog/util';
|
|
||||||
import { i18nT } from '@fastgpt/web/i18n/utils';
|
|
||||||
|
|
||||||
export type AppUpdateQuery = {
|
export type AppUpdateQuery = {
|
||||||
appId: string;
|
appId: string;
|
||||||
@ -58,7 +54,7 @@ async function handler(req: ApiRequestProps<AppUpdateBody, AppUpdateQuery>) {
|
|||||||
|
|
||||||
// this step is to get the app and its permission, and we will check the permission manually for
|
// this step is to get the app and its permission, and we will check the permission manually for
|
||||||
// different cases
|
// different cases
|
||||||
const { app, permission, teamId, tmbId } = await authApp({
|
const { app, permission } = await authApp({
|
||||||
req,
|
req,
|
||||||
authToken: true,
|
authToken: true,
|
||||||
appId,
|
appId,
|
||||||
@ -69,23 +65,11 @@ async function handler(req: ApiRequestProps<AppUpdateBody, AppUpdateQuery>) {
|
|||||||
Promise.reject(AppErrEnum.unExist);
|
Promise.reject(AppErrEnum.unExist);
|
||||||
}
|
}
|
||||||
|
|
||||||
let targetName = '';
|
|
||||||
|
|
||||||
if (isMove) {
|
if (isMove) {
|
||||||
if (parentId) {
|
if (parentId) {
|
||||||
// move to a folder, check the target folder's permission
|
// move to a folder, check the target folder's permission
|
||||||
const { app: targetApp } = await authApp({
|
await authApp({ req, authToken: true, appId: parentId, per: ManagePermissionVal });
|
||||||
req,
|
|
||||||
authToken: true,
|
|
||||||
appId: parentId,
|
|
||||||
per: ManagePermissionVal
|
|
||||||
});
|
|
||||||
|
|
||||||
targetName = targetApp.name;
|
|
||||||
} else {
|
|
||||||
targetName = 'root';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (app.parentId) {
|
if (app.parentId) {
|
||||||
// move from a folder, check the (old) folder's permission
|
// move from a folder, check the (old) folder's permission
|
||||||
await authApp({ req, authToken: true, appId: app.parentId, per: ManagePermissionVal });
|
await authApp({ req, authToken: true, appId: app.parentId, per: ManagePermissionVal });
|
||||||
@ -176,7 +160,6 @@ async function handler(req: ApiRequestProps<AppUpdateBody, AppUpdateQuery>) {
|
|||||||
session
|
session
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
logAppMove({ tmbId, teamId, app, targetName });
|
|
||||||
// Not folder, delete all clb
|
// Not folder, delete all clb
|
||||||
await MongoResourcePermission.deleteMany(
|
await MongoResourcePermission.deleteMany(
|
||||||
{ resourceType: PerResourceTypeEnum.app, teamId: app.teamId, resourceId: app._id },
|
{ resourceType: PerResourceTypeEnum.app, teamId: app.teamId, resourceId: app._id },
|
||||||
@ -186,85 +169,8 @@ async function handler(req: ApiRequestProps<AppUpdateBody, AppUpdateQuery>) {
|
|||||||
return onUpdate(session);
|
return onUpdate(session);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
logAppUpdate({ tmbId, teamId, app, name, intro });
|
|
||||||
|
|
||||||
return onUpdate();
|
return onUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NextAPI(handler);
|
export default NextAPI(handler);
|
||||||
|
|
||||||
const logAppMove = ({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
app,
|
|
||||||
targetName
|
|
||||||
}: {
|
|
||||||
tmbId: string;
|
|
||||||
teamId: string;
|
|
||||||
app: any;
|
|
||||||
targetName: string;
|
|
||||||
}) => {
|
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.MOVE_APP,
|
|
||||||
params: {
|
|
||||||
appName: app.name,
|
|
||||||
targetFolderName: targetName,
|
|
||||||
appType: getI18nAppType(app.type)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
};
|
|
||||||
|
|
||||||
const logAppUpdate = ({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
app,
|
|
||||||
name,
|
|
||||||
intro
|
|
||||||
}: {
|
|
||||||
tmbId: string;
|
|
||||||
teamId: string;
|
|
||||||
app: any;
|
|
||||||
name?: string;
|
|
||||||
intro?: string;
|
|
||||||
}) => {
|
|
||||||
(async () => {
|
|
||||||
const getUpdateItems = () => {
|
|
||||||
const names: string[] = [];
|
|
||||||
const values: string[] = [];
|
|
||||||
|
|
||||||
if (name !== undefined) {
|
|
||||||
names.push(i18nT('common:core.app.name'));
|
|
||||||
values.push(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (intro !== undefined) {
|
|
||||||
names.push(i18nT('common:Intro'));
|
|
||||||
values.push(intro);
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
names,
|
|
||||||
values
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const { names: newItemNames, values: newItemValues } = getUpdateItems();
|
|
||||||
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.UPDATE_APP_INFO,
|
|
||||||
params: {
|
|
||||||
appName: app.name,
|
|
||||||
newItemNames: newItemNames,
|
|
||||||
newItemValues: newItemValues,
|
|
||||||
appType: getI18nAppType(app.type)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
};
|
|
||||||
|
|||||||
@ -11,20 +11,12 @@ import { WritePermissionVal } from '@fastgpt/global/support/permission/constant'
|
|||||||
import { type ApiRequestProps } from '@fastgpt/service/type/next';
|
import { type ApiRequestProps } from '@fastgpt/service/type/next';
|
||||||
import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
|
import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
|
||||||
import { rewriteAppWorkflowToSimple } from '@fastgpt/service/core/app/utils';
|
import { rewriteAppWorkflowToSimple } from '@fastgpt/service/core/app/utils';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
import { getI18nAppType } from '@fastgpt/service/support/operationLog/util';
|
|
||||||
import { i18nT } from '@fastgpt/web/i18n/utils';
|
|
||||||
async function handler(req: ApiRequestProps<PostPublishAppProps>, res: NextApiResponse<any>) {
|
async function handler(req: ApiRequestProps<PostPublishAppProps>, res: NextApiResponse<any>) {
|
||||||
const { appId } = req.query as { appId: string };
|
const { appId } = req.query as { appId: string };
|
||||||
const { nodes = [], edges = [], chatConfig, isPublish, versionName, autoSave } = req.body;
|
const { nodes = [], edges = [], chatConfig, isPublish, versionName, autoSave } = req.body;
|
||||||
|
|
||||||
const { app, tmbId, teamId } = await authApp({
|
const { app, tmbId } = await authApp({ appId, req, per: WritePermissionVal, authToken: true });
|
||||||
appId,
|
|
||||||
req,
|
|
||||||
per: WritePermissionVal,
|
|
||||||
authToken: true
|
|
||||||
});
|
|
||||||
|
|
||||||
const { nodes: formatNodes } = beforeUpdateAppFormat({
|
const { nodes: formatNodes } = beforeUpdateAppFormat({
|
||||||
nodes,
|
nodes,
|
||||||
@ -34,26 +26,12 @@ async function handler(req: ApiRequestProps<PostPublishAppProps>, res: NextApiRe
|
|||||||
await rewriteAppWorkflowToSimple(formatNodes);
|
await rewriteAppWorkflowToSimple(formatNodes);
|
||||||
|
|
||||||
if (autoSave) {
|
if (autoSave) {
|
||||||
await MongoApp.findByIdAndUpdate(appId, {
|
return MongoApp.findByIdAndUpdate(appId, {
|
||||||
modules: formatNodes,
|
modules: formatNodes,
|
||||||
edges,
|
edges,
|
||||||
chatConfig,
|
chatConfig,
|
||||||
updateTime: new Date()
|
updateTime: new Date()
|
||||||
});
|
});
|
||||||
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.UPDATE_PUBLISH_APP,
|
|
||||||
params: {
|
|
||||||
appName: app.name,
|
|
||||||
operationName: i18nT('account_team:update'),
|
|
||||||
appId,
|
|
||||||
appType: getI18nAppType(app.type)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await mongoSessionRun(async (session) => {
|
await mongoSessionRun(async (session) => {
|
||||||
@ -101,22 +79,6 @@ async function handler(req: ApiRequestProps<PostPublishAppProps>, res: NextApiRe
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.UPDATE_PUBLISH_APP,
|
|
||||||
params: {
|
|
||||||
appName: app.name,
|
|
||||||
operationName: isPublish
|
|
||||||
? i18nT('account_team:save_and_publish')
|
|
||||||
: i18nT('account_team:update'),
|
|
||||||
appId,
|
|
||||||
appType: getI18nAppType(app.type)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NextAPI(handler);
|
export default NextAPI(handler);
|
||||||
|
|||||||
@ -4,14 +4,11 @@ import { authDataset } from '@fastgpt/service/support/permission/dataset/auth';
|
|||||||
import { createOneCollection } from '@fastgpt/service/core/dataset/collection/controller';
|
import { createOneCollection } from '@fastgpt/service/core/dataset/collection/controller';
|
||||||
import { NextAPI } from '@/service/middleware/entry';
|
import { NextAPI } from '@/service/middleware/entry';
|
||||||
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';
|
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
import { getI18nDatasetType } from '@fastgpt/service/support/operationLog/util';
|
|
||||||
|
|
||||||
async function handler(req: NextApiRequest) {
|
async function handler(req: NextApiRequest) {
|
||||||
const body = req.body as CreateDatasetCollectionParams;
|
const body = req.body as CreateDatasetCollectionParams;
|
||||||
|
|
||||||
const { teamId, tmbId, dataset } = await authDataset({
|
const { teamId, tmbId } = await authDataset({
|
||||||
req,
|
req,
|
||||||
authToken: true,
|
authToken: true,
|
||||||
authApiKey: true,
|
authApiKey: true,
|
||||||
@ -24,20 +21,6 @@ async function handler(req: NextApiRequest) {
|
|||||||
teamId,
|
teamId,
|
||||||
tmbId
|
tmbId
|
||||||
});
|
});
|
||||||
|
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.CREATE_COLLECTION,
|
|
||||||
params: {
|
|
||||||
collectionName: body.name,
|
|
||||||
datasetName: dataset.name,
|
|
||||||
datasetType: getI18nDatasetType(dataset.type)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
|
|
||||||
return _id;
|
return _id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,11 +4,11 @@ import { type FileIdCreateDatasetCollectionParams } from '@fastgpt/global/core/d
|
|||||||
import { createCollectionAndInsertData } from '@fastgpt/service/core/dataset/collection/controller';
|
import { createCollectionAndInsertData } from '@fastgpt/service/core/dataset/collection/controller';
|
||||||
import { DatasetCollectionTypeEnum } from '@fastgpt/global/core/dataset/constants';
|
import { DatasetCollectionTypeEnum } from '@fastgpt/global/core/dataset/constants';
|
||||||
import { BucketNameEnum } from '@fastgpt/global/common/file/constants';
|
import { BucketNameEnum } from '@fastgpt/global/common/file/constants';
|
||||||
|
import { MongoRawTextBuffer } from '@fastgpt/service/common/buffer/rawText/schema';
|
||||||
import { NextAPI } from '@/service/middleware/entry';
|
import { NextAPI } from '@/service/middleware/entry';
|
||||||
import { type ApiRequestProps } from '@fastgpt/service/type/next';
|
import { type ApiRequestProps } from '@fastgpt/service/type/next';
|
||||||
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';
|
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';
|
||||||
import { type CreateCollectionResponse } from '@/global/core/dataset/api';
|
import { type CreateCollectionResponse } from '@/global/core/dataset/api';
|
||||||
import { deleteRawTextBuffer } from '@fastgpt/service/common/buffer/rawText/controller';
|
|
||||||
|
|
||||||
async function handler(
|
async function handler(
|
||||||
req: ApiRequestProps<FileIdCreateDatasetCollectionParams>
|
req: ApiRequestProps<FileIdCreateDatasetCollectionParams>
|
||||||
@ -52,7 +52,7 @@ async function handler(
|
|||||||
});
|
});
|
||||||
|
|
||||||
// remove buffer
|
// remove buffer
|
||||||
await deleteRawTextBuffer(fileId);
|
await MongoRawTextBuffer.deleteOne({ sourceId: fileId });
|
||||||
|
|
||||||
return {
|
return {
|
||||||
collectionId,
|
collectionId,
|
||||||
|
|||||||
@ -14,9 +14,6 @@ import { authDatasetCollection } from '@fastgpt/service/support/permission/datas
|
|||||||
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
|
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
|
||||||
import { i18nT } from '@fastgpt/web/i18n/utils';
|
import { i18nT } from '@fastgpt/web/i18n/utils';
|
||||||
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';
|
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
import { getI18nDatasetType } from '@fastgpt/service/support/operationLog/util';
|
|
||||||
|
|
||||||
type RetrainingCollectionResponse = {
|
type RetrainingCollectionResponse = {
|
||||||
collectionId: string;
|
collectionId: string;
|
||||||
@ -127,19 +124,6 @@ async function handler(
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.RETRAIN_COLLECTION,
|
|
||||||
params: {
|
|
||||||
collectionName: collection.name,
|
|
||||||
datasetName: collection.dataset?.name || '',
|
|
||||||
datasetType: getI18nDatasetType(collection.dataset?.type || '')
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
|
|
||||||
return { collectionId };
|
return { collectionId };
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import { DatasetCollectionTypeEnum } from '@fastgpt/global/core/dataset/constant
|
|||||||
import { NextAPI } from '@/service/middleware/entry';
|
import { NextAPI } from '@/service/middleware/entry';
|
||||||
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';
|
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';
|
||||||
import { type CreateCollectionResponse } from '@/global/core/dataset/api';
|
import { type CreateCollectionResponse } from '@/global/core/dataset/api';
|
||||||
import { createFileFromText } from '@fastgpt/service/common/file/gridfs/utils';
|
|
||||||
|
|
||||||
async function handler(req: NextApiRequest): CreateCollectionResponse {
|
async function handler(req: NextApiRequest): CreateCollectionResponse {
|
||||||
const { name, text, ...body } = req.body as TextCreateDatasetCollectionParams;
|
const { name, text, ...body } = req.body as TextCreateDatasetCollectionParams;
|
||||||
@ -19,18 +18,6 @@ async function handler(req: NextApiRequest): CreateCollectionResponse {
|
|||||||
per: WritePermissionVal
|
per: WritePermissionVal
|
||||||
});
|
});
|
||||||
|
|
||||||
// 1. Create file from text
|
|
||||||
const filename = `${name}.txt`;
|
|
||||||
const { fileId } = await createFileFromText({
|
|
||||||
bucket: 'dataset',
|
|
||||||
filename,
|
|
||||||
text,
|
|
||||||
metadata: {
|
|
||||||
teamId,
|
|
||||||
uid: tmbId
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { collectionId, insertResults } = await createCollectionAndInsertData({
|
const { collectionId, insertResults } = await createCollectionAndInsertData({
|
||||||
dataset,
|
dataset,
|
||||||
rawText: text,
|
rawText: text,
|
||||||
@ -38,9 +25,9 @@ async function handler(req: NextApiRequest): CreateCollectionResponse {
|
|||||||
...body,
|
...body,
|
||||||
teamId,
|
teamId,
|
||||||
tmbId,
|
tmbId,
|
||||||
type: DatasetCollectionTypeEnum.file,
|
type: DatasetCollectionTypeEnum.virtual,
|
||||||
fileId,
|
|
||||||
name: filename
|
name
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -6,9 +6,7 @@ import { mongoSessionRun } from '@fastgpt/service/common/mongo/sessionRun';
|
|||||||
import { NextAPI } from '@/service/middleware/entry';
|
import { NextAPI } from '@/service/middleware/entry';
|
||||||
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';
|
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';
|
||||||
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
|
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
import { getI18nDatasetType } from '@fastgpt/service/support/operationLog/util';
|
|
||||||
async function handler(req: NextApiRequest) {
|
async function handler(req: NextApiRequest) {
|
||||||
const { id: collectionId } = req.query as { id: string };
|
const { id: collectionId } = req.query as { id: string };
|
||||||
|
|
||||||
@ -16,7 +14,7 @@ async function handler(req: NextApiRequest) {
|
|||||||
return Promise.reject(CommonErrEnum.missingParams);
|
return Promise.reject(CommonErrEnum.missingParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { teamId, collection, tmbId } = await authDatasetCollection({
|
const { teamId, collection } = await authDatasetCollection({
|
||||||
req,
|
req,
|
||||||
authToken: true,
|
authToken: true,
|
||||||
authApiKey: true,
|
authApiKey: true,
|
||||||
@ -41,19 +39,6 @@ async function handler(req: NextApiRequest) {
|
|||||||
session
|
session
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.DELETE_COLLECTION,
|
|
||||||
params: {
|
|
||||||
collectionName: collection.name,
|
|
||||||
datasetName: collection.dataset?.name || '',
|
|
||||||
datasetType: getI18nDatasetType(collection.dataset?.type || '')
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NextAPI(handler);
|
export default NextAPI(handler);
|
||||||
|
|||||||
@ -12,9 +12,7 @@ import { DatasetCollectionTypeEnum } from '@fastgpt/global/core/dataset/constant
|
|||||||
import { type ClientSession } from '@fastgpt/service/common/mongo';
|
import { type ClientSession } from '@fastgpt/service/common/mongo';
|
||||||
import { type CollectionWithDatasetType } from '@fastgpt/global/core/dataset/type';
|
import { type CollectionWithDatasetType } from '@fastgpt/global/core/dataset/type';
|
||||||
import { mongoSessionRun } from '@fastgpt/service/common/mongo/sessionRun';
|
import { mongoSessionRun } from '@fastgpt/service/common/mongo/sessionRun';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
import { getI18nDatasetType } from '@fastgpt/service/support/operationLog/util';
|
|
||||||
export type UpdateDatasetCollectionParams = {
|
export type UpdateDatasetCollectionParams = {
|
||||||
id?: string;
|
id?: string;
|
||||||
parentId?: string;
|
parentId?: string;
|
||||||
@ -90,7 +88,7 @@ async function handler(req: ApiRequestProps<UpdateDatasetCollectionParams>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 凭证校验
|
// 凭证校验
|
||||||
const { collection, teamId, tmbId } = await authDatasetCollection({
|
const { collection, teamId } = await authDatasetCollection({
|
||||||
req,
|
req,
|
||||||
authToken: true,
|
authToken: true,
|
||||||
authApiKey: true,
|
authApiKey: true,
|
||||||
@ -133,19 +131,6 @@ async function handler(req: ApiRequestProps<UpdateDatasetCollectionParams>) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.UPDATE_COLLECTION,
|
|
||||||
params: {
|
|
||||||
collectionName: collection.name,
|
|
||||||
datasetName: collection.dataset?.name || '',
|
|
||||||
datasetType: getI18nDatasetType(collection.dataset?.type || '')
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NextAPI(handler);
|
export default NextAPI(handler);
|
||||||
|
|||||||
@ -18,9 +18,6 @@ import { authDataset } from '@fastgpt/service/support/permission/dataset/auth';
|
|||||||
import { checkTeamDatasetLimit } from '@fastgpt/service/support/permission/teamLimit';
|
import { checkTeamDatasetLimit } from '@fastgpt/service/support/permission/teamLimit';
|
||||||
import { authUserPer } from '@fastgpt/service/support/permission/user/auth';
|
import { authUserPer } from '@fastgpt/service/support/permission/user/auth';
|
||||||
import type { ApiRequestProps } from '@fastgpt/service/type/next';
|
import type { ApiRequestProps } from '@fastgpt/service/type/next';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
import { getI18nDatasetType } from '@fastgpt/service/support/operationLog/util';
|
|
||||||
|
|
||||||
export type DatasetCreateQuery = {};
|
export type DatasetCreateQuery = {};
|
||||||
export type DatasetCreateBody = CreateDatasetParams;
|
export type DatasetCreateBody = CreateDatasetParams;
|
||||||
@ -105,18 +102,6 @@ async function handler(
|
|||||||
uid: userId
|
uid: userId
|
||||||
});
|
});
|
||||||
|
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.CREATE_DATASET,
|
|
||||||
params: {
|
|
||||||
datasetName: name,
|
|
||||||
datasetType: getI18nDatasetType(type)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
|
|
||||||
return datasetId;
|
return datasetId;
|
||||||
}
|
}
|
||||||
export default NextAPI(handler);
|
export default NextAPI(handler);
|
||||||
|
|||||||
@ -4,9 +4,7 @@ import { deleteDatasetData } from '@/service/core/dataset/data/controller';
|
|||||||
import { NextAPI } from '@/service/middleware/entry';
|
import { NextAPI } from '@/service/middleware/entry';
|
||||||
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';
|
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';
|
||||||
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
|
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
import { getI18nDatasetType } from '@fastgpt/service/support/operationLog/util';
|
|
||||||
async function handler(req: NextApiRequest) {
|
async function handler(req: NextApiRequest) {
|
||||||
const { id: dataId } = req.query as {
|
const { id: dataId } = req.query as {
|
||||||
id: string;
|
id: string;
|
||||||
@ -17,7 +15,7 @@ async function handler(req: NextApiRequest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 凭证校验
|
// 凭证校验
|
||||||
const { datasetData, tmbId, teamId, collection } = await authDatasetData({
|
const { datasetData } = await authDatasetData({
|
||||||
req,
|
req,
|
||||||
authToken: true,
|
authToken: true,
|
||||||
authApiKey: true,
|
authApiKey: true,
|
||||||
@ -26,18 +24,7 @@ async function handler(req: NextApiRequest) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await deleteDatasetData(datasetData);
|
await deleteDatasetData(datasetData);
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.DELETE_DATA,
|
|
||||||
params: {
|
|
||||||
collectionName: collection.name,
|
|
||||||
datasetName: collection.dataset?.name || '',
|
|
||||||
datasetType: getI18nDatasetType(collection.dataset?.type || '')
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
return 'success';
|
return 'success';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,9 +17,6 @@ import { NextAPI } from '@/service/middleware/entry';
|
|||||||
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';
|
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';
|
||||||
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
|
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
|
||||||
import { getLLMMaxChunkSize } from '@fastgpt/global/core/dataset/training/utils';
|
import { getLLMMaxChunkSize } from '@fastgpt/global/core/dataset/training/utils';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
import { getI18nDatasetType } from '@fastgpt/service/support/operationLog/util';
|
|
||||||
|
|
||||||
async function handler(req: NextApiRequest) {
|
async function handler(req: NextApiRequest) {
|
||||||
const { collectionId, q, a, indexes } = req.body as InsertOneDatasetDataProps;
|
const { collectionId, q, a, indexes } = req.body as InsertOneDatasetDataProps;
|
||||||
@ -33,7 +30,7 @@ async function handler(req: NextApiRequest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 凭证校验
|
// 凭证校验
|
||||||
const { teamId, tmbId, collection } = await authDatasetCollection({
|
const { teamId, tmbId } = await authDatasetCollection({
|
||||||
req,
|
req,
|
||||||
authToken: true,
|
authToken: true,
|
||||||
authApiKey: true,
|
authApiKey: true,
|
||||||
@ -99,18 +96,6 @@ async function handler(req: NextApiRequest) {
|
|||||||
model: vectorModelData.model
|
model: vectorModelData.model
|
||||||
});
|
});
|
||||||
|
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.CREATE_DATA,
|
|
||||||
params: {
|
|
||||||
collectionName: collection.name,
|
|
||||||
datasetName: collection.dataset?.name || '',
|
|
||||||
datasetType: getI18nDatasetType(collection.dataset?.type || '')
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
return insertId;
|
return insertId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,9 +5,7 @@ import { NextAPI } from '@/service/middleware/entry';
|
|||||||
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';
|
import { WritePermissionVal } from '@fastgpt/global/support/permission/constant';
|
||||||
import { authDatasetData } from '@fastgpt/service/support/permission/dataset/auth';
|
import { authDatasetData } from '@fastgpt/service/support/permission/dataset/auth';
|
||||||
import { type ApiRequestProps } from '@fastgpt/service/type/next';
|
import { type ApiRequestProps } from '@fastgpt/service/type/next';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
import { getI18nDatasetType } from '@fastgpt/service/support/operationLog/util';
|
|
||||||
async function handler(req: ApiRequestProps<UpdateDatasetDataProps>) {
|
async function handler(req: ApiRequestProps<UpdateDatasetDataProps>) {
|
||||||
const { dataId, q, a, indexes = [] } = req.body;
|
const { dataId, q, a, indexes = [] } = req.body;
|
||||||
|
|
||||||
@ -17,8 +15,7 @@ async function handler(req: ApiRequestProps<UpdateDatasetDataProps>) {
|
|||||||
dataset: { vectorModel }
|
dataset: { vectorModel }
|
||||||
},
|
},
|
||||||
teamId,
|
teamId,
|
||||||
tmbId,
|
tmbId
|
||||||
collection
|
|
||||||
} = await authDatasetData({
|
} = await authDatasetData({
|
||||||
req,
|
req,
|
||||||
authToken: true,
|
authToken: true,
|
||||||
@ -42,19 +39,6 @@ async function handler(req: ApiRequestProps<UpdateDatasetDataProps>) {
|
|||||||
inputTokens: tokens,
|
inputTokens: tokens,
|
||||||
model: vectorModel
|
model: vectorModel
|
||||||
});
|
});
|
||||||
|
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.UPDATE_DATA,
|
|
||||||
params: {
|
|
||||||
collectionName: collection.name,
|
|
||||||
datasetName: collection.dataset?.name || '',
|
|
||||||
datasetType: getI18nDatasetType(collection.dataset?.type || '')
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
} else {
|
} else {
|
||||||
// await MongoDatasetData.findByIdAndUpdate(dataId, {
|
// await MongoDatasetData.findByIdAndUpdate(dataId, {
|
||||||
// ...(forbid !== undefined && { forbid })
|
// ...(forbid !== undefined && { forbid })
|
||||||
|
|||||||
@ -11,9 +11,6 @@ import { MongoDatasetCollectionTags } from '@fastgpt/service/core/dataset/tag/sc
|
|||||||
import { removeImageByPath } from '@fastgpt/service/common/file/image/controller';
|
import { removeImageByPath } from '@fastgpt/service/common/file/image/controller';
|
||||||
import { DatasetTypeEnum } from '@fastgpt/global/core/dataset/constants';
|
import { DatasetTypeEnum } from '@fastgpt/global/core/dataset/constants';
|
||||||
import { removeWebsiteSyncJobScheduler } from '@fastgpt/service/core/dataset/websiteSync';
|
import { removeWebsiteSyncJobScheduler } from '@fastgpt/service/core/dataset/websiteSync';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
import { getI18nDatasetType } from '@fastgpt/service/support/operationLog/util';
|
|
||||||
|
|
||||||
async function handler(req: NextApiRequest) {
|
async function handler(req: NextApiRequest) {
|
||||||
const { id: datasetId } = req.query as {
|
const { id: datasetId } = req.query as {
|
||||||
@ -25,7 +22,7 @@ async function handler(req: NextApiRequest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// auth owner
|
// auth owner
|
||||||
const { teamId, tmbId, dataset } = await authDataset({
|
const { teamId } = await authDataset({
|
||||||
req,
|
req,
|
||||||
authToken: true,
|
authToken: true,
|
||||||
authApiKey: true,
|
authApiKey: true,
|
||||||
@ -69,18 +66,6 @@ async function handler(req: NextApiRequest) {
|
|||||||
await removeImageByPath(dataset.avatar, session);
|
await removeImageByPath(dataset.avatar, session);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.DELETE_DATASET,
|
|
||||||
params: {
|
|
||||||
datasetName: dataset.name,
|
|
||||||
datasetType: getI18nDatasetType(dataset.type)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NextAPI(handler);
|
export default NextAPI(handler);
|
||||||
|
|||||||
@ -17,8 +17,6 @@ import { syncCollaborators } from '@fastgpt/service/support/permission/inheritPe
|
|||||||
import { MongoResourcePermission } from '@fastgpt/service/support/permission/schema';
|
import { MongoResourcePermission } from '@fastgpt/service/support/permission/schema';
|
||||||
import { authUserPer } from '@fastgpt/service/support/permission/user/auth';
|
import { authUserPer } from '@fastgpt/service/support/permission/user/auth';
|
||||||
import type { ApiRequestProps, ApiResponseType } from '@fastgpt/service/type/next';
|
import type { ApiRequestProps, ApiResponseType } from '@fastgpt/service/type/next';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
export type DatasetFolderCreateQuery = {};
|
export type DatasetFolderCreateQuery = {};
|
||||||
export type DatasetFolderCreateBody = {
|
export type DatasetFolderCreateBody = {
|
||||||
parentId?: string;
|
parentId?: string;
|
||||||
@ -94,16 +92,6 @@ async function handler(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.CREATE_DATASET_FOLDER,
|
|
||||||
params: {
|
|
||||||
folderName: name
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,9 +14,7 @@ import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
|
|||||||
import { useIPFrequencyLimit } from '@fastgpt/service/common/middle/reqFrequencyLimit';
|
import { useIPFrequencyLimit } from '@fastgpt/service/common/middle/reqFrequencyLimit';
|
||||||
import { type ApiRequestProps } from '@fastgpt/service/type/next';
|
import { type ApiRequestProps } from '@fastgpt/service/type/next';
|
||||||
import { getRerankModel } from '@fastgpt/service/core/ai/model';
|
import { getRerankModel } from '@fastgpt/service/core/ai/model';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
import { getI18nDatasetType } from '@fastgpt/service/support/operationLog/util';
|
|
||||||
async function handler(req: ApiRequestProps<SearchTestProps>): Promise<SearchTestResponse> {
|
async function handler(req: ApiRequestProps<SearchTestProps>): Promise<SearchTestResponse> {
|
||||||
const {
|
const {
|
||||||
datasetId,
|
datasetId,
|
||||||
@ -132,17 +130,6 @@ async function handler(req: ApiRequestProps<SearchTestProps>): Promise<SearchTes
|
|||||||
totalPoints: embeddingTotalPoints + reRankTotalPoints
|
totalPoints: embeddingTotalPoints + reRankTotalPoints
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.SEARCH_TEST,
|
|
||||||
params: {
|
|
||||||
datasetName: dataset.name,
|
|
||||||
datasetType: getI18nDatasetType(dataset.type)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
list: searchRes,
|
list: searchRes,
|
||||||
|
|||||||
@ -37,9 +37,6 @@ import {
|
|||||||
} from '@fastgpt/service/core/dataset/websiteSync';
|
} from '@fastgpt/service/core/dataset/websiteSync';
|
||||||
import { delDatasetRelevantData } from '@fastgpt/service/core/dataset/controller';
|
import { delDatasetRelevantData } from '@fastgpt/service/core/dataset/controller';
|
||||||
import { isEqual } from 'lodash';
|
import { isEqual } from 'lodash';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
import { getI18nDatasetType } from '@fastgpt/service/support/operationLog/util';
|
|
||||||
|
|
||||||
export type DatasetUpdateQuery = {};
|
export type DatasetUpdateQuery = {};
|
||||||
export type DatasetUpdateResponse = any;
|
export type DatasetUpdateResponse = any;
|
||||||
@ -82,27 +79,16 @@ async function handler(
|
|||||||
|
|
||||||
const isMove = parentId !== undefined;
|
const isMove = parentId !== undefined;
|
||||||
|
|
||||||
const { dataset, permission, tmbId, teamId } = await authDataset({
|
const { dataset, permission } = await authDataset({
|
||||||
req,
|
req,
|
||||||
authToken: true,
|
authToken: true,
|
||||||
datasetId: id,
|
datasetId: id,
|
||||||
per: ReadPermissionVal
|
per: ReadPermissionVal
|
||||||
});
|
});
|
||||||
|
|
||||||
let targetName = '';
|
|
||||||
|
|
||||||
if (isMove) {
|
if (isMove) {
|
||||||
if (parentId) {
|
if (parentId) {
|
||||||
// move to a folder, check the target folder's permission
|
// move to a folder, check the target folder's permission
|
||||||
const { dataset: targetDataset } = await authDataset({
|
await authDataset({ req, authToken: true, datasetId: parentId, per: ManagePermissionVal });
|
||||||
req,
|
|
||||||
authToken: true,
|
|
||||||
datasetId: parentId,
|
|
||||||
per: ManagePermissionVal
|
|
||||||
});
|
|
||||||
targetName = targetDataset.name;
|
|
||||||
} else {
|
|
||||||
targetName = 'root';
|
|
||||||
}
|
}
|
||||||
if (dataset.parentId) {
|
if (dataset.parentId) {
|
||||||
// move from a folder, check the (old) folder's permission
|
// move from a folder, check the (old) folder's permission
|
||||||
@ -235,9 +221,7 @@ async function handler(
|
|||||||
collaborators: parentClbsAndGroups,
|
collaborators: parentClbsAndGroups,
|
||||||
session
|
session
|
||||||
});
|
});
|
||||||
logDatasetMove({ tmbId, teamId, dataset, targetName });
|
|
||||||
} else {
|
} else {
|
||||||
logDatasetMove({ tmbId, teamId, dataset, targetName });
|
|
||||||
// Not folder, delete all clb
|
// Not folder, delete all clb
|
||||||
await MongoResourcePermission.deleteMany(
|
await MongoResourcePermission.deleteMany(
|
||||||
{ resourceId: id, teamId: dataset.teamId, resourceType: PerResourceTypeEnum.dataset },
|
{ resourceId: id, teamId: dataset.teamId, resourceType: PerResourceTypeEnum.dataset },
|
||||||
@ -246,7 +230,6 @@ async function handler(
|
|||||||
}
|
}
|
||||||
return onUpdate(session);
|
return onUpdate(session);
|
||||||
} else {
|
} else {
|
||||||
logDatasetUpdate({ tmbId, teamId, dataset });
|
|
||||||
return onUpdate(session);
|
return onUpdate(session);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -332,50 +315,3 @@ const updateSyncSchedule = async ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const logDatasetMove = ({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
dataset,
|
|
||||||
targetName
|
|
||||||
}: {
|
|
||||||
tmbId: string;
|
|
||||||
teamId: string;
|
|
||||||
dataset: any;
|
|
||||||
targetName: string;
|
|
||||||
}) => {
|
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.MOVE_DATASET,
|
|
||||||
params: {
|
|
||||||
datasetName: dataset.name,
|
|
||||||
targetFolderName: targetName,
|
|
||||||
datasetType: getI18nDatasetType(dataset.type)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
};
|
|
||||||
|
|
||||||
const logDatasetUpdate = ({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
dataset
|
|
||||||
}: {
|
|
||||||
tmbId: string;
|
|
||||||
teamId: string;
|
|
||||||
dataset: any;
|
|
||||||
}) => {
|
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.UPDATE_DATASET,
|
|
||||||
params: {
|
|
||||||
datasetName: dataset.name,
|
|
||||||
datasetType: getI18nDatasetType(dataset.type)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
};
|
|
||||||
|
|||||||
@ -8,8 +8,7 @@ import { ManagePermissionVal } from '@fastgpt/global/support/permission/constant
|
|||||||
import { authApp } from '@fastgpt/service/support/permission/app/auth';
|
import { authApp } from '@fastgpt/service/support/permission/app/auth';
|
||||||
import { OpenApiErrEnum } from '@fastgpt/global/common/error/code/openapi';
|
import { OpenApiErrEnum } from '@fastgpt/global/common/error/code/openapi';
|
||||||
import { TeamApikeyCreatePermissionVal } from '@fastgpt/global/support/permission/user/constant';
|
import { TeamApikeyCreatePermissionVal } from '@fastgpt/global/support/permission/user/constant';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
async function handler(req: ApiRequestProps<EditApiKeyProps>): Promise<string> {
|
async function handler(req: ApiRequestProps<EditApiKeyProps>): Promise<string> {
|
||||||
const { appId, name, limit } = req.body;
|
const { appId, name, limit } = req.body;
|
||||||
const { tmbId, teamId } = await (async () => {
|
const { tmbId, teamId } = await (async () => {
|
||||||
@ -49,18 +48,6 @@ async function handler(req: ApiRequestProps<EditApiKeyProps>): Promise<string> {
|
|||||||
name,
|
name,
|
||||||
limit
|
limit
|
||||||
});
|
});
|
||||||
|
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.CREATE_API_KEY,
|
|
||||||
params: {
|
|
||||||
keyName: name
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
|
|
||||||
return apiKey;
|
return apiKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,8 +4,7 @@ import { OwnerPermissionVal } from '@fastgpt/global/support/permission/constant'
|
|||||||
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
|
import { CommonErrEnum } from '@fastgpt/global/common/error/code/common';
|
||||||
import type { ApiRequestProps, ApiResponseType } from '@fastgpt/service/type/next';
|
import type { ApiRequestProps, ApiResponseType } from '@fastgpt/service/type/next';
|
||||||
import { NextAPI } from '@/service/middleware/entry';
|
import { NextAPI } from '@/service/middleware/entry';
|
||||||
import { addOperationLog } from '@fastgpt/service/support/operationLog/addOperationLog';
|
|
||||||
import { OperationLogEventEnum } from '@fastgpt/global/support/operationLog/constants';
|
|
||||||
export type OpenAPIDeleteQuery = { id: string };
|
export type OpenAPIDeleteQuery = { id: string };
|
||||||
export type OpenAPIDeleteBody = {};
|
export type OpenAPIDeleteBody = {};
|
||||||
export type OpenAPIDeleteResponse = {};
|
export type OpenAPIDeleteResponse = {};
|
||||||
@ -20,26 +19,9 @@ async function handler(
|
|||||||
return Promise.reject(CommonErrEnum.missingParams);
|
return Promise.reject(CommonErrEnum.missingParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { tmbId, teamId, openapi } = await authOpenApiKeyCrud({
|
await authOpenApiKeyCrud({ req, authToken: true, id, per: OwnerPermissionVal });
|
||||||
req,
|
|
||||||
authToken: true,
|
|
||||||
id,
|
|
||||||
per: OwnerPermissionVal
|
|
||||||
});
|
|
||||||
|
|
||||||
(async () => {
|
|
||||||
addOperationLog({
|
|
||||||
tmbId,
|
|
||||||
teamId,
|
|
||||||
event: OperationLogEventEnum.DELETE_API_KEY,
|
|
||||||
params: {
|
|
||||||
keyName: openapi.name
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
|
|
||||||
await MongoOpenApi.deleteOne({ _id: id });
|
await MongoOpenApi.deleteOne({ _id: id });
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user