Commit c2abbb57 by Archer Committed by GitHub

perf: auto load icons (#688)

* perf: icon

* perf: icon

* doc

* perf: simple edit ui

* doc

* doc

* doc

* doc
parent 2fc6e921
...@@ -50,9 +50,12 @@ FastGPT 商业版软件根据不同的部署方式,分为 4 类收费模式。 ...@@ -50,9 +50,12 @@ FastGPT 商业版软件根据不同的部署方式,分为 4 类收费模式。
| Sealos全托管 | 1. 有效期内免费升级。<br>2. 免运维服务&数据库。<br>3. 赠送 10000 元 Sealos 云资源额度。 | 半天 | 3000元起/月(3个月起)<br>或<br>30000元起/年 | | Sealos全托管 | 1. 有效期内免费升级。<br>2. 免运维服务&数据库。<br>3. 赠送 10000 元 Sealos 云资源额度。 | 半天 | 3000元起/月(3个月起)<br>或<br>30000元起/年 |
| 自有服务器-单机版 | 1. 6个版本的升级服务。 | 14天内 | 60000元/套(不限时长) | | 自有服务器-单机版 | 1. 6个版本的升级服务。 | 14天内 | 60000元/套(不限时长) |
| 自有服务器-Sealos版 | 1. 6个版本的升级服务。 | 14天内 | 150000元/套(不限时长)| | 自有服务器-Sealos版 | 1. 6个版本的升级服务。 | 14天内 | 150000元/套(不限时长)|
{{< /table >}} {{< /table >}}
{{% alert icon="🤖 " context="success" %}}
6个版本的升级服务不是指只能用 6 个版本,而是指依赖 FastGPT 团队提供的升级服务。大部分时候,建议自行升级,也不麻烦。
{{% /alert %}}
## 技术支持 ## 技术支持
...@@ -85,3 +88,10 @@ FastGPT 商业版软件根据不同的部署方式,分为 4 类收费模式。 ...@@ -85,3 +88,10 @@ FastGPT 商业版软件根据不同的部署方式,分为 4 类收费模式。
2. 二次开发如何操作? 2. 二次开发如何操作?
可自行修改开源版代码进行二次开发,不支持修改商业版镜像。 可自行修改开源版代码进行二次开发,不支持修改商业版镜像。
## Sealos 费用
Sealos 云服务属于按量计费,下面是它的价格表:
![](/imgs/sealos_price.png)
...@@ -178,7 +178,8 @@ weight: 708 ...@@ -178,7 +178,8 @@ weight: 708
{ {
"model": "gpt-3.5-turbo-1106", "model": "gpt-3.5-turbo-1106",
"name": "GPT35-1106", "name": "GPT35-1106",
"price": 0, // 除以 100000 后等于1个token的价格 "inputPrice": 0, // 输入价格。 xx元/1k tokens
"outputPrice": 0, // 输出价格。 xx元/1k tokens
"maxContext": 16000, // 最大上下文长度 "maxContext": 16000, // 最大上下文长度
"maxResponse": 4000, // 最大回复长度 "maxResponse": 4000, // 最大回复长度
"quoteMaxToken": 2000, // 最大引用内容长度 "quoteMaxToken": 2000, // 最大引用内容长度
...@@ -192,7 +193,8 @@ weight: 708 ...@@ -192,7 +193,8 @@ weight: 708
"name": "GPT35-16k", "name": "GPT35-16k",
"maxContext": 16000, "maxContext": 16000,
"maxResponse": 16000, "maxResponse": 16000,
"price": 0, "inputPrice": 0,
"outputPrice": 0,
"quoteMaxToken": 8000, "quoteMaxToken": 8000,
"maxTemperature": 1.2, "maxTemperature": 1.2,
"censor": false, "censor": false,
...@@ -204,7 +206,8 @@ weight: 708 ...@@ -204,7 +206,8 @@ weight: 708
"name": "GPT4-8k", "name": "GPT4-8k",
"maxContext": 8000, "maxContext": 8000,
"maxResponse": 8000, "maxResponse": 8000,
"price": 0, "inputPrice": 0,
"outputPrice": 0,
"quoteMaxToken": 4000, "quoteMaxToken": 4000,
"maxTemperature": 1.2, "maxTemperature": 1.2,
"censor": false, "censor": false,
...@@ -216,7 +219,8 @@ weight: 708 ...@@ -216,7 +219,8 @@ weight: 708
"name": "GPT4-Vision", "name": "GPT4-Vision",
"maxContext": 128000, "maxContext": 128000,
"maxResponse": 4000, "maxResponse": 4000,
"price": 0, "inputPrice": 0,
"outputPrice": 0,
"quoteMaxToken": 100000, "quoteMaxToken": 100000,
"maxTemperature": 1.2, "maxTemperature": 1.2,
"censor": false, "censor": false,
...@@ -239,7 +243,8 @@ weight: 708 ...@@ -239,7 +243,8 @@ weight: 708
"name": "GPT35-1106", "name": "GPT35-1106",
"maxContext": 16000, "maxContext": 16000,
"maxResponse": 4000, "maxResponse": 4000,
"price": 0, "inputPrice": 0,
"outputPrice": 0,
"toolChoice": true, // 是否支持openai的 toolChoice, 不支持的模型需要设置为 false,会走提示词生成 "toolChoice": true, // 是否支持openai的 toolChoice, 不支持的模型需要设置为 false,会走提示词生成
"functionPrompt": "" "functionPrompt": ""
}, },
...@@ -248,7 +253,7 @@ weight: 708 ...@@ -248,7 +253,7 @@ weight: 708
"name": "GPT4-8k", "name": "GPT4-8k",
"maxContext": 8000, "maxContext": 8000,
"maxResponse": 8000, "maxResponse": 8000,
"price": 0, "inputPrice": 0,
"toolChoice": true, "toolChoice": true,
"functionPrompt": "" "functionPrompt": ""
} }
...@@ -259,7 +264,7 @@ weight: 708 ...@@ -259,7 +264,7 @@ weight: 708
"name": "GPT35-1106", "name": "GPT35-1106",
"maxContext": 16000, "maxContext": 16000,
"maxResponse": 4000, "maxResponse": 4000,
"price": 0, "outputPrice": 0,
"toolChoice": true, "toolChoice": true,
"functionPrompt": "" "functionPrompt": ""
} }
...@@ -270,14 +275,15 @@ weight: 708 ...@@ -270,14 +275,15 @@ weight: 708
"name": "GPT35-1106", "name": "GPT35-1106",
"maxContext": 1600, "maxContext": 1600,
"maxResponse": 4000, "maxResponse": 4000,
"price": 0 "inputPrice": 0,
"outputPrice": 0,
} }
], ],
"vectorModels": [ // 向量模型 "vectorModels": [ // 向量模型
{ {
"model": "text-embedding-ada-002", "model": "text-embedding-ada-002",
"name": "Embedding-2", "name": "Embedding-2",
"price": 0.2, "inputPrice": 0,
"defaultToken": 700, "defaultToken": 700,
"maxToken": 3000 "maxToken": 3000
} }
...@@ -287,7 +293,7 @@ weight: 708 ...@@ -287,7 +293,7 @@ weight: 708
{ {
"model": "tts-1", "model": "tts-1",
"name": "OpenAI TTS1", "name": "OpenAI TTS1",
"price": 0, "inputPrice": 0,
"baseUrl": "", "baseUrl": "",
"key": "", "key": "",
"voices": [ "voices": [
...@@ -303,7 +309,7 @@ weight: 708 ...@@ -303,7 +309,7 @@ weight: 708
"whisperModel": { "whisperModel": {
"model": "whisper-1", "model": "whisper-1",
"name": "Whisper1", "name": "Whisper1",
"price": 0 "inputPrice": 0
} }
} }
``` ```
......
...@@ -35,12 +35,16 @@ OneAPI 中没有配置该模型渠道。 ...@@ -35,12 +35,16 @@ OneAPI 中没有配置该模型渠道。
### 如何更新? ### 如何更新?
执行下面命令会自动拉取最新镜像,一般情况下不需要执行额外操作。 1. 查看[更新文档](/docs/development/upgrading/intro/),确认要升级的版本,避免跨版本升级。
2. 修改镜像 tag 到指定版本
3. 执行下面命令会自动拉取镜像:
```bash ```bash
docker-compose pull docker-compose pull
docker-compose up -d docker-compose up -d
``` ```
4. 执行初始化脚本(如果有)
### 如何自定义配置文件? ### 如何自定义配置文件?
......
...@@ -59,14 +59,17 @@ FastGPT 商业版共包含了3个应用(fastgpt, fastgpt-plus, fastgpt-admin ...@@ -59,14 +59,17 @@ FastGPT 商业版共包含了3个应用(fastgpt, fastgpt-plus, fastgpt-admin
例如,目前是4.5 版本,要升级到4.5.1,就先把镜像版本改成v4.5.1,执行一下升级脚本,等待完成后再继续升级。如果目标版本不需要执行初始化,则可以跳过。 例如,目前是4.5 版本,要升级到4.5.1,就先把镜像版本改成v4.5.1,执行一下升级脚本,等待完成后再继续升级。如果目标版本不需要执行初始化,则可以跳过。
升级步骤: 升级步骤:
1. 打开sealos的应用管理
2. 有3个应用 fastgpt , fastgpt-plugin 和 fastgpt-admin 1. 查看[更新文档](/docs/development/upgrading/intro/),确认要升级的版本,避免跨版本升级。
3. 点击对应应用右边3个点,变更。或者点详情后右上角的变更。 2. 打开 sealos 的应用管理
4. 修改镜像名栏 3. 有2个应用 fastgpt , fastgpt-pro
4. 点击对应应用右边3个点,变更。或者点详情后右上角的变更。
5. 修改镜像的版本号
![](/imgs/onsealos2.png) ![](/imgs/onsealos2.png)
5. 点击变更/重启,会自动拉取最新镜像进行更新 6. 点击变更/重启,会自动拉取最新镜像进行更新
6. 执行对应版本的初始化脚本 7. 执行对应版本的初始化脚本(如果有)
### 如何获取 FastGPT 访问链接 ### 如何获取 FastGPT 访问链接
...@@ -88,34 +91,6 @@ FastGPT 商业版共包含了3个应用(fastgpt, fastgpt-plus, fastgpt-admin ...@@ -88,34 +91,6 @@ FastGPT 商业版共包含了3个应用(fastgpt, fastgpt-plus, fastgpt-admin
[配置文件参考](https://doc.fastgpt.in/docs/development/configuration/) [配置文件参考](https://doc.fastgpt.in/docs/development/configuration/)
FeConfig 参考下面(目前未做可视化)
```
"FeConfig": {
"show_emptyChat": false, // 是否展示聊天时空白的内容
"show_register": true, // 展示注册按键
"show_appStore": false, // 应用市场(暂时不可用)
"show_contact": false, // 联系方式(目前不可配置,直接false)
"show_git": false, // 展示 github
"show_doc": false, // 展示文档
"show_pay": true, // 展示支付
"show_openai_account": false, // 用户可自定义 openai key
"show_promotion": false, // 邀请好友机制
"docUrl": "https://doc.fastgpt.in", // 文档基本地址
"systemTitle": "FastGPT", // 系统的 title
"googleClientVerKey": "", // 谷歌 v3 校验前端凭证
"isPlus": true, // 直接设置 true
"oauth": { // oauth登录
"github": "",
"google": ""
},
"limit": {
"exportLimitMinutes": 0 // 导出间隔限制
},
"scripts": [
]
}
```
### 修改站点名称以及 favicon ### 修改站点名称以及 favicon
修改应用的环境变量,增加 修改应用的环境变量,增加
...@@ -134,6 +109,7 @@ SYSTEM_FAVICON 可以是一个网络地址 ...@@ -134,6 +109,7 @@ SYSTEM_FAVICON 可以是一个网络地址
新增一个挂载文件,文件名为:/app/projects/app/public/icon/logo.svg ,值为 svg 对应的值。 新增一个挂载文件,文件名为:/app/projects/app/public/icon/logo.svg ,值为 svg 对应的值。
![](/imgs/onsealos7.png) ![](/imgs/onsealos7.png)
![](/imgs/onsealos8.png) ![](/imgs/onsealos8.png)
### 管理后台 ### 管理后台
...@@ -148,45 +124,8 @@ SYSTEM_FAVICON 可以是一个网络地址 ...@@ -148,45 +124,8 @@ SYSTEM_FAVICON 可以是一个网络地址
"license": "", "license": "",
"system": { "system": {
"title": "" // 系统名称 "title": "" // 系统名称
},
"censor": {
"BAIDU_TEXT_CENSOR_CLIENTID": "", // 百度文本安全校验
"BAIDU_TEXT_CENSOR_CLIENTSECRET": "" // 百度文本安全校验
},
"auth": {
"googleServiceVerKey": "", // 谷歌 v3 校验
"github": { // github oauth
"clientId": "",
"secret": ""
},
"google": { // google oauth
"clientId": "",
"secret": ""
},
"email": { // 注册邮箱配置
"service": "qq",
"user": "",
"pass": ""
},
"phone": { // 阿里短信配置
"SNED_PHONE_ACCESSKEYID": "",
"SNED_PHONE_ACCESSSECRET": "",
"SNED_PHONE_SIGNNAME": "",
"SNED_PHONE_TEMPLATE": ""
}
},
"pay": { // 微信支付配置
"wx": {
"WX_APPID": "",
"WX_MCHID": "",
"WX_V3_CODE": "",
"WX_NOTIFY_URL": "",
"WX_SERIAL_NO": "",
"WX_PRIVATE_KEY": ""
}
} }
} }
``` ```
### One API 使用 ### One API 使用
......
--- ---
title: 'V4.6.6-alpha(需要改配置文件)' title: 'V4.6.6(需要改配置文件)'
description: 'FastGPT V4.6.6' description: 'FastGPT V4.6.6'
icon: 'upgrade' icon: 'upgrade'
draft: false draft: false
...@@ -7,8 +7,6 @@ toc: true ...@@ -7,8 +7,6 @@ toc: true
weight: 830 weight: 830
--- ---
**版本仍在开发中……**
## 配置文件变更 ## 配置文件变更
为了减少代码重复度,我们对配置文件做了一些修改:[点击查看最新的配置文件](/docs/development/configuration/) 为了减少代码重复度,我们对配置文件做了一些修改:[点击查看最新的配置文件](/docs/development/configuration/)
...@@ -18,4 +16,5 @@ weight: 830 ...@@ -18,4 +16,5 @@ weight: 830
1. 新增 - 搜索方式:分离向量语义检索,全文检索和重排,通过 RRF 进行排序合并。 1. 新增 - 搜索方式:分离向量语义检索,全文检索和重排,通过 RRF 进行排序合并。
2. 优化 - 问题分类提示词,id引导。测试国产商用 api 模型(百度阿里智谱讯飞)使用 Prompt 模式均可分类。 2. 优化 - 问题分类提示词,id引导。测试国产商用 api 模型(百度阿里智谱讯飞)使用 Prompt 模式均可分类。
3. UI 优化,未来将逐步替换新的UI设计。 3. UI 优化,未来将逐步替换新的UI设计。
4. 查看 [FastGPT 2024 RoadMap](https://github.com/labring/FastGPT?tab=readme-ov-file#-%E5%9C%A8%E7%BA%BF%E4%BD%BF%E7%94%A8) 4. 优化代码:Icon 抽离和自动化获取。
\ No newline at end of file 5. 查看 [FastGPT 2024 RoadMap](https://github.com/labring/FastGPT?tab=readme-ov-file#-%E5%9C%A8%E7%BA%BF%E4%BD%BF%E7%94%A8)
\ No newline at end of file
...@@ -49,7 +49,7 @@ FastGPT 采用了 `PostgresSQL` 的 `PG Vector` 插件作为向量检索器, ...@@ -49,7 +49,7 @@ FastGPT 采用了 `PostgresSQL` 的 `PG Vector` 插件作为向量检索器,
| 库 | 集合 | 数据 | | 库 | 集合 | 数据 |
| --- | --- | --- | | --- | --- | --- |
| ![](/imgs/datasetEngine1.png) | ![](/imgs/datasetEngine2.png) | ![](/imgs/datasetEngine3.png) | | ![](/imgs/datasetEngine1.jpg) | ![](/imgs/datasetEngine2.jpg) | ![](/imgs/datasetEngine3.jpg) |
### 导入数据方案1 - 直接分段导入 ### 导入数据方案1 - 直接分段导入
...@@ -57,7 +57,7 @@ FastGPT 采用了 `PostgresSQL` 的 `PG Vector` 插件作为向量检索器, ...@@ -57,7 +57,7 @@ FastGPT 采用了 `PostgresSQL` 的 `PG Vector` 插件作为向量检索器,
| 交互 | 结果 | | 交互 | 结果 |
| --- | --- | | --- | --- |
| ![](/imgs/datasetEngine4.png) | ![](/imgs/datasetEngine5.png) | | ![](/imgs/datasetEngine4.jpg) | ![](/imgs/datasetEngine5.jpg) |
### 导入数据方案2 - QA导入 ### 导入数据方案2 - QA导入
...@@ -66,7 +66,7 @@ FastGPT 采用了 `PostgresSQL` 的 `PG Vector` 插件作为向量检索器, ...@@ -66,7 +66,7 @@ FastGPT 采用了 `PostgresSQL` 的 `PG Vector` 插件作为向量检索器,
| 交互 | 结果 | | 交互 | 结果 |
| --- | --- | | --- | --- |
| ![](/imgs/datasetEngine6.png) | ![](/imgs/datasetEngine7.png) | | ![](/imgs/datasetEngine6.jpg) | ![](/imgs/datasetEngine7.jpg) |
### 导入数据方案3 - 手动录入 ### 导入数据方案3 - 手动录入
...@@ -74,7 +74,7 @@ FastGPT 采用了 `PostgresSQL` 的 `PG Vector` 插件作为向量检索器, ...@@ -74,7 +74,7 @@ FastGPT 采用了 `PostgresSQL` 的 `PG Vector` 插件作为向量检索器,
| | | | | | | |
| --- | --- | --- | | --- | --- | --- |
| ![](/imgs/datasetEngine8.png) | ![](/imgs/datasetEngine9.png) | ![](/imgs/datasetEngine10.png) | | ![](/imgs/datasetEngine8.jpg) | ![](/imgs/datasetEngine9.jpg) | ![](/imgs/datasetEngine10.jpg) |
### 导入数据方案4 - CSV录入 ### 导入数据方案4 - CSV录入
......
...@@ -21,7 +21,7 @@ weight: 504 ...@@ -21,7 +21,7 @@ weight: 504
密钥需要自己保管好,一旦关闭就无法再复制密钥,只能创建新密钥再复制。 密钥需要自己保管好,一旦关闭就无法再复制密钥,只能创建新密钥再复制。
{{% /alert %}} {{% /alert %}}
![](/imgs/fastgpt-api.png) ![](/imgs/fastgpt-api.jpg)
## 3. 创建 docker-compose.yml 文件 ## 3. 创建 docker-compose.yml 文件
......
...@@ -15,7 +15,7 @@ weight: 505 ...@@ -15,7 +15,7 @@ weight: 505
密钥需要自己保管好,一旦关闭就无法再复制密钥,只能创建新密钥再复制。 密钥需要自己保管好,一旦关闭就无法再复制密钥,只能创建新密钥再复制。
{{% /alert %}} {{% /alert %}}
![](/imgs/fastgpt-api.png) ![](/imgs/fastgpt-api.jpg)
{{% alert icon="🍅" context="success" %}} {{% alert icon="🍅" context="success" %}}
Tips: 安全起见,你可以设置一个额度或者过期时间,放置 key 被滥用。 Tips: 安全起见,你可以设置一个额度或者过期时间,放置 key 被滥用。
......
...@@ -9,7 +9,7 @@ weight: 402 ...@@ -9,7 +9,7 @@ weight: 402
| | | | | |
| --------------------- | --------------------- | | --------------------- | --------------------- |
| ![](/imgs/google_search_1.png) | ![](/imgs/google_search_2.png) | | ![](/imgs/google_search_1.jpg) | ![](/imgs/google_search_2.jpg) |
如上图,利用 HTTP 模块,你可以外接一个搜索引擎作为AI回复的参考资料。这里以调用 Google Search API 为例。注意:本文主要是为了介绍 HTTP 模型,具体的搜索效果需要依赖提示词和搜索引擎,尤其是【搜索引擎】,简单的搜索引擎无法获取更详细的内容,这部分可能需要更多的调试。 如上图,利用 HTTP 模块,你可以外接一个搜索引擎作为AI回复的参考资料。这里以调用 Google Search API 为例。注意:本文主要是为了介绍 HTTP 模型,具体的搜索效果需要依赖提示词和搜索引擎,尤其是【搜索引擎】,简单的搜索引擎无法获取更详细的内容,这部分可能需要更多的调试。
......
...@@ -9,8 +9,8 @@ weight: 403 ...@@ -9,8 +9,8 @@ weight: 403
| | | | | |
| --------------------- | --------------------- | | --------------------- | --------------------- |
| ![](/imgs/demo-appointment1.png) | ![](/imgs/demo-appointment2.png) | | ![](/imgs/demo-appointment1.jpg) | ![](/imgs/demo-appointment2.jpg) |
| ![](/imgs/demo-appointment3.png) | ![](/imgs/demo-appointment4.png) | | ![](/imgs/demo-appointment3.jpg) | ![](/imgs/demo-appointment4.jpg) |
...@@ -26,7 +26,7 @@ weight: 403 ...@@ -26,7 +26,7 @@ weight: 403
## 2. 问题分类 ## 2. 问题分类
![](/imgs/demo-appointment5.png) ![](/imgs/demo-appointment5.jpg)
如上图,用户问题作为对话的起点,流入【问题分类模块】,根据用户问题的内容,判断用户是询问实验室相关问题、预约实验室或其他问题。如果用户询问的是非实验问题,会直接拒绝回复内容。再根据问题是属于询问实验室相关/预约类问题,执行不同的流程。 如上图,用户问题作为对话的起点,流入【问题分类模块】,根据用户问题的内容,判断用户是询问实验室相关问题、预约实验室或其他问题。如果用户询问的是非实验问题,会直接拒绝回复内容。再根据问题是属于询问实验室相关/预约类问题,执行不同的流程。
...@@ -43,7 +43,7 @@ weight: 403 ...@@ -43,7 +43,7 @@ weight: 403
| | | | | | | |
| --------------------- | --------------------- |--------------------- | | --------------------- | --------------------- |--------------------- |
| ![](/imgs/demo-appointment6.png) | ![](/imgs/demo-appointment7.png) | ![](/imgs/demo-appointment8.png) | | ![](/imgs/demo-appointment6.jpg) | ![](/imgs/demo-appointment7.jpg) | ![](/imgs/demo-appointment8.jpg) |
内容提取是 LLM 带来的十分重要的能力,可以从自然语言中提取出结构化的数据,从而方便进行逻辑处理。 内容提取是 LLM 带来的十分重要的能力,可以从自然语言中提取出结构化的数据,从而方便进行逻辑处理。
...@@ -57,7 +57,7 @@ weight: 403 ...@@ -57,7 +57,7 @@ weight: 403
HTTP 模块允许你调用任意 GET/POST 类型的 HTTP 接口,从而实现一些复杂的业务逻辑。这里我们调用了一个预约实验室的接口,传入的是信息提取模块的结果和预约行为。 HTTP 模块允许你调用任意 GET/POST 类型的 HTTP 接口,从而实现一些复杂的业务逻辑。这里我们调用了一个预约实验室的接口,传入的是信息提取模块的结果和预约行为。
![](/imgs/demo-appointment9.png) ![](/imgs/demo-appointment9.jpg)
具体的入参结构可以参考[HTTP模块](/docs/workflow/modules/http/),实在不行在接口里多打印 Debug。 具体的入参结构可以参考[HTTP模块](/docs/workflow/modules/http/),实在不行在接口里多打印 Debug。
......
...@@ -13,7 +13,7 @@ weight: 364 ...@@ -13,7 +13,7 @@ weight: 364
- 有外部输入 - 有外部输入
- 触发执行 - 触发执行
![](/imgs/coreferenceResolution1.png) ![](/imgs/coreferenceResolution1.jpg)
## 背景 ## 背景
...@@ -21,11 +21,11 @@ weight: 364 ...@@ -21,11 +21,11 @@ weight: 364
在搜索的过程中,尤其是连续对话的搜索,我们通常会发现后续的问题难以搜索到合适的内容,其中一个原因是知识库搜索只会使用“当前”的问题去执行。看下面的例子: 在搜索的过程中,尤其是连续对话的搜索,我们通常会发现后续的问题难以搜索到合适的内容,其中一个原因是知识库搜索只会使用“当前”的问题去执行。看下面的例子:
![](/imgs/coreferenceResolution2.png) ![](/imgs/coreferenceResolution2.jpg)
用户在提问“第二点是什么”的时候,只会去知识库里查找“第二点是什么”,压根查不到内容。实际上需要查询的是“QA结构是什么”。因此我们需要引入一个【问题补全】模块,来对用户当前的问题进行补全,从而使得知识库搜索能够搜索到合适的内容。使用补全后效果如下: 用户在提问“第二点是什么”的时候,只会去知识库里查找“第二点是什么”,压根查不到内容。实际上需要查询的是“QA结构是什么”。因此我们需要引入一个【问题补全】模块,来对用户当前的问题进行补全,从而使得知识库搜索能够搜索到合适的内容。使用补全后效果如下:
![](/imgs/coreferenceResolution3.png) ![](/imgs/coreferenceResolution3.jpg)
## 功能 ## 功能
......
...@@ -18,8 +18,8 @@ weight: 354 ...@@ -18,8 +18,8 @@ weight: 354
| | | | | |
| --------------------- | --------------------- | | --------------------- | --------------------- |
| ![](/imgs/customfeedback1.png) | ![](/imgs/customfeedback2.png) | | ![](/imgs/customfeedback1.jpg) | ![](/imgs/customfeedback2.jpg) |
| ![](/imgs/customfeedback3.png) | ![](/imgs/customfeedback4.png) | | ![](/imgs/customfeedback3.jpg) | ![](/imgs/customfeedback4.jpg) |
## 介绍 ## 介绍
......
...@@ -15,7 +15,7 @@ weight: 355 ...@@ -15,7 +15,7 @@ weight: 355
- 触发执行 - 触发执行
- 核中核模块 - 核中核模块
![](/imgs/http1.png) ![](/imgs/http1.jpg)
## 介绍 ## 介绍
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
"format-code": "prettier --config \"./.prettierrc.js\" --write \"./**/src/**/*.{ts,tsx,scss}\"", "format-code": "prettier --config \"./.prettierrc.js\" --write \"./**/src/**/*.{ts,tsx,scss}\"",
"format-doc": "zhlint --dir ./docSite *.md --fix", "format-doc": "zhlint --dir ./docSite *.md --fix",
"gen:theme-typings": "chakra-cli tokens projects/app/src/web/styles/theme.ts --out node_modules/.pnpm/node_modules/@chakra-ui/styled-system/dist/theming.types.d.ts", "gen:theme-typings": "chakra-cli tokens projects/app/src/web/styles/theme.ts --out node_modules/.pnpm/node_modules/@chakra-ui/styled-system/dist/theming.types.d.ts",
"postinstall": "sh ./scripts/postinstall.sh" "postinstall": "sh ./scripts/postinstall.sh",
"initIcon": "node ./scripts/icon/init.js",
"previewIcon": "node ./scripts/icon/index.js"
}, },
"devDependencies": { "devDependencies": {
"@chakra-ui/cli": "^2.4.1", "@chakra-ui/cli": "^2.4.1",
......
...@@ -42,7 +42,7 @@ export const AiCFR: FlowModuleTemplateType = { ...@@ -42,7 +42,7 @@ export const AiCFR: FlowModuleTemplateType = {
label: 'core.module.input.label.cfr background', label: 'core.module.input.label.cfr background',
max: 300, max: 300,
valueType: ModuleIOValueTypeEnum.string, valueType: ModuleIOValueTypeEnum.string,
description: 'core.module.input.description.cfr background', description: 'core.app.edit.cfr background tip',
placeholder: 'core.module.input.placeholder.cfr background', placeholder: 'core.module.input.placeholder.cfr background',
showTargetInApp: true, showTargetInApp: true,
showTargetInPlugin: true showTargetInPlugin: true
......
import React from 'react'; import React from 'react';
import { Flex, type FlexProps } from '@chakra-ui/react'; import { Flex, type FlexProps } from '@chakra-ui/react';
import MyIcon from '@/components/Icon'; import MyIcon from './index';
const CloseIcon = (props: FlexProps) => { const CloseIcon = (props: FlexProps) => {
return ( return (
...@@ -14,7 +14,7 @@ const CloseIcon = (props: FlexProps) => { ...@@ -14,7 +14,7 @@ const CloseIcon = (props: FlexProps) => {
_hover={{ bg: 'myGray.200' }} _hover={{ bg: 'myGray.200' }}
{...props} {...props}
> >
<MyIcon name={'closeLight'} w={'12px'} color={'myGray.500'} /> <MyIcon name={'common/closeLight'} w={'12px'} color={'myGray.500'} />
</Flex> </Flex>
); );
}; };
......
import React, { useEffect, useState } from 'react'; // @ts-nocheck
import type { IconProps } from '@chakra-ui/react';
import { Icon } from '@chakra-ui/react';
const iconPaths = { export const iconPaths = {
copy: () => import('./icons/copy.svg'), chat: () => import('./icons/chat.svg'),
delete: () => import('./icons/delete.svg'), chatSend: () => import('./icons/chatSend.svg'),
stop: () => import('./icons/stop.svg'), closeSolid: () => import('./icons/closeSolid.svg'),
collectionLight: () => import('./icons/collectionLight.svg'), collectionLight: () => import('./icons/collectionLight.svg'),
collectionSolid: () => import('./icons/collectionSolid.svg'), collectionSolid: () => import('./icons/collectionSolid.svg'),
empty: () => import('./icons/empty.svg'), 'common/addCircleLight': () => import('./icons/common/addCircleLight.svg'),
back: () => import('./icons/back.svg'), 'common/backFill': () => import('./icons/common/backFill.svg'),
backFill: () => import('./icons/fill/back.svg'), 'common/backLight': () => import('./icons/common/backLight.svg'),
more: () => import('./icons/more.svg'), 'common/clearLight': () => import('./icons/common/clearLight.svg'),
tabbarChat: () => import('./icons/phoneTabbar/chat.svg'), 'common/closeLight': () => import('./icons/common/closeLight.svg'),
tabbarModel: () => import('./icons/phoneTabbar/app.svg'), 'common/confirm/commonTip': () => import('./icons/common/confirm/commonTip.svg'),
tabbarMore: () => import('./icons/phoneTabbar/more.svg'), 'common/confirm/deleteTip': () => import('./icons/common/confirm/deleteTip.svg'),
tabbarMe: () => import('./icons/phoneTabbar/me.svg'), 'common/courseLight': () => import('./icons/common/courseLight.svg'),
closeSolid: () => import('./icons/closeSolid.svg'), 'common/customTitleLight': () => import('./icons/common/customTitleLight.svg'),
wx: () => import('./icons/wx.svg'), 'common/file/move': () => import('./icons/common/file/move.svg'),
out: () => import('./icons/out.svg'), 'common/fullScreenLight': () => import('./icons/common/fullScreenLight.svg'),
git: () => import('./icons/git.svg'), 'common/gitFill': () => import('./icons/common/gitFill.svg'),
gitFill: () => import('./icons/fill/git.svg'), 'common/gitLight': () => import('./icons/common/gitLight.svg'),
googleFill: () => import('./icons/fill/google.svg'), 'common/googleFill': () => import('./icons/common/googleFill.svg'),
menu: () => import('./icons/menu.svg'), 'common/importLight': () => import('./icons/common/importLight.svg'),
edit: () => import('./icons/edit.svg'), 'common/inviteLight': () => import('./icons/common/inviteLight.svg'),
inform: () => import('./icons/inform.svg'),
export: () => import('./icons/export.svg'),
text: () => import('./icons/text.svg'),
history: () => import('./icons/history.svg'),
kbTest: () => import('./icons/kbTest.svg'),
date: () => import('./icons/date.svg'),
apikey: () => import('./icons/apikey.svg'),
apikeyFill: () => import('./icons/fill/apikey.svg'),
save: () => import('./icons/save.svg'),
minus: () => import('./icons/minus.svg'),
chat: () => import('./icons/light/chat.svg'),
chatFill: () => import('./icons/fill/chat.svg'),
clear: () => import('./icons/light/clear.svg'),
apiLight: () => import('./icons/light/appApi.svg'),
overviewLight: () => import('./icons/light/overview.svg'),
settingLight: () => import('./icons/light/setting.svg'),
shareLight: () => import('./icons/light/share.svg'),
dbLight: () => import('./icons/light/db.svg'),
dbFill: () => import('./icons/fill/db.svg'),
appStoreLight: () => import('./icons/light/appStore.svg'),
appStoreFill: () => import('./icons/fill/appStore.svg'),
meLight: () => import('./icons/light/me.svg'),
meFill: () => import('./icons/fill/me.svg'),
welcomeText: () => import('./icons/modules/welcomeText.svg'),
variable: () => import('./icons/modules/variable.svg'),
setTop: () => import('./icons/light/setTop.svg'),
fullScreenLight: () => import('./icons/light/fullScreen.svg'),
voice: () => import('./icons/voice.svg'),
html: () => import('./icons/file/html.svg'),
pdf: () => import('./icons/file/pdf.svg'),
markdown: () => import('./icons/file/markdown.svg'),
importLight: () => import('./icons/light/import.svg'),
manualImport: () => import('./icons/file/manualImport.svg'),
indexImport: () => import('./icons/file/indexImport.svg'),
csvImport: () => import('./icons/file/csv.svg'),
qaImport: () => import('./icons/file/qaImport.svg'),
uploadFile: () => import('./icons/file/uploadFile.svg'),
closeLight: () => import('./icons/light/close.svg'),
customTitle: () => import('./icons/light/customTitle.svg'),
billRecordLight: () => import('./icons/light/billRecord.svg'),
informLight: () => import('./icons/light/inform.svg'),
'support/pay/payRecordLight': () => import('./icons/support/pay/payRecordLight.svg'),
'support/account/loginoutLight': () => import('./icons/support/account/loginoutLight.svg'),
'core/chat/chatModelTag': () => import('./icons/core/chat/chatModelTag.svg'),
'common/language/en': () => import('./icons/common/language/en.svg'), 'common/language/en': () => import('./icons/common/language/en.svg'),
'common/language/zh': () => import('./icons/common/language/zh.svg'), 'common/language/zh': () => import('./icons/common/language/zh.svg'),
'support/outlink/shareLight': () => import('./icons/support/outlink/shareLight.svg'), 'common/loading': () => import('./icons/common/loading.svg'),
'support/outlink/iframeLight': () => import('./icons/support/outlink/iframeLight.svg'), 'common/navbar/pluginFill': () => import('./icons/common/navbar/pluginFill.svg'),
'common/addCircleLight': () => import('./icons/common/addCircleLight.svg'), 'common/navbar/pluginLight': () => import('./icons/common/navbar/pluginLight.svg'),
'common/overviewLight': () => import('./icons/common/overviewLight.svg'),
'common/playFill': () => import('./icons/common/playFill.svg'), 'common/playFill': () => import('./icons/common/playFill.svg'),
'common/courseLight': () => import('./icons/common/courseLight.svg'), 'common/playLight': () => import('./icons/common/playLight.svg'),
'support/account/promotionLight': () => import('./icons/support/account/promotionLight.svg'), 'common/questionLight': () => import('./icons/common/questionLight.svg'),
'core/app/logsLight': () => import('./icons/core/app/logsLight.svg'), 'common/refreshLight': () => import('./icons/common/refreshLight.svg'),
'core/chat/feedback/badLight': () => import('./icons/core/chat/feedback/badLight.svg'),
'core/chat/feedback/goodLight': () => import('./icons/core/chat/feedback/goodLight.svg'),
'core/app/markLight': () => import('./icons/core/app/markLight.svg'),
'common/retryLight': () => import('./icons/common/retryLight.svg'), 'common/retryLight': () => import('./icons/common/retryLight.svg'),
'common/rightArrowLight': () => import('./icons/common/rightArrowLight.svg'), 'common/rightArrowLight': () => import('./icons/common/rightArrowLight.svg'),
'common/routePushLight': () => import('./icons/common/routePushLight.svg'),
'common/searchLight': () => import('./icons/common/searchLight.svg'), 'common/searchLight': () => import('./icons/common/searchLight.svg'),
'common/file/move': () => import('./icons/common/file/move.svg'), 'common/settingLight': () => import('./icons/common/settingLight.svg'),
'core/app/questionGuide': () => import('./icons/core/app/questionGuide.svg'),
'common/loading': () => import('./icons/common/loading.svg'),
'core/app/aiLight': () => import('./icons/core/app/aiLight.svg'),
'core/app/aiFill': () => import('./icons/core/app/aiFill.svg'),
'common/text/t': () => import('./icons/common/text/t.svg'), 'common/text/t': () => import('./icons/common/text/t.svg'),
'common/navbar/pluginLight': () => import('./icons/common/navbar/pluginLight.svg'),
'common/navbar/pluginFill': () => import('./icons/common/navbar/pluginFill.svg'),
'common/refreshLight': () => import('./icons/common/refreshLight.svg'),
'core/module/previewLight': () => import('./icons/core/module/previewLight.svg'),
'core/chat/quoteFill': () => import('./icons/core/chat/quoteFill.svg'),
'core/chat/QGFill': () => import('./icons/core/chat/QGFill.svg'),
'common/tickFill': () => import('./icons/common/tickFill.svg'), 'common/tickFill': () => import('./icons/common/tickFill.svg'),
'common/inviteLight': () => import('./icons/common/inviteLight.svg'), 'common/viewLight': () => import('./icons/common/viewLight.svg'),
'support/team/memberLight': () => import('./icons/support/team/memberLight.svg'), 'common/voiceLight': () => import('./icons/common/voiceLight.svg'),
'support/permission/privateLight': () => import('./icons/support/permission/privateLight.svg'), copy: () => import('./icons/copy.svg'),
'support/permission/publicLight': () => import('./icons/support/permission/publicLight.svg'), 'core/app/aiFill': () => import('./icons/core/app/aiFill.svg'),
'core/app/ttsFill': () => import('./icons/core/app/ttsFill.svg'), 'core/app/aiLight': () => import('./icons/core/app/aiLight.svg'),
'core/app/tts': () => import('./icons/core/app/tts.svg'), 'core/app/appApiLight': () => import('./icons/core/app/appApiLight.svg'),
'core/app/customFeedback': () => import('./icons/core/app/customFeedback.svg'),
'core/app/headphones': () => import('./icons/core/app/headphones.svg'), 'core/app/headphones': () => import('./icons/core/app/headphones.svg'),
'common/playLight': () => import('./icons/common/playLight.svg'), 'core/app/logsLight': () => import('./icons/core/app/logsLight.svg'),
'core/app/markLight': () => import('./icons/core/app/markLight.svg'),
'core/app/questionGuide': () => import('./icons/core/app/questionGuide.svg'),
'core/app/tts': () => import('./icons/core/app/tts.svg'),
'core/app/ttsFill': () => import('./icons/core/app/ttsFill.svg'),
'core/app/variable/input': () => import('./icons/core/app/variable/input.svg'),
'core/app/variable/select': () => import('./icons/core/app/variable/select.svg'),
'core/app/variable/textarea': () => import('./icons/core/app/variable/textarea.svg'),
'core/chat/QGFill': () => import('./icons/core/chat/QGFill.svg'),
'core/chat/chatFill': () => import('./icons/core/chat/chatFill.svg'),
'core/chat/chatLight': () => import('./icons/core/chat/chatLight.svg'),
'core/chat/chatModelTag': () => import('./icons/core/chat/chatModelTag.svg'),
'core/chat/feedback/badLight': () => import('./icons/core/chat/feedback/badLight.svg'),
'core/chat/feedback/goodLight': () => import('./icons/core/chat/feedback/goodLight.svg'),
'core/chat/fileSelect': () => import('./icons/core/chat/fileSelect.svg'),
'core/chat/quoteFill': () => import('./icons/core/chat/quoteFill.svg'),
'core/chat/quoteSign': () => import('./icons/core/chat/quoteSign.svg'), 'core/chat/quoteSign': () => import('./icons/core/chat/quoteSign.svg'),
'core/chat/sendLight': () => import('./icons/core/chat/sendLight.svg'),
'core/chat/sendFill': () => import('./icons/core/chat/sendFill.svg'),
'core/chat/recordFill': () => import('./icons/core/chat/recordFill.svg'), 'core/chat/recordFill': () => import('./icons/core/chat/recordFill.svg'),
'core/chat/stopSpeechFill': () => import('./icons/core/chat/stopSpeechFill.svg'), 'core/chat/sendFill': () => import('./icons/core/chat/sendFill.svg'),
'core/chat/stopSpeech': () => import('./icons/core/chat/stopSpeech.svg'), 'core/chat/sendLight': () => import('./icons/core/chat/sendLight.svg'),
'core/chat/setTopLight': () => import('./icons/core/chat/setTopLight.svg'),
'core/chat/speaking': () => import('./icons/core/chat/speaking.svg'), 'core/chat/speaking': () => import('./icons/core/chat/speaking.svg'),
'core/chat/fileSelect': () => import('./icons/core/chat/fileSelect.svg'), 'core/chat/stopSpeech': () => import('./icons/core/chat/stopSpeech.svg'),
'core/dataset/modeEmbedding': () => import('./icons/core/dataset/modeEmbedding.svg'), 'core/chat/stopSpeechFill': () => import('./icons/core/chat/stopSpeechFill.svg'),
'core/dataset/commonDataset': () => import('./icons/core/dataset/commonDataset.svg'),
'core/dataset/datasetFill': () => import('./icons/core/dataset/datasetFill.svg'),
'core/dataset/datasetLight': () => import('./icons/core/dataset/datasetLight.svg'),
'core/dataset/folderDataset': () => import('./icons/core/dataset/folderDataset.svg'),
'core/dataset/fullTextRecall': () => import('./icons/core/dataset/fullTextRecall.svg'), 'core/dataset/fullTextRecall': () => import('./icons/core/dataset/fullTextRecall.svg'),
'core/dataset/mixedRecall': () => import('./icons/core/dataset/mixedRecall.svg'), 'core/dataset/mixedRecall': () => import('./icons/core/dataset/mixedRecall.svg'),
'core/app/variable/input': () => import('./icons/core/app/variable/input.svg'), 'core/dataset/modeEmbedding': () => import('./icons/core/dataset/modeEmbedding.svg'),
'core/app/variable/textarea': () => import('./icons/core/app/variable/textarea.svg'), 'core/dataset/rerank': () => import('./icons/core/dataset/rerank.svg'),
'core/app/variable/select': () => import('./icons/core/app/variable/select.svg'),
'core/dataset/websiteDataset': () => import('./icons/core/dataset/websiteDataset.svg'), 'core/dataset/websiteDataset': () => import('./icons/core/dataset/websiteDataset.svg'),
'core/dataset/commonDataset': () => import('./icons/core/dataset/commonDataset.svg'), 'core/modules/previewLight': () => import('./icons/core/modules/previewLight.svg'),
'core/dataset/folderDataset': () => import('./icons/core/dataset/folderDataset.svg'), 'core/modules/variable': () => import('./icons/core/modules/variable.svg'),
'common/confirm/deleteTip': () => import('./icons/common/confirm/deleteTip.svg'), 'core/modules/welcomeText': () => import('./icons/core/modules/welcomeText.svg'),
'common/confirm/commonTip': () => import('./icons/common/confirm/commonTip.svg'), date: () => import('./icons/date.svg'),
'common/routePushLight': () => import('./icons/common/routePushLight.svg'), delete: () => import('./icons/delete.svg'),
'common/viewLight': () => import('./icons/common/viewLight.svg'), edit: () => import('./icons/edit.svg'),
'core/app/customFeedback': () => import('./icons/core/app/customFeedback.svg'), empty: () => import('./icons/empty.svg'),
export: () => import('./icons/export.svg'),
'file/csv': () => import('./icons/file/csv.svg'),
'file/html': () => import('./icons/file/html.svg'),
'file/indexImport': () => import('./icons/file/indexImport.svg'),
'file/manualImport': () => import('./icons/file/manualImport.svg'),
'file/markdown': () => import('./icons/file/markdown.svg'),
'file/pdf': () => import('./icons/file/pdf.svg'),
'file/qaImport': () => import('./icons/file/qaImport.svg'),
'file/uploadFile': () => import('./icons/file/uploadFile.svg'),
history: () => import('./icons/history.svg'),
inform: () => import('./icons/inform.svg'),
kbTest: () => import('./icons/kbTest.svg'),
menu: () => import('./icons/menu.svg'),
minus: () => import('./icons/minus.svg'),
more: () => import('./icons/more.svg'),
out: () => import('./icons/out.svg'),
'phoneTabbar/me': () => import('./icons/phoneTabbar/me.svg'),
'phoneTabbar/more': () => import('./icons/phoneTabbar/more.svg'),
save: () => import('./icons/save.svg'),
stop: () => import('./icons/stop.svg'),
'support/account/loginoutLight': () => import('./icons/support/account/loginoutLight.svg'),
'support/account/promotionLight': () => import('./icons/support/account/promotionLight.svg'),
'support/bill/billRecordLight': () => import('./icons/support/bill/billRecordLight.svg'),
'support/outlink/apikeyFill': () => import('./icons/support/outlink/apikeyFill.svg'),
'support/outlink/apikeyLight': () => import('./icons/support/outlink/apikeyLight.svg'),
'support/outlink/iframeLight': () => import('./icons/support/outlink/iframeLight.svg'),
'support/outlink/share': () => import('./icons/support/outlink/share.svg'),
'support/outlink/shareLight': () => import('./icons/support/outlink/shareLight.svg'),
'support/pay/payRecordLight': () => import('./icons/support/pay/payRecordLight.svg'),
'support/pay/priceLight': () => import('./icons/support/pay/priceLight.svg'), 'support/pay/priceLight': () => import('./icons/support/pay/priceLight.svg'),
'core/dataset/rerank': () => import('./icons/core/dataset/rerank.svg') 'support/permission/privateLight': () => import('./icons/support/permission/privateLight.svg'),
}; 'support/permission/publicLight': () => import('./icons/support/permission/publicLight.svg'),
'support/team/memberLight': () => import('./icons/support/team/memberLight.svg'),
export type IconName = keyof typeof iconPaths; 'support/user/informLight': () => import('./icons/support/user/informLight.svg'),
'support/user/userFill': () => import('./icons/support/user/userFill.svg'),
const MyIcon = ({ name, w = 'auto', h = 'auto', ...props }: { name: IconName } & IconProps) => { 'support/user/userLight': () => import('./icons/support/user/userLight.svg'),
const [IconComponent, setIconComponent] = useState<any>(null); text: () => import('./icons/text.svg'),
user: () => import('./icons/user.svg'),
useEffect(() => { wx: () => import('./icons/wx.svg')
iconPaths[name]?.()
.then((icon) => {
setIconComponent({ as: icon.default });
})
.catch((error) => console.log(error));
}, [name]);
return !!name && !!iconPaths[name] ? (
<Icon
{...IconComponent}
w={w}
h={h}
boxSizing={'content-box'}
verticalAlign={'top'}
fill={'currentcolor'}
{...props}
/>
) : null;
}; };
export default MyIcon;
import React from 'react'; import React from 'react';
import MyIcon from '@/components/Icon'; import MyIcon from './index';
import { IconProps } from '@chakra-ui/react'; import { IconProps } from '@chakra-ui/react';
const DeleteIcon = (props: IconProps) => { const DeleteIcon = (props: IconProps) => {
......
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
<path fill-rule="evenodd" clip-rule="evenodd"
d="M8.99997 2.196C5.24222 2.196 2.19596 5.24225 2.19596 9C2.19596 12.7577 5.24222 15.804 8.99997 15.804C12.7577 15.804 15.804 12.7577 15.804 9C15.804 5.24225 12.7577 2.196 8.99997 2.196ZM0.529297 9C0.529297 4.32178 4.32174 0.529331 8.99997 0.529331C13.6782 0.529331 17.4706 4.32178 17.4706 9C17.4706 13.6782 13.6782 17.4707 8.99997 17.4707C4.32174 17.4707 0.529297 13.6782 0.529297 9ZM9.18533 6.03224C8.846 5.97403 8.49702 6.0378 8.20019 6.21224C7.90337 6.38669 7.67786 6.66056 7.56361 6.98534C7.41089 7.41949 6.93512 7.64764 6.50097 7.49491C6.06681 7.34218 5.83866 6.86642 5.99139 6.43226C6.23625 5.73619 6.71956 5.14923 7.35572 4.77536C7.99188 4.40148 8.73983 4.26481 9.4671 4.38956C10.1944 4.5143 10.854 4.89241 11.3292 5.45692C11.8043 6.0213 12.0644 6.73558 12.0634 7.4733C12.063 8.67899 11.1697 9.46897 10.5467 9.88431C10.2098 10.1089 9.8788 10.2738 9.63531 10.382C9.51239 10.4367 9.4088 10.4782 9.33398 10.5067C9.2965 10.5209 9.26605 10.532 9.24377 10.54L9.21658 10.5495L9.20781 10.5525L9.20467 10.5535L9.20342 10.554C9.20317 10.554 9.20239 10.5543 8.93887 9.76373L9.20239 10.5543C8.76577 10.6998 8.29384 10.4639 8.1483 10.0273C8.00281 9.59078 8.23857 9.11902 8.67491 8.97331L8.68542 8.9696C8.69671 8.96559 8.71548 8.95878 8.74065 8.94919C8.79114 8.92996 8.86654 8.89986 8.95842 8.85902C9.14454 8.7763 9.38634 8.65481 9.62222 8.49756C10.1447 8.14925 10.3967 7.79388 10.3967 7.47253L10.3967 7.47129C10.3972 7.127 10.2759 6.79364 10.0542 6.53025C9.83245 6.26686 9.52467 6.09044 9.18533 6.03224ZM8.16663 12.8187C8.16663 12.3584 8.53973 11.9853 8.99997 11.9853H9.0076C9.46784 11.9853 9.84094 12.3584 9.84094 12.8187C9.84094 13.2789 9.46784 13.652 9.0076 13.652H8.99997C8.53973 13.652 8.16663 13.2789 8.16663 12.8187Z" />
</svg>
\ No newline at end of file
<svg t="1704288747524" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="823"
width="128" height="128">
<path
d="M612.9677822 771.22985005l-276.90461259-153.18127485C300.71364453 659.28968825 253.58094352 688.74762534 194.66506932 688.74762534c-100.15698723 0-176.74762534-76.59063811-176.74762534-176.74762534s76.59063811-176.74762534 176.74762534-176.74762534c58.91587557 0 111.94016319 29.45793709 147.28968688 76.59063811L665.99206979 246.87856197V217.42062487c0-100.15698723 76.59063811-176.74762534 176.74762536-176.74762534s176.74762534 76.59063811 176.74762535 176.74762534-76.59063811 176.74762534-176.74762535 176.74762536c-64.80746218 0-123.72333775-35.34952507-153.18127485-88.37381267l-324.0373136 159.0728628c5.89158797 11.78317456 5.89158797 29.45793709 5.89158798 47.13269964 0 17.67476253-5.89158797 41.24111305-11.78317595 58.91587557l271.01302601 147.28968687c35.34952507-53.02428761 88.37381268-88.37381268 153.18127483-88.37381267 100.15698723 0 176.74762534 76.59063811 176.74762535 176.74762536s-76.59063811 176.74762534-176.74762535 176.74762534-176.74762534-76.59063811-176.74762534-176.74762534c0-11.78317456 0-23.56635051 5.89158797-35.34952508zM194.66506932 629.83174977c64.80746218 0 117.83174977-53.02428761 117.83174978-117.83174977s-53.02428761-117.83174977-117.83174978-117.83174977-117.83174977 53.02428761-117.83175114 117.83174977 53.02428761 117.83174977 117.83175114 117.83174977z m648.07462583-294.57937511c64.80746218 0 117.83174977-53.02428761 117.83174977-117.83174979s-53.02428761-117.83174977-117.83174977-117.83175114-117.83174977 53.02428761-117.83174977 117.83175114 53.02428761 117.83174977 117.83174977 117.83174979z m-58.91587558 589.15875161c64.80746218 0 117.83174977-53.02428761 117.83175115-117.83175114s-53.02428761-117.83174977-117.83175115-117.83174979-117.83174977 53.02428761-117.83174978 117.83174979 53.02428761 117.83174977 117.83174978 117.83175114z"
p-id="824"></path>
</svg>
\ No newline at end of file
import React, { useEffect, useState } from 'react';
import type { IconProps } from '@chakra-ui/react';
import { Icon } from '@chakra-ui/react';
import { iconPaths } from './constants';
import type { IconNameType } from './type.d';
const MyIcon = ({ name, w = 'auto', h = 'auto', ...props }: { name: IconNameType } & IconProps) => {
const [IconComponent, setIconComponent] = useState<any>(null);
useEffect(() => {
iconPaths[name]?.()
.then((icon) => {
setIconComponent({ as: icon.default });
})
.catch((error) => console.log(error));
}, [name]);
return !!name && !!iconPaths[name] ? (
<Icon
{...IconComponent}
w={w}
h={h}
boxSizing={'content-box'}
verticalAlign={'top'}
fill={'currentcolor'}
{...props}
/>
) : null;
};
export default MyIcon;
import { iconPaths } from './constants';
export type IconNameType = keyof typeof iconPaths;
...@@ -4,9 +4,24 @@ ...@@ -4,9 +4,24 @@
"dependencies": { "dependencies": {
"@fastgpt/global": "workspace:*", "@fastgpt/global": "workspace:*",
"joplin-turndown-plugin-gfm": "^1.0.12", "joplin-turndown-plugin-gfm": "^1.0.12",
"turndown": "^7.1.2" "turndown": "^7.1.2",
"@chakra-ui/anatomy": "^2.2.1",
"@chakra-ui/icons": "^2.1.1",
"@chakra-ui/next-js": "^2.1.5",
"@chakra-ui/react": "^2.8.1",
"@chakra-ui/styled-system": "^2.9.1",
"@chakra-ui/system": "^2.6.1",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"i18next": "^22.5.1",
"next-i18next": "^13.3.0",
"react-i18next": "^12.3.1"
}, },
"devDependencies": { "devDependencies": {
"@types/turndown": "^5.0.4" "@types/turndown": "^5.0.4",
"@types/react": "18.2.0",
"@types/react-dom": "18.2.0"
} }
} }
...@@ -14,8 +14,11 @@ ...@@ -14,8 +14,11 @@
"isolatedModules": true, "isolatedModules": true,
"jsx": "preserve", "jsx": "preserve",
"incremental": true, "incremental": true,
"baseUrl": "." "baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
}, },
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.d.ts", "../**/*.d.ts"], "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.d.ts", "../**/*.d.ts"],
"exclude": ["node_modules"] "exclude": ["node_modules","./components/common/Icon/constants.ts"]
} }
...@@ -136,16 +136,61 @@ importers: ...@@ -136,16 +136,61 @@ importers:
packages/web: packages/web:
dependencies: dependencies:
'@chakra-ui/anatomy':
specifier: ^2.2.1
version: registry.npmmirror.com/@chakra-ui/anatomy@2.2.1
'@chakra-ui/icons':
specifier: ^2.1.1
version: registry.npmmirror.com/@chakra-ui/icons@2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0)
'@chakra-ui/next-js':
specifier: ^2.1.5
version: registry.npmmirror.com/@chakra-ui/next-js@2.1.5(@chakra-ui/react@2.8.1)(@emotion/react@11.11.1)(next@13.5.2)(react@18.2.0)
'@chakra-ui/react':
specifier: ^2.8.1
version: registry.npmmirror.com/@chakra-ui/react@2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.0)(framer-motion@9.0.6)(react-dom@18.2.0)(react@18.2.0)
'@chakra-ui/styled-system':
specifier: ^2.9.1
version: registry.npmmirror.com/@chakra-ui/styled-system@2.9.1
'@chakra-ui/system':
specifier: ^2.6.1
version: registry.npmmirror.com/@chakra-ui/system@2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0)
'@emotion/react':
specifier: ^11.11.1
version: registry.npmmirror.com/@emotion/react@11.11.1(@types/react@18.2.0)(react@18.2.0)
'@emotion/styled':
specifier: ^11.11.0
version: registry.npmmirror.com/@emotion/styled@11.11.0(@emotion/react@11.11.1)(@types/react@18.2.0)(react@18.2.0)
'@fastgpt/global': '@fastgpt/global':
specifier: workspace:* specifier: workspace:*
version: link:../global version: link:../global
i18next:
specifier: ^22.5.1
version: registry.npmmirror.com/i18next@22.5.1
joplin-turndown-plugin-gfm: joplin-turndown-plugin-gfm:
specifier: ^1.0.12 specifier: ^1.0.12
version: registry.npmmirror.com/joplin-turndown-plugin-gfm@1.0.12 version: registry.npmmirror.com/joplin-turndown-plugin-gfm@1.0.12
next-i18next:
specifier: ^13.3.0
version: registry.npmmirror.com/next-i18next@13.3.0(i18next@22.5.1)(next@13.5.2)(react-i18next@12.3.1)(react@18.2.0)
react:
specifier: 18.2.0
version: registry.npmmirror.com/react@18.2.0
react-dom:
specifier: 18.2.0
version: registry.npmmirror.com/react-dom@18.2.0(react@18.2.0)
react-i18next:
specifier: ^12.3.1
version: registry.npmmirror.com/react-i18next@12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0)
turndown: turndown:
specifier: ^7.1.2 specifier: ^7.1.2
version: registry.npmmirror.com/turndown@7.1.2 version: registry.npmmirror.com/turndown@7.1.2
devDependencies: devDependencies:
'@types/react':
specifier: 18.2.0
version: registry.npmmirror.com/@types/react@18.2.0
'@types/react-dom':
specifier: 18.2.0
version: registry.npmmirror.com/@types/react-dom@18.2.0
'@types/turndown': '@types/turndown':
specifier: ^5.0.4 specifier: ^5.0.4
version: registry.npmmirror.com/@types/turndown@5.0.4 version: registry.npmmirror.com/@types/turndown@5.0.4
...@@ -346,112 +391,6 @@ importers: ...@@ -346,112 +391,6 @@ importers:
specifier: 4.9.5 specifier: 4.9.5
version: registry.npmmirror.com/typescript@4.9.5 version: registry.npmmirror.com/typescript@4.9.5
projects/home:
dependencies:
'@chakra-ui/anatomy':
specifier: ^2.2.1
version: registry.npmmirror.com/@chakra-ui/anatomy@2.2.1
'@chakra-ui/icons':
specifier: ^2.1.1
version: registry.npmmirror.com/@chakra-ui/icons@2.1.1(@chakra-ui/system@2.6.1)(react@18.2.0)
'@chakra-ui/next-js':
specifier: ^2.1.5
version: registry.npmmirror.com/@chakra-ui/next-js@2.1.5(@chakra-ui/react@2.8.1)(@emotion/react@11.11.1)(next@13.5.2)(react@18.2.0)
'@chakra-ui/react':
specifier: ^2.8.1
version: registry.npmmirror.com/@chakra-ui/react@2.8.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.0)(framer-motion@9.0.6)(react-dom@18.2.0)(react@18.2.0)
'@chakra-ui/styled-system':
specifier: ^2.9.1
version: registry.npmmirror.com/@chakra-ui/styled-system@2.9.1
'@chakra-ui/system':
specifier: ^2.6.1
version: registry.npmmirror.com/@chakra-ui/system@2.6.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0)
'@emotion/react':
specifier: ^11.11.1
version: registry.npmmirror.com/@emotion/react@11.11.1(@types/react@18.2.0)(react@18.2.0)
'@emotion/styled':
specifier: ^11.11.0
version: registry.npmmirror.com/@emotion/styled@11.11.0(@emotion/react@11.11.1)(@types/react@18.2.0)(react@18.2.0)
axios:
specifier: ^1.5.1
version: registry.npmmirror.com/axios@1.5.1
framer-motion:
specifier: ^9.0.6
version: registry.npmmirror.com/framer-motion@9.0.6(react-dom@18.2.0)(react@18.2.0)
hyperdown:
specifier: ^2.4.29
version: registry.npmmirror.com/hyperdown@2.4.29
i18next:
specifier: ^22.5.1
version: registry.npmmirror.com/i18next@22.5.1
next:
specifier: 13.5.2
version: registry.npmmirror.com/next@13.5.2(@babel/core@7.23.6)(react-dom@18.2.0)(react@18.2.0)(sass@1.58.3)
next-i18next:
specifier: ^13.3.0
version: registry.npmmirror.com/next-i18next@13.3.0(i18next@22.5.1)(next@13.5.2)(react-i18next@12.3.1)(react@18.2.0)
nprogress:
specifier: ^0.2.0
version: registry.npmmirror.com/nprogress@0.2.0
react:
specifier: 18.2.0
version: registry.npmmirror.com/react@18.2.0
react-dom:
specifier: 18.2.0
version: registry.npmmirror.com/react-dom@18.2.0(react@18.2.0)
react-i18next:
specifier: ^12.3.1
version: registry.npmmirror.com/react-i18next@12.3.1(i18next@22.5.1)(react-dom@18.2.0)(react@18.2.0)
react-markdown:
specifier: ^8.0.7
version: registry.npmmirror.com/react-markdown@8.0.7(@types/react@18.2.0)(react@18.2.0)
remark-breaks:
specifier: ^3.0.3
version: registry.npmmirror.com/remark-breaks@3.0.3
remark-gfm:
specifier: ^3.0.1
version: registry.npmmirror.com/remark-gfm@3.0.1
request-ip:
specifier: ^3.3.0
version: registry.npmmirror.com/request-ip@3.3.0
sass:
specifier: ^1.58.3
version: registry.npmmirror.com/sass@1.58.3
devDependencies:
'@svgr/webpack':
specifier: ^6.5.1
version: registry.npmmirror.com/@svgr/webpack@6.5.1
'@types/lodash':
specifier: ^4.14.191
version: registry.npmmirror.com/@types/lodash@4.14.191
'@types/node':
specifier: ^20.8.5
version: registry.npmmirror.com/@types/node@20.8.5
'@types/nprogress':
specifier: ^0.2.0
version: registry.npmmirror.com/@types/nprogress@0.2.0
'@types/react':
specifier: 18.2.0
version: registry.npmmirror.com/@types/react@18.2.0
'@types/react-dom':
specifier: 18.2.0
version: registry.npmmirror.com/@types/react-dom@18.2.0
'@types/react-syntax-highlighter':
specifier: ^15.5.6
version: registry.npmmirror.com/@types/react-syntax-highlighter@15.5.6
'@types/request-ip':
specifier: ^0.0.37
version: registry.npmmirror.com/@types/request-ip@0.0.37
eslint:
specifier: 8.34.0
version: registry.npmmirror.com/eslint@8.34.0
eslint-config-next:
specifier: 13.1.6
version: registry.npmmirror.com/eslint-config-next@13.1.6(eslint@8.34.0)(typescript@4.9.5)
typescript:
specifier: 4.9.5
version: registry.npmmirror.com/typescript@4.9.5
packages: packages:
registry.npmmirror.com/@aashutoshrathi/word-wrap@1.2.6: registry.npmmirror.com/@aashutoshrathi/word-wrap@1.2.6:
...@@ -5148,6 +5087,7 @@ packages: ...@@ -5148,6 +5087,7 @@ packages:
resolution: {integrity: sha512-1cYJrqq9GezNFPsWTZpFut/d4CjpZqA0vhqDUPFWYKF1oIyBz5qnoYMzR+0C/T96t3ebLAC1SSnwrVOm5/j74A==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@types/nprogress/-/nprogress-0.2.0.tgz} resolution: {integrity: sha512-1cYJrqq9GezNFPsWTZpFut/d4CjpZqA0vhqDUPFWYKF1oIyBz5qnoYMzR+0C/T96t3ebLAC1SSnwrVOm5/j74A==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@types/nprogress/-/nprogress-0.2.0.tgz}
name: '@types/nprogress' name: '@types/nprogress'
version: 0.2.0 version: 0.2.0
dev: false
registry.npmmirror.com/@types/papaparse@5.3.7: registry.npmmirror.com/@types/papaparse@5.3.7:
resolution: {integrity: sha512-f2HKmlnPdCvS0WI33WtCs5GD7X1cxzzS/aduaxSu3I7TbhWlENjSPs6z5TaB9K0J+BH1jbmqTaM+ja5puis4wg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@types/papaparse/-/papaparse-5.3.7.tgz} resolution: {integrity: sha512-f2HKmlnPdCvS0WI33WtCs5GD7X1cxzzS/aduaxSu3I7TbhWlENjSPs6z5TaB9K0J+BH1jbmqTaM+ja5puis4wg==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@types/papaparse/-/papaparse-5.3.7.tgz}
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
{ {
"model": "gpt-3.5-turbo", "model": "gpt-3.5-turbo",
"name": "GPT35", "name": "GPT35",
"price": 0, "inputPrice": 0,
"outputPrice": 0,
"maxContext": 4000, "maxContext": 4000,
"maxResponse": 4000, "maxResponse": 4000,
"quoteMaxToken": 2000, "quoteMaxToken": 2000,
...@@ -23,7 +24,8 @@ ...@@ -23,7 +24,8 @@
"name": "GPT35-16k", "name": "GPT35-16k",
"maxContext": 16000, "maxContext": 16000,
"maxResponse": 16000, "maxResponse": 16000,
"price": 0, "inputPrice": 0,
"outputPrice": 0,
"quoteMaxToken": 8000, "quoteMaxToken": 8000,
"maxTemperature": 1.2, "maxTemperature": 1.2,
"censor": false, "censor": false,
...@@ -35,7 +37,8 @@ ...@@ -35,7 +37,8 @@
"name": "GPT4-8k", "name": "GPT4-8k",
"maxContext": 8000, "maxContext": 8000,
"maxResponse": 8000, "maxResponse": 8000,
"price": 0, "inputPrice": 0,
"outputPrice": 0,
"quoteMaxToken": 4000, "quoteMaxToken": 4000,
"maxTemperature": 1.2, "maxTemperature": 1.2,
"censor": false, "censor": false,
...@@ -47,7 +50,8 @@ ...@@ -47,7 +50,8 @@
"name": "GPT4-Vision", "name": "GPT4-Vision",
"maxContext": 128000, "maxContext": 128000,
"maxResponse": 4000, "maxResponse": 4000,
"price": 0, "inputPrice": 0,
"outputPrice": 0,
"quoteMaxToken": 100000, "quoteMaxToken": 100000,
"maxTemperature": 1.2, "maxTemperature": 1.2,
"censor": false, "censor": false,
...@@ -61,7 +65,8 @@ ...@@ -61,7 +65,8 @@
"name": "GPT35-16k", "name": "GPT35-16k",
"maxContext": 16000, "maxContext": 16000,
"maxResponse": 16000, "maxResponse": 16000,
"price": 0 "inputPrice": 0,
"outputPrice": 0
} }
], ],
"cqModels": [ "cqModels": [
...@@ -70,7 +75,8 @@ ...@@ -70,7 +75,8 @@
"name": "GPT35", "name": "GPT35",
"maxContext": 4000, "maxContext": 4000,
"maxResponse": 4000, "maxResponse": 4000,
"price": 0, "inputPrice": 0,
"outputPrice": 0,
"toolChoice": true, "toolChoice": true,
"functionPrompt": "" "functionPrompt": ""
}, },
...@@ -79,7 +85,8 @@ ...@@ -79,7 +85,8 @@
"name": "GPT4-8k", "name": "GPT4-8k",
"maxContext": 8000, "maxContext": 8000,
"maxResponse": 8000, "maxResponse": 8000,
"price": 0, "inputPrice": 0,
"outputPrice": 0,
"toolChoice": true, "toolChoice": true,
"functionPrompt": "" "functionPrompt": ""
} }
...@@ -90,7 +97,8 @@ ...@@ -90,7 +97,8 @@
"name": "GPT35-1106", "name": "GPT35-1106",
"maxContext": 16000, "maxContext": 16000,
"maxResponse": 4000, "maxResponse": 4000,
"price": 0, "inputPrice": 0,
"outputPrice": 0,
"toolChoice": true, "toolChoice": true,
"functionPrompt": "" "functionPrompt": ""
} }
...@@ -101,14 +109,16 @@ ...@@ -101,14 +109,16 @@
"name": "GPT35-1106", "name": "GPT35-1106",
"maxContext": 1600, "maxContext": 1600,
"maxResponse": 4000, "maxResponse": 4000,
"price": 0 "inputPrice": 0,
"outputPrice": 0
} }
], ],
"vectorModels": [ "vectorModels": [
{ {
"model": "text-embedding-ada-002", "model": "text-embedding-ada-002",
"name": "Embedding-2", "name": "Embedding-2",
"price": 0.2, "inputPrice": 0,
"outputPrice": 0,
"defaultToken": 700, "defaultToken": 700,
"maxToken": 3000, "maxToken": 3000,
"weight": 100 "weight": 100
...@@ -119,7 +129,8 @@ ...@@ -119,7 +129,8 @@
{ {
"model": "tts-1", "model": "tts-1",
"name": "OpenAI TTS1", "name": "OpenAI TTS1",
"price": 0, "inputPrice": 0,
"outputPrice": 0,
"voices": [ "voices": [
{ "label": "Alloy", "value": "alloy", "bufferId": "openai-Alloy" }, { "label": "Alloy", "value": "alloy", "bufferId": "openai-Alloy" },
{ "label": "Echo", "value": "echo", "bufferId": "openai-Echo" }, { "label": "Echo", "value": "echo", "bufferId": "openai-Echo" },
...@@ -133,6 +144,7 @@ ...@@ -133,6 +144,7 @@
"whisperModel": { "whisperModel": {
"model": "whisper-1", "model": "whisper-1",
"name": "Whisper1", "name": "Whisper1",
"price": 0 "inputPrice": 0,
"outputPrice": 0
} }
} }
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1690507057466"
class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2581"
xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64">
<path
d="M816 416a174.816 174.816 0 0 1-133.6-62.624l-219.616 104.672a222.944 222.944 0 0 1-1.216 174.656l173.696 89.984A179.84 179.84 0 1 1 611.2 784l-185.056-96a224 224 0 1 1 2.912-284.8l221.44-105.6A175.552 175.552 0 1 1 816 416z"
fill="#3399FF" p-id="2582"></path>
</svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1690507057466" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2581" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M816 416a174.816 174.816 0 0 1-133.6-62.624l-219.616 104.672a222.944 222.944 0 0 1-1.216 174.656l173.696 89.984A179.84 179.84 0 1 1 611.2 784l-185.056-96a224 224 0 1 1 2.912-284.8l221.44-105.6A175.552 175.552 0 1 1 816 416z" fill="#3399FF" p-id="2582"></path></svg>
\ No newline at end of file
...@@ -133,7 +133,9 @@ ...@@ -133,7 +133,9 @@
"Name is empty": "Name is empty", "Name is empty": "Name is empty",
"New Create": "Create", "New Create": "Create",
"Next Step": "Next", "Next Step": "Next",
"Not open": "Close",
"OK": "OK", "OK": "OK",
"Opened": "Opened",
"Output": "Output", "Output": "Output",
"Params": "Params", "Params": "Params",
"Password inconsistency": "Password inconsistency", "Password inconsistency": "Password inconsistency",
...@@ -244,12 +246,13 @@ ...@@ -244,12 +246,13 @@
"create app": "Create App", "create app": "Create App",
"edit": { "edit": {
"Confirm Save App Tip": "The application may be in advanced orchestration mode, and the advanced orchestration configuration will be overwritten after saving, please confirm!", "Confirm Save App Tip": "The application may be in advanced orchestration mode, and the advanced orchestration configuration will be overwritten after saving, please confirm!",
"Open cfr": "Open Cfr",
"Out Ad Edit": "You are about to exit the Advanced orchestration page, please confirm", "Out Ad Edit": "You are about to exit the Advanced orchestration page, please confirm",
"Prompt Editor": "Prompt Editor", "Prompt Editor": "Prompt Editor",
"Save and out": "Save out", "Save and out": "Save out",
"UnSave": "UnSave", "UnSave": "UnSave",
"cfr background prompt": "Question completion - Chat background description", "cfr background prompt": "Chat background description",
"cfr background tip": "Describing the scope of the current conversation makes it easier for AI to complete first or vague questions, thereby enhancing the knowledge base's ability to continue conversations. \nIf is empty, the problem completion function is not used." "cfr background tip": "Describing the scope of the current conversation makes it easier for AI to complete first or vague questions, thereby enhancing the knowledge base's ability to continue conversations.\nIf the value is empty, the problem completion function is not used for the \"first problem\".\nIf the value is none, the problem completion function is not used."
}, },
"feedback": { "feedback": {
"Custom feedback": "Custom feedback", "Custom feedback": "Custom feedback",
...@@ -637,7 +640,7 @@ ...@@ -637,7 +640,7 @@
"TFSwitch": "", "TFSwitch": "",
"TFSwitch intro": "", "TFSwitch intro": "",
"UnKnow Module": "UnKnow Module", "UnKnow Module": "UnKnow Module",
"cfr": "", "cfr": "Coreference resolution",
"cfr intro": "Refine the current issue based on history, making it more conducive to knowledge base search, while improving continuous conversation capabilities.", "cfr intro": "Refine the current issue based on history, making it more conducive to knowledge base search, while improving continuous conversation capabilities.",
"textEditor": "Text Editor", "textEditor": "Text Editor",
"textEditor intro": "Output of fixed or incoming text after edit" "textEditor intro": "Output of fixed or incoming text after edit"
......
...@@ -133,7 +133,9 @@ ...@@ -133,7 +133,9 @@
"Name is empty": "名称不能为空", "Name is empty": "名称不能为空",
"New Create": "新建", "New Create": "新建",
"Next Step": "下一步", "Next Step": "下一步",
"Not open": "未开启",
"OK": "好的", "OK": "好的",
"Opened": "已开启",
"Output": "输出", "Output": "输出",
"Params": "参数", "Params": "参数",
"Password inconsistency": "两次密码不一致", "Password inconsistency": "两次密码不一致",
...@@ -244,12 +246,13 @@ ...@@ -244,12 +246,13 @@
"create app": "创建属于你的 AI 应用", "create app": "创建属于你的 AI 应用",
"edit": { "edit": {
"Confirm Save App Tip": "该应用可能为高级编排模式,保存后将会覆盖高级编排配置,请确认!", "Confirm Save App Tip": "该应用可能为高级编排模式,保存后将会覆盖高级编排配置,请确认!",
"Open cfr": "开启自动补全",
"Out Ad Edit": "您即将退出高级编排页面,请确认", "Out Ad Edit": "您即将退出高级编排页面,请确认",
"Prompt Editor": "提示词编辑", "Prompt Editor": "提示词编辑",
"Save and out": "保存并退出", "Save and out": "保存并退出",
"UnSave": "不保存", "UnSave": "不保存",
"cfr background prompt": "问题补全 - 对话背景描述", "cfr background prompt": "对话背景描述",
"cfr background tip": "描述当前对话的范围,便于AI补全首次问题或模糊的问题,从而增强知识库连续对话的能力。\n为空时,表示不使用问题补全功能。" "cfr background tip": "描述当前对话的范围,便于AI补全首次问题或模糊的问题,从而增强知识库连续对话的能力。\n值为空时,表示【首个问题】不使用问题补全功能。\n值为 none 时,表示不使用问题补全功能。"
}, },
"feedback": { "feedback": {
"Custom feedback": "自定义反馈", "Custom feedback": "自定义反馈",
......
...@@ -4,8 +4,7 @@ import { Box, Flex, Image, Spinner, Textarea } from '@chakra-ui/react'; ...@@ -4,8 +4,7 @@ import { Box, Flex, Image, Spinner, Textarea } from '@chakra-ui/react';
import React, { useRef, useEffect, useCallback, useState } from 'react'; import React, { useRef, useEffect, useCallback, useState } from 'react';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import MyTooltip from '../MyTooltip'; import MyTooltip from '../MyTooltip';
import MyIcon from '../Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import styles from './index.module.scss';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import { useSelectFile } from '@/web/common/file/hooks/useSelectFile'; import { useSelectFile } from '@/web/common/file/hooks/useSelectFile';
import { compressImgFileAndUpload } from '@/web/common/file/controller'; import { compressImgFileAndUpload } from '@/web/common/file/controller';
...@@ -137,7 +136,7 @@ const MessageInput = ({ ...@@ -137,7 +136,7 @@ const MessageInput = ({
rawFile: file, rawFile: file,
type: FileTypeEnum.file, type: FileTypeEnum.file,
name: file.name, name: file.name,
icon: 'pdf' icon: 'file/pdf'
}); });
} }
}) })
......
...@@ -2,7 +2,7 @@ import React, { useMemo, useState } from 'react'; ...@@ -2,7 +2,7 @@ import React, { useMemo, useState } from 'react';
import { ModalBody, useTheme, ModalFooter, Button, Box, Card, Flex, Grid } from '@chakra-ui/react'; import { ModalBody, useTheme, ModalFooter, Button, Box, Card, Flex, Grid } from '@chakra-ui/react';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import Avatar from '../Avatar'; import Avatar from '../Avatar';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { DatasetTypeEnum } from '@fastgpt/global/core/dataset/constant'; import { DatasetTypeEnum } from '@fastgpt/global/core/dataset/constant';
import DatasetSelectModal, { useDatasetSelect } from '@/components/core/dataset/SelectModal'; import DatasetSelectModal, { useDatasetSelect } from '@/components/core/dataset/SelectModal';
import dynamic from 'next/dynamic'; import dynamic from 'next/dynamic';
......
...@@ -51,7 +51,7 @@ import { ...@@ -51,7 +51,7 @@ import {
} from '@/web/core/chat/api'; } from '@/web/core/chat/api';
import type { AdminMarkType } from './SelectMarkCollection'; import type { AdminMarkType } from './SelectMarkCollection';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import Avatar from '@/components/Avatar'; import Avatar from '@/components/Avatar';
import Markdown, { CodeClassName } from '@/components/Markdown'; import Markdown, { CodeClassName } from '@/components/Markdown';
import MySelect from '@/components/Select'; import MySelect from '@/components/Select';
...@@ -629,7 +629,7 @@ const ChatBox = ( ...@@ -629,7 +629,7 @@ const ChatBox = (
))} ))}
{!variableIsFinish && ( {!variableIsFinish && (
<Button <Button
leftIcon={<MyIcon name={'chatFill'} w={'16px'} />} leftIcon={<MyIcon name={'core/chat/chatFill'} w={'16px'} />}
size={'sm'} size={'sm'}
maxW={'100px'} maxW={'100px'}
onClick={handleSubmit((data) => { onClick={handleSubmit((data) => {
...@@ -1276,7 +1276,7 @@ function ChatController({ ...@@ -1276,7 +1276,7 @@ function ChatController({
<MyTooltip label={t('core.app.TTS')}> <MyTooltip label={t('core.app.TTS')}>
<MyIcon <MyIcon
{...controlIconStyle} {...controlIconStyle}
name={'voice'} name={'common/voiceLight'}
_hover={{ color: '#E74694' }} _hover={{ color: '#E74694' }}
onClick={async () => { onClick={async () => {
const response = await playAudio({ const response = await playAudio({
......
...@@ -2,7 +2,7 @@ import React, { useState, useMemo, useRef } from 'react'; ...@@ -2,7 +2,7 @@ import React, { useState, useMemo, useRef } from 'react';
import { Box, Card, Flex, useTheme, useOutsideClick, Button } from '@chakra-ui/react'; import { Box, Card, Flex, useTheme, useOutsideClick, Button } from '@chakra-ui/react';
import { addDays, format } from 'date-fns'; import { addDays, format } from 'date-fns';
import { type DateRange, DayPicker } from 'react-day-picker'; import { type DateRange, DayPicker } from 'react-day-picker';
import MyIcon from '../Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import 'react-day-picker/dist/style.css'; import 'react-day-picker/dist/style.css';
import zhCN from 'date-fns/locale/zh-CN'; import zhCN from 'date-fns/locale/zh-CN';
......
import React from 'react'; import React from 'react';
import { Flex, Box, FlexProps } from '@chakra-ui/react'; import { Flex, Box, FlexProps } from '@chakra-ui/react';
import MyIcon from '../Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
type Props = FlexProps & { type Props = FlexProps & {
......
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1683254592786" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1352" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M450.09164971 42.7357605a123.86965959 123.86965959 0 0 1 123.76374272 0L889.06369251 222.84722403a123.92261859 123.92261859 0 0 1 62.06722618 107.2407279v360.38180181c0 44.22025102-23.6194395 85.05116445-61.9613093 107.13480989l-0.10591688 0.10591687-315.20830008 180.11146353a123.86965959 123.86965959 0 0 1-123.76374272 0L134.93630749 797.7104805a123.92261859 123.92261859 0 0 1-62.06722618-107.24072676V330.08795193c0-44.22025102 23.67239737-85.05116445 61.9613093-107.13481102l0.10591688-0.10591688z m462.16781482 223.59029646a33.78744889 33.78744889 0 0 0-46.17971029-12.28634453l-353.81496263 204.57823687L158.44982898 254.09267029a33.78744889 33.78744889 0 0 0-33.89336463 58.46605597l353.6031289 204.47232v430.02207687c0 18.00585102 15.14609778 32.62236445 33.84040675 32.62236444a33.20490667 33.20490667 0 0 0 33.73449102-32.62236444V517.29583787l354.18567111-204.79006948a33.78744889 33.78744889 0 0 0 14.66947129-41.20162304z" p-id="1353"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1689598169213" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3429" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M254.80971969 32C131.70542094 32 32 131.82654219 32 254.83663531c0 123.11775656 99.81308438 222.83214938 222.80971969 222.83214938h222.92186906V254.83663531C477.72710281 131.71439281 377.91401844 32 254.80971969 32z m514.38056062 0c-122.99214938 0-222.92186906 99.82654219-222.92186906 222.83663531v222.83214938h222.92186906C892.18691562 477.66878469 992 377.95887875 992 254.83663531 992 131.71439281 892.18691562 32 769.19028031 32zM32 769.16336469C32 892.28560719 131.81308438 992 254.80971969 992c123.10429875 0 222.80971969-99.71439281 222.80971968-222.83663531v-222.83214938H254.80971969C131.81308438 546.33121531 32 646.04112125 32 769.16336469z m737.07813094-222.83214938h-222.91738313v222.83214938c0 123.12224344 99.81308438 222.83663531 222.91738313 222.83663531 123.10878469 0 222.80971969-99.82654219 222.80971968-222.83663531 0.11214937-123.11775656-99.700935-222.83214938-222.80971968-222.83214938z" p-id="3430"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1691412437336"
class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2312"
xmlns:xlink="http://www.w3.org/1999/xlink">
<path
d="M512 14.8973037a497.1026963 497.1026963 0 1 0 497.1026963 497.1026963A497.1026963 497.1026963 0 0 0 512 14.8973037z m165.70089876 581.8863224l-207.12612345 124.27567408L346.29910124 796.45320912V255.16360691l125.38034629 75.39390894 207.12612347 124.27567407 118.47614261 70.97521873z"
p-id="2313"></path>
</svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1694331723034"
class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5978"
xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64">
<path
d="M512 70.283C267.486 70.283 69.268 268.046 69.268 512S267.486 953.717 512 953.717 954.732 755.954 954.732 512 756.514 70.283 512 70.283m223.045 488.321H558.603v176.442c0 25.738-20.866 46.604-46.604 46.604s-46.604-20.866-46.604-46.604V558.604H288.953c-25.738 0-46.604-20.866-46.604-46.604s20.866-46.604 46.604-46.604h176.442V288.954c0-25.738 20.866-46.604 46.604-46.604s46.604 20.866 46.604 46.604v176.442h176.442c25.738 0 46.604 20.866 46.604 46.604s-20.866 46.604-46.604 46.604z"
p-id="5979"></path>
</svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1689598155704" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3279" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M770.011 483.622h-228.59v-215.25c0-57.579 23.778-111.675 66.912-152.327C651.296 75.432 708.593 53.04 769.711 53.04c60.988 0 118.329 22.392 161.463 63.045C974.265 156.738 998 210.834 998 268.372c0 57.618-23.735 111.714-66.826 152.286-43.091 40.613-100.303 62.964-161.163 62.964z m-164.21-215.25v154.513h164.167c43.735 0 84.766-16.034 115.626-45.147l0.043-0.04c30.945-29.114 47.984-67.944 47.984-109.326 0-41.342-17.04-80.132-48.027-109.326-61.89-58.429-170.09-58.388-231.68-0.04C622.84 188.24 605.8 227.03 605.8 268.371z m163.91 270.925c60.86 0 118.157 22.351 161.377 62.923C974.265 642.954 998 697.05 998 754.628c0 57.66-23.777 111.755-66.869 152.327C888.04 947.608 830.7 970 769.711 970c-61.118 0-118.415-22.432-161.507-63.166-43.048-40.531-66.783-94.627-66.783-152.206v-215.33h228.29z m115.883 324.698c30.988-29.114 48.027-67.944 48.027-109.367 0-41.341-17.04-80.212-48.027-109.406-30.988-29.154-72.191-45.188-115.883-45.188H605.8v154.594c0 41.342 17.039 80.132 47.984 109.286 61.847 58.469 169.919 58.469 231.809 0.08zM254.289 53c60.903 0 118.244 22.392 161.42 63.045 43.135 40.774 66.87 94.87 66.87 152.327v215.33h-228.29c-60.988 0-118.329-22.39-161.42-63.044C49.777 379.965 26 325.91 26 268.372c0-57.579 23.777-111.634 66.869-152.287C135.96 75.432 193.258 53 254.289 53zM418.2 422.966V268.372c0-41.22-17.039-80.092-47.984-109.367-30.988-29.153-72.19-45.268-115.926-45.268-43.82 0-84.98 16.074-115.926 45.268C107.418 188.2 90.38 227.03 90.38 268.372c0 41.3 17.04 80.131 47.984 109.325 30.946 29.194 72.148 45.27 115.926 45.27H418.2zM92.912 602.18c43.22-40.572 100.56-62.883 161.377-62.883h228.204v215.331c0 57.457-23.735 111.513-66.826 152.287-43.005 40.653-100.346 63.045-161.378 63.045-60.988 0-118.329-22.392-161.42-63.045C49.735 866.262 26 812.166 26 754.628c0-57.578 23.735-111.674 66.869-152.327l0.043-0.121z m325.201 152.448V600.034H254.29c-43.692 0-84.852 16.034-115.968 45.188-30.903 29.234-47.942 68.065-47.942 109.406 0 41.342 17.04 80.132 47.984 109.407 61.89 58.348 170.048 58.267 231.723 0 30.988-29.315 48.027-68.146 48.027-109.407z" p-id="3280"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1683450443331" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1727" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M58.15222827 227.09272427L492.1075808-23.4520384a39.00952427 39.00952427 0 0 1 39.00952427 0l433.95657066 250.54476267a39.00952427 39.00952427 0 0 1 19.50476267 33.78346666v501.0895232a39.00952427 39.00952427 0 0 1-19.50476267 33.78224747l-433.95657066 250.54476267a39.00952427 39.00952427 0 0 1-39.00952427 0L58.15100907 795.7479616a39.00952427 39.00952427 0 0 1-19.5047616-33.78224747V260.87619093a39.00952427 39.00952427 0 0 1 19.5047616-33.78346666z m63.494096 53.5503232a9.7523808 9.7523808 0 0 0-4.87619094 8.4467808v444.66224746a9.7523808 9.7523808 0 0 0 4.87619094 8.44556267l385.08982826 222.3311232a9.7523808 9.7523808 0 0 0 9.7523808 0l385.08860907-222.329904a9.7523808 9.7523808 0 0 0 4.87619093-8.44678187V289.08982827a9.7523808 9.7523808 0 0 0-4.87619093-8.4467808L516.48853333 58.3131424a9.7523808 9.7523808 0 0 0-9.7523808 0l-385.08982826 222.32990507z m389.56129493 190.72l300.3611424-173.4131808c18.65752427-10.77150507 42.51550507-4.3788192 53.28822933 14.27870506 10.77150507 18.65752427 4.3788192 42.51550507-14.27870506 53.28822827L551.00952427 538.4728384V881.37142827c0 21.54422827-17.46529493 39.00952427-39.00952427 39.00952426-21.54422827 0-39.00952427-17.46529493-39.00952427-39.00952426V539.38712427L172.89386667 366.12632427c-18.65752427-10.77272427-25.05142827-34.63070507-14.27870507-53.28822934 10.77272427-18.65752427 34.63070507-25.05142827 53.28822933-14.278704L511.2076192 471.36304747z" p-id="1728"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1683450440385" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1585" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M469.21500445 150.07971555h87.84554666V84.19555555h-87.84554666v65.88416zM106.84416 732.06897778v-219.61614223H40.96v219.61614223h65.88416z m450.21866667 142.75242667H249.59431111v65.88416h307.46396444v-65.88416zM40.96 732.06670222c0 115.21137778 93.42520889 208.63658667 208.63658667 208.63658667v-65.88416c-78.84344889 0-142.75242667-63.90897778-142.75242667-142.75242667H40.96z m878.47139555-219.61614222c0 200.11463111-162.25393778 362.36856889-362.37084444 362.36856889v65.88416C793.58862222 940.70328889 985.31555555 748.97863111 985.31555555 512.45056h-65.88416zM557.06055111 150.07971555c200.11690667 0 362.37084445 162.25393778 362.37084444 362.37084445H985.31555555C985.31555555 275.92248889 793.58862222 84.19555555 557.06055111 84.19555555v65.88416zM469.21500445 84.19555555C232.68693333 84.19555555 40.96 275.92248889 40.96 512.45056h65.88416c0-200.11690667 162.25393778-362.37084445 362.37084445-362.37084445V84.19555555z" p-id="1586"></path><path d="M513.13777778 512.45056m-43.92277333 0a43.92277333 43.92277333 0 1 0 87.84554666 0 43.92277333 43.92277333 0 1 0-87.84554666 0Z" p-id="1587"></path><path d="M688.83114667 512.45056m-43.92277334 0a43.92277333 43.92277333 0 1 0 87.84554667 0 43.92277333 43.92277333 0 1 0-87.84554667 0Z" p-id="1588"></path><path d="M337.44440889 512.45056m-43.92277334 0a43.92277333 43.92277333 0 1 0 87.84554667 0 43.92277333 43.92277333 0 1 0-87.84554667 0Z" p-id="1589"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1690507057466" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2581" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M816 416a174.816 174.816 0 0 1-133.6-62.624l-219.616 104.672a222.944 222.944 0 0 1-1.216 174.656l173.696 89.984A179.84 179.84 0 1 1 611.2 784l-185.056-96a224 224 0 1 1 2.912-284.8l221.44-105.6A175.552 175.552 0 1 1 816 416z" fill="#3399FF" p-id="2582"></path></svg>
\ No newline at end of file
...@@ -8,7 +8,7 @@ import { feConfigs } from '@/web/common/system/staticData'; ...@@ -8,7 +8,7 @@ import { feConfigs } from '@/web/common/system/staticData';
import NextLink from 'next/link'; import NextLink from 'next/link';
import Badge from '../Badge'; import Badge from '../Badge';
import Avatar from '../Avatar'; import Avatar from '../Avatar';
import MyIcon from '../Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { useSystemStore } from '@/web/common/system/useSystemStore'; import { useSystemStore } from '@/web/common/system/useSystemStore';
import MyTooltip from '../MyTooltip'; import MyTooltip from '../MyTooltip';
...@@ -29,8 +29,8 @@ const Navbar = ({ unread }: { unread: number }) => { ...@@ -29,8 +29,8 @@ const Navbar = ({ unread }: { unread: number }) => {
() => [ () => [
{ {
label: t('navbar.Chat'), label: t('navbar.Chat'),
icon: 'chat', icon: 'core/chat/chatLight',
activeIcon: 'chatFill', activeIcon: 'chatcore/dataset/chatFillFill',
link: `/chat?appId=${lastChatAppId}&chatId=${lastChatId}`, link: `/chat?appId=${lastChatAppId}&chatId=${lastChatId}`,
activeLink: ['/chat'] activeLink: ['/chat']
}, },
...@@ -50,26 +50,15 @@ const Navbar = ({ unread }: { unread: number }) => { ...@@ -50,26 +50,15 @@ const Navbar = ({ unread }: { unread: number }) => {
}, },
{ {
label: t('navbar.Datasets'), label: t('navbar.Datasets'),
icon: 'dbLight', icon: 'core/dataset/datasetLight',
activeIcon: 'dbFill', activeIcon: 'core/dataset/datasetFill',
link: `/dataset/list`, link: `/dataset/list`,
activeLink: ['/dataset/list', '/dataset/detail'] activeLink: ['/dataset/list', '/dataset/detail']
}, },
...(feConfigs?.show_appStore
? [
{
label: t('navbar.Store'),
icon: 'appStoreLight',
activeIcon: 'appStoreFill',
link: '/appStore',
activeLink: ['/appStore']
}
]
: []),
{ {
label: t('navbar.Account'), label: t('navbar.Account'),
icon: 'meLight', icon: 'support/user/userLight',
activeIcon: 'meFill', activeIcon: 'support/user/userFill',
link: '/account', link: '/account',
activeLink: ['/account'] activeLink: ['/account']
} }
...@@ -191,7 +180,7 @@ const Navbar = ({ unread }: { unread: number }) => { ...@@ -191,7 +180,7 @@ const Navbar = ({ unread }: { unread: number }) => {
mt={0} mt={0}
color={'#9096a5'} color={'#9096a5'}
> >
<MyIcon name={'git'} width={'22px'} height={'22px'} /> <MyIcon name={'common/gitLight'} width={'22px'} height={'22px'} />
</Link> </Link>
</MyTooltip> </MyTooltip>
)} )}
......
...@@ -4,7 +4,7 @@ import { Flex, Box } from '@chakra-ui/react'; ...@@ -4,7 +4,7 @@ import { Flex, Box } from '@chakra-ui/react';
import { useChatStore } from '@/web/core/chat/storeChat'; import { useChatStore } from '@/web/core/chat/storeChat';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import Badge from '../Badge'; import Badge from '../Badge';
import MyIcon from '../Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
const NavbarPhone = ({ unread }: { unread: number }) => { const NavbarPhone = ({ unread }: { unread: number }) => {
const router = useRouter(); const router = useRouter();
...@@ -14,7 +14,7 @@ const NavbarPhone = ({ unread }: { unread: number }) => { ...@@ -14,7 +14,7 @@ const NavbarPhone = ({ unread }: { unread: number }) => {
() => [ () => [
{ {
label: t('navbar.Chat'), label: t('navbar.Chat'),
icon: 'chat', icon: 'core/chat/chatLight',
link: `/chat?appId=${lastChatAppId}&chatId=${lastChatId}`, link: `/chat?appId=${lastChatAppId}&chatId=${lastChatId}`,
activeLink: ['/chat'], activeLink: ['/chat'],
unread: 0 unread: 0
...@@ -28,14 +28,14 @@ const NavbarPhone = ({ unread }: { unread: number }) => { ...@@ -28,14 +28,14 @@ const NavbarPhone = ({ unread }: { unread: number }) => {
}, },
{ {
label: t('navbar.Tools'), label: t('navbar.Tools'),
icon: 'tabbarMore', icon: 'phoneTabbar/tabbarMore',
link: '/tools', link: '/tools',
activeLink: ['/tools'], activeLink: ['/tools'],
unread: 0 unread: 0
}, },
{ {
label: t('navbar.Account'), label: t('navbar.Account'),
icon: 'tabbarMe', icon: 'phoneTabbar/tabbarMe',
link: '/account', link: '/account',
activeLink: ['/account'], activeLink: ['/account'],
unread unread
......
import React from 'react'; import React from 'react';
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import { Box, Flex, useColorModeValue } from '@chakra-ui/react'; import { Box, Flex, useColorModeValue } from '@chakra-ui/react';
import Icon from '@/components/Icon'; import Icon from '@fastgpt/web/components/common/Icon';
import { useCopyData } from '@/web/common/hooks/useCopyData'; import { useCopyData } from '@/web/common/hooks/useCopyData';
const codeLight: { [key: string]: React.CSSProperties } = { const codeLight: { [key: string]: React.CSSProperties } = {
......
...@@ -5,7 +5,7 @@ import ChatBoxDivider from '@/components/core/chat/Divider'; ...@@ -5,7 +5,7 @@ import ChatBoxDivider from '@/components/core/chat/Divider';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { EventNameEnum, eventBus } from '@/web/common/utils/eventbus'; import { EventNameEnum, eventBus } from '@/web/common/utils/eventbus';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
const QuestionGuide = ({ text }: { text: string }) => { const QuestionGuide = ({ text }: { text: string }) => {
const theme = useTheme(); const theme = useTheme();
......
...@@ -2,7 +2,7 @@ import React, { useEffect, useRef, memo, useCallback, useState, useMemo } from ' ...@@ -2,7 +2,7 @@ import React, { useEffect, useRef, memo, useCallback, useState, useMemo } from '
import { Box } from '@chakra-ui/react'; import { Box } from '@chakra-ui/react';
// @ts-ignore // @ts-ignore
import mermaid from 'mermaid'; import mermaid from 'mermaid';
import MyIcon from '../../Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
const mermaidAPI = mermaid.mermaidAPI; const mermaidAPI = mermaid.mermaidAPI;
mermaidAPI.initialize({ mermaidAPI.initialize({
......
...@@ -13,7 +13,7 @@ import { Link, Button } from '@chakra-ui/react'; ...@@ -13,7 +13,7 @@ import { Link, Button } from '@chakra-ui/react';
import MyTooltip from '../MyTooltip'; import MyTooltip from '../MyTooltip';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { EventNameEnum, eventBus } from '@/web/common/utils/eventbus'; import { EventNameEnum, eventBus } from '@/web/common/utils/eventbus';
import MyIcon from '../Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { getFileAndOpen } from '@/web/core/dataset/utils'; import { getFileAndOpen } from '@/web/core/dataset/utils';
import { MARKDOWN_QUOTE_SIGN } from '@fastgpt/global/core/chat/constants'; import { MARKDOWN_QUOTE_SIGN } from '@fastgpt/global/core/chat/constants';
......
...@@ -9,7 +9,7 @@ import { ...@@ -9,7 +9,7 @@ import {
Box, Box,
Image Image
} from '@chakra-ui/react'; } from '@chakra-ui/react';
import MyIcon from '../Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { useSystemStore } from '@/web/common/system/useSystemStore'; import { useSystemStore } from '@/web/common/system/useSystemStore';
export interface MyModalProps extends ModalContentProps { export interface MyModalProps extends ModalContentProps {
......
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Box, Flex } from '@chakra-ui/react'; import { Box, Flex } from '@chakra-ui/react';
import type { BoxProps } from '@chakra-ui/react'; import type { BoxProps } from '@chakra-ui/react';
import MyIcon from '../Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
interface Props extends BoxProps {} interface Props extends BoxProps {}
...@@ -51,7 +51,7 @@ const SideBar = (e?: Props) => { ...@@ -51,7 +51,7 @@ const SideBar = (e?: Props) => {
onClick={() => setFoldSideBar(!foldSideBar)} onClick={() => setFoldSideBar(!foldSideBar)}
> >
<MyIcon <MyIcon
name={'back'} name={'common/backLight'}
transform={foldSideBar ? 'rotate(180deg)' : ''} transform={foldSideBar ? 'rotate(180deg)' : ''}
w={'14px'} w={'14px'}
color={'white'} color={'white'}
......
import React, { useMemo } from 'react'; import React, { useMemo } from 'react';
import { Box, Flex } from '@chakra-ui/react'; import { Box, Flex } from '@chakra-ui/react';
import type { GridProps } from '@chakra-ui/react'; import type { GridProps } from '@chakra-ui/react';
import MyIcon, { type IconName } from '../Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import type { IconNameType } from '@fastgpt/web/components/common/Icon/type.d';
// @ts-ignore // @ts-ignore
export interface Props extends GridProps { export interface Props extends GridProps {
...@@ -60,7 +61,7 @@ const SideTabs = ({ list, size = 'md', activeId, onChange, ...props }: Props) => ...@@ -60,7 +61,7 @@ const SideTabs = ({ list, size = 'md', activeId, onChange, ...props }: Props) =>
onChange(item.id); onChange(item.id);
}} }}
> >
<MyIcon mr={2} name={item.icon as IconName} w={'16px'} /> <MyIcon mr={2} name={item.icon as IconNameType} w={'16px'} />
{item.label} {item.label}
</Flex> </Flex>
))} ))}
......
import React from 'react'; import React from 'react';
import { Box, Flex, useTheme, Grid, type GridProps, theme, Image } from '@chakra-ui/react'; import { Box, Flex, useTheme, Grid, type GridProps, theme, Image } from '@chakra-ui/react';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
// @ts-ignore // @ts-ignore
......
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { Box, Flex } from '@chakra-ui/react'; import { Box, Flex } from '@chakra-ui/react';
import { ParentTreePathItemType } from '@fastgpt/global/common/parentFolder/type'; import { ParentTreePathItemType } from '@fastgpt/global/common/parentFolder/type';
import React, { useMemo } from 'react'; import React, { useMemo } from 'react';
......
...@@ -11,7 +11,7 @@ import { ...@@ -11,7 +11,7 @@ import {
} from '@chakra-ui/react'; } from '@chakra-ui/react';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import MyModal from '@/components/MyModal'; import MyModal from '@/components/MyModal';
type Props = TextareaProps & { type Props = TextareaProps & {
...@@ -88,7 +88,7 @@ const Editor = React.memo(function Editor({ ...@@ -88,7 +88,7 @@ const Editor = React.memo(function Editor({
onClick={onOpenModal} onClick={onOpenModal}
> >
<MyTooltip label={t('common.ui.textarea.Magnifying')}> <MyTooltip label={t('common.ui.textarea.Magnifying')}>
<MyIcon name={'fullScreenLight'} w={'14px'} color={'myGray.600'} /> <MyIcon name={'common/fullScreenLight'} w={'14px'} color={'myGray.600'} />
</MyTooltip> </MyTooltip>
</Box> </Box>
)} )}
......
import { Box, Flex } from '@chakra-ui/react'; import { Box, Flex } from '@chakra-ui/react';
import React from 'react'; import React from 'react';
import MyIcon, { type IconName } from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import type { IconNameType } from '@fastgpt/web/components/common/Icon/type.d';
const ChatBoxDivider = ({ icon, text }: { icon: IconName; text: string }) => { const ChatBoxDivider = ({ icon, text }: { icon: IconNameType; text: string }) => {
return ( return (
<Box> <Box>
<Flex alignItems={'center'} py={2} gap={2}> <Flex alignItems={'center'} py={2} gap={2}>
......
...@@ -6,7 +6,7 @@ import { ...@@ -6,7 +6,7 @@ import {
} from '@/pages/dataset/detail/components/InputDataModal'; } from '@/pages/dataset/detail/components/InputDataModal';
import type { SearchDataResponseItemType } from '@fastgpt/global/core/dataset/type.d'; import type { SearchDataResponseItemType } from '@fastgpt/global/core/dataset/type.d';
import NextLink from 'next/link'; import NextLink from 'next/link';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
import { useSystemStore } from '@/web/common/system/useSystemStore'; import { useSystemStore } from '@/web/common/system/useSystemStore';
......
...@@ -22,7 +22,7 @@ import { reRankModelList } from '@/web/common/system/staticData'; ...@@ -22,7 +22,7 @@ import { reRankModelList } from '@/web/common/system/staticData';
import { ModuleInputKeyEnum } from '@fastgpt/global/core/module/constants'; import { ModuleInputKeyEnum } from '@fastgpt/global/core/module/constants';
import { DatasetSearchModeMap } from '@fastgpt/global/core/dataset/constant'; import { DatasetSearchModeMap } from '@fastgpt/global/core/dataset/constant';
import MyRadio from '@/components/common/MyRadio'; import MyRadio from '@/components/common/MyRadio';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
type DatasetParamsProps = { type DatasetParamsProps = {
searchMode: `${DatasetSearchModeEnum}`; searchMode: `${DatasetSearchModeEnum}`;
......
...@@ -14,7 +14,7 @@ import Avatar from '@/components/Avatar'; ...@@ -14,7 +14,7 @@ import Avatar from '@/components/Avatar';
import type { SelectedDatasetType } from '@fastgpt/global/core/module/api.d'; import type { SelectedDatasetType } from '@fastgpt/global/core/module/api.d';
import { useToast } from '@/web/common/hooks/useToast'; import { useToast } from '@/web/common/hooks/useToast';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { DatasetTypeEnum } from '@fastgpt/global/core/dataset/constant'; import { DatasetTypeEnum } from '@fastgpt/global/core/dataset/constant';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { useDatasetStore } from '@/web/core/dataset/store/dataset'; import { useDatasetStore } from '@/web/core/dataset/store/dataset';
......
...@@ -9,7 +9,7 @@ import React, { ...@@ -9,7 +9,7 @@ import React, {
ForwardedRef ForwardedRef
} from 'react'; } from 'react';
import { Box, Flex, IconButton } from '@chakra-ui/react'; import { Box, Flex, IconButton } from '@chakra-ui/react';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { streamFetch } from '@/web/common/api/fetch'; import { streamFetch } from '@/web/common/api/fetch';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
import { useUserStore } from '@/web/support/user/useUserStore'; import { useUserStore } from '@/web/support/user/useUserStore';
...@@ -105,7 +105,7 @@ const ChatTest = ( ...@@ -105,7 +105,7 @@ const ChatTest = (
<IconButton <IconButton
className="chat" className="chat"
size={'smSquare'} size={'smSquare'}
icon={<MyIcon name={'clear'} w={'14px'} />} icon={<MyIcon name={'common/clearLight'} w={'14px'} />}
variant={'whiteDanger'} variant={'whiteDanger'}
borderRadius={'md'} borderRadius={'md'}
aria-label={'delete'} aria-label={'delete'}
......
...@@ -2,7 +2,7 @@ import React from 'react'; ...@@ -2,7 +2,7 @@ import React from 'react';
import { BezierEdge, getBezierPath, EdgeLabelRenderer, EdgeProps } from 'reactflow'; import { BezierEdge, getBezierPath, EdgeLabelRenderer, EdgeProps } from 'reactflow';
import { onDelConnect } from '../../FlowProvider'; import { onDelConnect } from '../../FlowProvider';
import { Flex } from '@chakra-ui/react'; import { Flex } from '@chakra-ui/react';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
const ButtonEdge = (props: EdgeProps) => { const ButtonEdge = (props: EdgeProps) => {
const { const {
......
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
import { QuestionOutlineIcon } from '@chakra-ui/icons'; import { QuestionOutlineIcon } from '@chakra-ui/icons';
import { Box, Flex, Switch, type SwitchProps } from '@chakra-ui/react'; import { Box, Flex, Switch, type SwitchProps } from '@chakra-ui/react';
......
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
import { QuestionOutlineIcon } from '@chakra-ui/icons'; import { QuestionOutlineIcon } from '@chakra-ui/icons';
import { Box, Button, Flex, ModalBody, useDisclosure, Image } from '@chakra-ui/react'; import { Box, Button, Flex, ModalBody, useDisclosure, Image } from '@chakra-ui/react';
......
...@@ -27,7 +27,7 @@ import { ...@@ -27,7 +27,7 @@ import {
import { QuestionOutlineIcon, SmallAddIcon } from '@chakra-ui/icons'; import { QuestionOutlineIcon, SmallAddIcon } from '@chakra-ui/icons';
import { VariableInputEnum } from '@fastgpt/global/core/module/constants'; import { VariableInputEnum } from '@fastgpt/global/core/module/constants';
import type { VariableItemType } from '@fastgpt/global/core/module/type.d'; import type { VariableItemType } from '@fastgpt/global/core/module/type.d';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { useForm } from 'react-hook-form'; import { useForm } from 'react-hook-form';
import { useFieldArray } from 'react-hook-form'; import { useFieldArray } from 'react-hook-form';
import { customAlphabet } from 'nanoid'; import { customAlphabet } from 'nanoid';
...@@ -93,10 +93,10 @@ const VariableEdit = ({ ...@@ -93,10 +93,10 @@ const VariableEdit = ({
const BoxBtnStyles: BoxProps = { const BoxBtnStyles: BoxProps = {
cursor: 'pointer', cursor: 'pointer',
px: 3, px: 3,
py: '2px', py: 1,
borderRadius: 'md', borderRadius: 'md',
_hover: { _hover: {
bg: 'myGray.200' bg: 'myGray.150'
} }
}; };
...@@ -119,12 +119,14 @@ const VariableEdit = ({ ...@@ -119,12 +119,14 @@ const VariableEdit = ({
</Box> </Box>
<Flex <Flex
{...BoxBtnStyles} {...BoxBtnStyles}
alignItems={'center'}
onClick={() => { onClick={() => {
resetEdit({ variable: addVariable() }); resetEdit({ variable: addVariable() });
onOpenEdit(); onOpenEdit();
}} }}
> >
+&ensp;{t('common.Add New')} <SmallAddIcon />
{t('common.Add New')}
</Flex> </Flex>
</Flex> </Flex>
{formatVariables.length > 0 && ( {formatVariables.length > 0 && (
...@@ -152,7 +154,7 @@ const VariableEdit = ({ ...@@ -152,7 +154,7 @@ const VariableEdit = ({
<Td> <Td>
<MyIcon <MyIcon
mr={3} mr={3}
name={'settingLight'} name={'common/settingLight'}
w={'16px'} w={'16px'}
cursor={'pointer'} cursor={'pointer'}
onClick={() => { onClick={() => {
......
...@@ -9,7 +9,7 @@ import RenderInput from '../render/RenderInput'; ...@@ -9,7 +9,7 @@ import RenderInput from '../render/RenderInput';
import type { ClassifyQuestionAgentItemType } from '@fastgpt/global/core/module/type.d'; import type { ClassifyQuestionAgentItemType } from '@fastgpt/global/core/module/type.d';
import { customAlphabet } from 'nanoid'; import { customAlphabet } from 'nanoid';
const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz1234567890', 4); const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz1234567890', 4);
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { FlowNodeOutputTypeEnum } from '@fastgpt/global/core/module/node/constant'; import { FlowNodeOutputTypeEnum } from '@fastgpt/global/core/module/node/constant';
import { ModuleIOValueTypeEnum, ModuleInputKeyEnum } from '@fastgpt/global/core/module/constants'; import { ModuleIOValueTypeEnum, ModuleInputKeyEnum } from '@fastgpt/global/core/module/constants';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
......
...@@ -10,7 +10,7 @@ import RenderInput from '../../render/RenderInput'; ...@@ -10,7 +10,7 @@ import RenderInput from '../../render/RenderInput';
import Divider from '../../modules/Divider'; import Divider from '../../modules/Divider';
import type { ContextExtractAgentItemType } from '@fastgpt/global/core/module/type'; import type { ContextExtractAgentItemType } from '@fastgpt/global/core/module/type';
import RenderOutput from '../../render/RenderOutput'; import RenderOutput from '../../render/RenderOutput';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import ExtractFieldModal, { defaultField } from './ExtractFieldModal'; import ExtractFieldModal, { defaultField } from './ExtractFieldModal';
import { ModuleInputKeyEnum } from '@fastgpt/global/core/module/constants'; import { ModuleInputKeyEnum } from '@fastgpt/global/core/module/constants';
import { FlowNodeOutputTypeEnum } from '@fastgpt/global/core/module/node/constant'; import { FlowNodeOutputTypeEnum } from '@fastgpt/global/core/module/node/constant';
...@@ -70,7 +70,7 @@ const NodeExtract = React.memo(function NodeExtract({ data }: { data: FlowModule ...@@ -70,7 +70,7 @@ const NodeExtract = React.memo(function NodeExtract({ data }: { data: FlowModule
<Td whiteSpace={'nowrap'}> <Td whiteSpace={'nowrap'}>
<MyIcon <MyIcon
mr={3} mr={3}
name={'settingLight'} name={'common/settingLight'}
w={'16px'} w={'16px'}
cursor={'pointer'} cursor={'pointer'}
onClick={() => { onClick={() => {
......
...@@ -11,7 +11,7 @@ import { ...@@ -11,7 +11,7 @@ import {
FlowNodeOutputTypeEnum FlowNodeOutputTypeEnum
} from '@fastgpt/global/core/module/node/constant'; } from '@fastgpt/global/core/module/node/constant';
import Container from '../modules/Container'; import Container from '../modules/Container';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
import SourceHandle from '../render/SourceHandle'; import SourceHandle from '../render/SourceHandle';
import type { import type {
...@@ -65,7 +65,7 @@ const NodePluginInput = React.memo(function NodePluginInput({ ...@@ -65,7 +65,7 @@ const NodePluginInput = React.memo(function NodePluginInput({
mb={7} mb={7}
> >
<MyIcon <MyIcon
name={'settingLight'} name={'common/settingLight'}
w={'14px'} w={'14px'}
cursor={'pointer'} cursor={'pointer'}
mr={3} mr={3}
......
...@@ -11,7 +11,7 @@ import { ...@@ -11,7 +11,7 @@ import {
FlowNodeOutputTypeEnum FlowNodeOutputTypeEnum
} from '@fastgpt/global/core/module/node/constant'; } from '@fastgpt/global/core/module/node/constant';
import Container from '../modules/Container'; import Container from '../modules/Container';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
import TargetHandle from '../render/TargetHandle'; import TargetHandle from '../render/TargetHandle';
import { useToast } from '@/web/common/hooks/useToast'; import { useToast } from '@/web/common/hooks/useToast';
...@@ -84,7 +84,7 @@ const NodePluginOutput = React.memo(function NodePluginOutput({ ...@@ -84,7 +84,7 @@ const NodePluginOutput = React.memo(function NodePluginOutput({
</MyTooltip> </MyTooltip>
)} )}
<MyIcon <MyIcon
name={'settingLight'} name={'common/settingLight'}
w={'14px'} w={'14px'}
cursor={'pointer'} cursor={'pointer'}
ml={3} ml={3}
......
...@@ -21,7 +21,7 @@ import { welcomeTextTip, variableTip } from '@fastgpt/global/core/module/templat ...@@ -21,7 +21,7 @@ import { welcomeTextTip, variableTip } from '@fastgpt/global/core/module/templat
import { onChangeNode } from '../../FlowProvider'; import { onChangeNode } from '../../FlowProvider';
import VariableEdit from '../modules/VariableEdit'; import VariableEdit from '../modules/VariableEdit';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
import Container from '../modules/Container'; import Container from '../modules/Container';
import NodeCard from '../render/NodeCard'; import NodeCard from '../render/NodeCard';
...@@ -66,7 +66,7 @@ export function WelcomeText({ data }: { data: FlowModuleItemType }) { ...@@ -66,7 +66,7 @@ export function WelcomeText({ data }: { data: FlowModuleItemType }) {
return ( return (
<> <>
<Flex mb={1} alignItems={'center'}> <Flex mb={1} alignItems={'center'}>
<MyIcon name={'welcomeText'} mr={2} w={'16px'} color={'#E74694'} /> <MyIcon name={'core/modules/welcomeText'} mr={2} w={'16px'} color={'#E74694'} />
<Box>开场白</Box> <Box>开场白</Box>
<MyTooltip label={welcomeTextTip} forceShow> <MyTooltip label={welcomeTextTip} forceShow>
<QuestionOutlineIcon display={['none', 'inline']} ml={1} /> <QuestionOutlineIcon display={['none', 'inline']} ml={1} />
......
...@@ -8,7 +8,7 @@ import { FlowModuleItemType } from '@fastgpt/global/core/module/type.d'; ...@@ -8,7 +8,7 @@ import { FlowModuleItemType } from '@fastgpt/global/core/module/type.d';
import Container from '../../modules/Container'; import Container from '../../modules/Container';
import { VariableInputEnum, ModuleInputKeyEnum } from '@fastgpt/global/core/module/constants'; import { VariableInputEnum, ModuleInputKeyEnum } from '@fastgpt/global/core/module/constants';
import type { VariableItemType } from '@fastgpt/global/core/module/type.d'; import type { VariableItemType } from '@fastgpt/global/core/module/type.d';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { customAlphabet } from 'nanoid'; import { customAlphabet } from 'nanoid';
const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz1234567890', 6); const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz1234567890', 6);
import VariableEditModal, { addVariable } from '../../modules/VariableEdit'; import VariableEditModal, { addVariable } from '../../modules/VariableEdit';
......
import React, { useMemo } from 'react'; import React, { useMemo } from 'react';
import { Box, Flex, useTheme, Menu, MenuButton, MenuList, MenuItem } from '@chakra-ui/react'; import { Box, Flex, useTheme, Menu, MenuButton, MenuList, MenuItem } from '@chakra-ui/react';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import Avatar from '@/components/Avatar'; import Avatar from '@/components/Avatar';
import type { FlowModuleItemType } from '@fastgpt/global/core/module/type.d'; import type { FlowModuleItemType } from '@fastgpt/global/core/module/type.d';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
...@@ -116,7 +116,7 @@ const NodeCard = (props: Props) => { ...@@ -116,7 +116,7 @@ const NodeCard = (props: Props) => {
}, },
{ {
icon: 'back', icon: 'common/backLight',
label: t('common.Back'), label: t('common.Back'),
onClick: () => {} onClick: () => {}
} }
......
...@@ -7,7 +7,7 @@ import { Box, Flex } from '@chakra-ui/react'; ...@@ -7,7 +7,7 @@ import { Box, Flex } from '@chakra-ui/react';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
import { QuestionOutlineIcon } from '@chakra-ui/icons'; import { QuestionOutlineIcon } from '@chakra-ui/icons';
import TargetHandle from '../TargetHandle'; import TargetHandle from '../TargetHandle';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import dynamic from 'next/dynamic'; import dynamic from 'next/dynamic';
...@@ -68,7 +68,7 @@ const InputLabel = ({ moduleId, inputKey, mode, ...item }: Props) => { ...@@ -68,7 +68,7 @@ const InputLabel = ({ moduleId, inputKey, mode, ...item }: Props) => {
{edit && ( {edit && (
<> <>
<MyIcon <MyIcon
name={'settingLight'} name={'common/settingLight'}
w={'14px'} w={'14px'}
cursor={'pointer'} cursor={'pointer'}
ml={3} ml={3}
......
...@@ -4,7 +4,7 @@ import { onChangeNode } from '../../../../FlowProvider'; ...@@ -4,7 +4,7 @@ import { onChangeNode } from '../../../../FlowProvider';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { Button, useDisclosure } from '@chakra-ui/react'; import { Button, useDisclosure } from '@chakra-ui/react';
import { AIChatModuleProps } from '@fastgpt/global/core/module/node/type'; import { AIChatModuleProps } from '@fastgpt/global/core/module/node/type';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import AIChatSettingsModal from '@/components/core/module/AIChatSettingsModal'; import AIChatSettingsModal from '@/components/core/module/AIChatSettingsModal';
const AiSettingRender = ({ inputs = [], moduleId }: RenderInputProps) => { const AiSettingRender = ({ inputs = [], moduleId }: RenderInputProps) => {
...@@ -27,7 +27,7 @@ const AiSettingRender = ({ inputs = [], moduleId }: RenderInputProps) => { ...@@ -27,7 +27,7 @@ const AiSettingRender = ({ inputs = [], moduleId }: RenderInputProps) => {
<> <>
<Button <Button
variant={'whitePrimary'} variant={'whitePrimary'}
leftIcon={<MyIcon name={'settingLight'} w={'14px'} />} leftIcon={<MyIcon name={'common/settingLight'} w={'14px'} />}
onClick={onOpenAIChatSetting} onClick={onOpenAIChatSetting}
> >
{t('app.AI Settings')} {t('app.AI Settings')}
......
...@@ -7,7 +7,7 @@ import { DatasetSearchModeEnum } from '@fastgpt/global/core/dataset/constant'; ...@@ -7,7 +7,7 @@ import { DatasetSearchModeEnum } from '@fastgpt/global/core/dataset/constant';
import { FlowNodeTypeEnum } from '@fastgpt/global/core/module/node/constant'; import { FlowNodeTypeEnum } from '@fastgpt/global/core/module/node/constant';
import { ModuleInputKeyEnum } from '@fastgpt/global/core/module/constants'; import { ModuleInputKeyEnum } from '@fastgpt/global/core/module/constants';
import { chatModelList } from '@/web/common/system/staticData'; import { chatModelList } from '@/web/common/system/staticData';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import DatasetParamsModal from '@/components/core/module/DatasetParamsModal'; import DatasetParamsModal from '@/components/core/module/DatasetParamsModal';
const SelectDatasetParam = ({ inputs = [], moduleId }: RenderInputProps) => { const SelectDatasetParam = ({ inputs = [], moduleId }: RenderInputProps) => {
...@@ -63,7 +63,7 @@ const SelectDatasetParam = ({ inputs = [], moduleId }: RenderInputProps) => { ...@@ -63,7 +63,7 @@ const SelectDatasetParam = ({ inputs = [], moduleId }: RenderInputProps) => {
<> <>
<Button <Button
variant={'whitePrimary'} variant={'whitePrimary'}
leftIcon={<MyIcon name={'settingLight'} w={'14px'} />} leftIcon={<MyIcon name={'common/settingLight'} w={'14px'} />}
onClick={onOpen} onClick={onOpen}
> >
{t('core.dataset.search.Params Setting')} {t('core.dataset.search.Params Setting')}
......
...@@ -2,7 +2,7 @@ import { EditNodeFieldType, FlowNodeOutputItemType } from '@fastgpt/global/core/ ...@@ -2,7 +2,7 @@ import { EditNodeFieldType, FlowNodeOutputItemType } from '@fastgpt/global/core/
import React, { useState } from 'react'; import React, { useState } from 'react';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { Box, Flex } from '@chakra-ui/react'; import { Box, Flex } from '@chakra-ui/react';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { onChangeNode } from '../../../FlowProvider'; import { onChangeNode } from '../../../FlowProvider';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
import { QuestionOutlineIcon } from '@chakra-ui/icons'; import { QuestionOutlineIcon } from '@chakra-ui/icons';
...@@ -37,7 +37,7 @@ const OutputLabel = ({ ...@@ -37,7 +37,7 @@ const OutputLabel = ({
{edit && ( {edit && (
<> <>
<MyIcon <MyIcon
name={'settingLight'} name={'common/settingLight'}
w={'14px'} w={'14px'}
cursor={'pointer'} cursor={'pointer'}
mr={3} mr={3}
......
...@@ -34,7 +34,7 @@ import { AddIcon, QuestionOutlineIcon } from '@chakra-ui/icons'; ...@@ -34,7 +34,7 @@ import { AddIcon, QuestionOutlineIcon } from '@chakra-ui/icons';
import { useCopyData } from '@/web/common/hooks/useCopyData'; import { useCopyData } from '@/web/common/hooks/useCopyData';
import { feConfigs } from '@/web/common/system/staticData'; import { feConfigs } from '@/web/common/system/staticData';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import MyModal from '@/components/MyModal'; import MyModal from '@/components/MyModal';
import { useForm } from 'react-hook-form'; import { useForm } from 'react-hook-form';
import { useRequest } from '@/web/common/hooks/useRequest'; import { useRequest } from '@/web/common/hooks/useRequest';
......
import React from 'react'; import React from 'react';
import { PermissionTypeEnum, PermissionTypeMap } from '@fastgpt/global/support/permission/constant'; import { PermissionTypeEnum, PermissionTypeMap } from '@fastgpt/global/support/permission/constant';
import { Box, Flex, FlexProps } from '@chakra-ui/react'; import { Box, Flex, FlexProps } from '@chakra-ui/react';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
const PermissionIconText = ({ const PermissionIconText = ({
......
...@@ -26,7 +26,7 @@ import { ...@@ -26,7 +26,7 @@ import {
useDisclosure, useDisclosure,
MenuButton MenuButton
} from '@chakra-ui/react'; } from '@chakra-ui/react';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import Avatar from '@/components/Avatar'; import Avatar from '@/components/Avatar';
import { useUserStore } from '@/web/support/user/useUserStore'; import { useUserStore } from '@/web/support/user/useUserStore';
import { import {
......
...@@ -17,7 +17,7 @@ import type { BillItemType } from '@fastgpt/global/support/wallet/bill/type'; ...@@ -17,7 +17,7 @@ import type { BillItemType } from '@fastgpt/global/support/wallet/bill/type';
import { usePagination } from '@/web/common/hooks/usePagination'; import { usePagination } from '@/web/common/hooks/usePagination';
import { useLoading } from '@/web/common/hooks/useLoading'; import { useLoading } from '@/web/common/hooks/useLoading';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import DateRangePicker, { type DateRangeType } from '@/components/DateRangePicker'; import DateRangePicker, { type DateRangeType } from '@/components/DateRangePicker';
import { addDays } from 'date-fns'; import { addDays } from 'date-fns';
import dynamic from 'next/dynamic'; import dynamic from 'next/dynamic';
......
...@@ -24,7 +24,7 @@ import { useTranslation } from 'next-i18next'; ...@@ -24,7 +24,7 @@ import { useTranslation } from 'next-i18next';
import { timezoneList } from '@fastgpt/global/common/time/timezone'; import { timezoneList } from '@fastgpt/global/common/time/timezone';
import Loading from '@/components/Loading'; import Loading from '@/components/Loading';
import Avatar from '@/components/Avatar'; import Avatar from '@/components/Avatar';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
import { langMap, setLngStore } from '@/web/common/utils/i18n'; import { langMap, setLngStore } from '@/web/common/utils/i18n';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
......
...@@ -6,7 +6,7 @@ import { useLoading } from '@/web/common/hooks/useLoading'; ...@@ -6,7 +6,7 @@ import { useLoading } from '@/web/common/hooks/useLoading';
import type { UserInformSchema } from '@fastgpt/global/support/user/inform/type'; import type { UserInformSchema } from '@fastgpt/global/support/user/inform/type';
import { formatTimeToChatTime } from '@/utils/tools'; import { formatTimeToChatTime } from '@/utils/tools';
import { useSystemStore } from '@/web/common/system/useSystemStore'; import { useSystemStore } from '@/web/common/system/useSystemStore';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
const BillTable = () => { const BillTable = () => {
const theme = useTheme(); const theme = useTheme();
......
...@@ -18,7 +18,7 @@ import { useQuery } from '@tanstack/react-query'; ...@@ -18,7 +18,7 @@ import { useQuery } from '@tanstack/react-query';
import { formatStorePrice2Read } from '@fastgpt/global/support/wallet/bill/tools'; import { formatStorePrice2Read } from '@fastgpt/global/support/wallet/bill/tools';
import { useToast } from '@/web/common/hooks/useToast'; import { useToast } from '@/web/common/hooks/useToast';
import { useLoading } from '@/web/common/hooks/useLoading'; import { useLoading } from '@/web/common/hooks/useLoading';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
const PayRecordTable = () => { const PayRecordTable = () => {
const { Loading, setIsLoading } = useLoading(); const { Loading, setIsLoading } = useLoading();
......
...@@ -25,7 +25,7 @@ import { QuestionOutlineIcon } from '@chakra-ui/icons'; ...@@ -25,7 +25,7 @@ import { QuestionOutlineIcon } from '@chakra-ui/icons';
import { useCopyData } from '@/web/common/hooks/useCopyData'; import { useCopyData } from '@/web/common/hooks/useCopyData';
import { usePagination } from '@/web/common/hooks/usePagination'; import { usePagination } from '@/web/common/hooks/usePagination';
import type { PromotionRecordType } from '@/global/support/api/userRes.d'; import type { PromotionRecordType } from '@/global/support/api/userRes.d';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
const Promotion = () => { const Promotion = () => {
......
...@@ -38,14 +38,14 @@ const Account = ({ currentTab }: { currentTab: `${TabEnum}` }) => { ...@@ -38,14 +38,14 @@ const Account = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
const tabList = [ const tabList = [
{ {
icon: 'meLight', icon: 'support/user/userLight',
label: t('user.Personal Information'), label: t('user.Personal Information'),
id: TabEnum.info id: TabEnum.info
}, },
...(feConfigs?.isPlus ...(feConfigs?.isPlus
? [ ? [
{ {
icon: 'billRecordLight', icon: 'support/bill/billRecordLight',
label: t('user.Usage Record'), label: t('user.Usage Record'),
id: TabEnum.bill id: TabEnum.bill
} }
...@@ -81,7 +81,7 @@ const Account = ({ currentTab }: { currentTab: `${TabEnum}` }) => { ...@@ -81,7 +81,7 @@ const Account = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
...(userInfo?.team.canWrite ...(userInfo?.team.canWrite
? [ ? [
{ {
icon: 'apikey', icon: 'support/outlink/apikeyLight',
label: t('user.apikey.key'), label: t('user.apikey.key'),
id: TabEnum.apikey id: TabEnum.apikey
} }
...@@ -90,7 +90,7 @@ const Account = ({ currentTab }: { currentTab: `${TabEnum}` }) => { ...@@ -90,7 +90,7 @@ const Account = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
...(feConfigs.isPlus ...(feConfigs.isPlus
? [ ? [
{ {
icon: 'informLight', icon: 'support/user/informLight',
label: t('user.Notice'), label: t('user.Notice'),
id: TabEnum.inform id: TabEnum.inform
} }
......
...@@ -9,7 +9,7 @@ import { useCopyData } from '@/web/common/hooks/useCopyData'; ...@@ -9,7 +9,7 @@ import { useCopyData } from '@/web/common/hooks/useCopyData';
import { AppTypeEnum } from '@fastgpt/global/core/app/constants'; import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
import dynamic from 'next/dynamic'; import dynamic from 'next/dynamic';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
import ChatTest, { type ChatTestComponentRef } from '@/components/core/module/Flow/ChatTest'; import ChatTest, { type ChatTestComponentRef } from '@/components/core/module/Flow/ChatTest';
import { getFlowStore } from '@/components/core/module/Flow/FlowProvider'; import { getFlowStore } from '@/components/core/module/Flow/FlowProvider';
...@@ -101,7 +101,7 @@ const RenderHeaderContainer = React.memo(function RenderHeaderContainer({ ...@@ -101,7 +101,7 @@ const RenderHeaderContainer = React.memo(function RenderHeaderContainer({
<MyTooltip label={t('common.Back')} offset={[10, 10]}> <MyTooltip label={t('common.Back')} offset={[10, 10]}>
<IconButton <IconButton
size={'smSquare'} size={'smSquare'}
icon={<MyIcon name={'back'} w={'14px'} />} icon={<MyIcon name={'common/backLight'} w={'14px'} />}
borderColor={'myGray.300'} borderColor={'myGray.300'}
variant={'whiteBase'} variant={'whiteBase'}
aria-label={''} aria-label={''}
...@@ -122,7 +122,7 @@ const RenderHeaderContainer = React.memo(function RenderHeaderContainer({ ...@@ -122,7 +122,7 @@ const RenderHeaderContainer = React.memo(function RenderHeaderContainer({
<IconButton <IconButton
mr={[3, 6]} mr={[3, 6]}
size={'smSquare'} size={'smSquare'}
icon={<MyIcon name={'importLight'} w={['14px', '16px']} />} icon={<MyIcon name={'common/importLight'} w={['14px', '16px']} />}
variant={'whitePrimary'} variant={'whitePrimary'}
aria-label={'save'} aria-label={'save'}
onClick={onOpenImport} onClick={onOpenImport}
...@@ -157,7 +157,7 @@ const RenderHeaderContainer = React.memo(function RenderHeaderContainer({ ...@@ -157,7 +157,7 @@ const RenderHeaderContainer = React.memo(function RenderHeaderContainer({
<MyTooltip label={'测试对话'}> <MyTooltip label={'测试对话'}>
<IconButton <IconButton
mr={[3, 6]} mr={[3, 6]}
icon={<MyIcon name={'chat'} w={['14px', '16px']} />} icon={<MyIcon name={'core/chat/chatLight'} w={['14px', '16px']} />}
size={'smSquare'} size={'smSquare'}
aria-label={'save'} aria-label={'save'}
variant={'whitePrimary'} variant={'whitePrimary'}
......
...@@ -13,7 +13,7 @@ import { ...@@ -13,7 +13,7 @@ import {
useDisclosure, useDisclosure,
ModalBody ModalBody
} from '@chakra-ui/react'; } from '@chakra-ui/react';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { usePagination } from '@/web/common/hooks/usePagination'; import { usePagination } from '@/web/common/hooks/usePagination';
import { getAppChatLogs } from '@/web/core/app/api'; import { getAppChatLogs } from '@/web/core/app/api';
...@@ -315,7 +315,7 @@ const DetailLogsModal = ({ ...@@ -315,7 +315,7 @@ const DetailLogsModal = ({
_hover={{ bg: 'myGray.100' }} _hover={{ bg: 'myGray.100' }}
onClick={onClose} onClick={onClose}
> >
<MyIcon name={'closeLight'} w={'12px'} h={'12px'} color={'myGray.700'} /> <MyIcon name={'common/closeLight'} w={'12px'} h={'12px'} color={'myGray.700'} />
</Flex> </Flex>
</Flex> </Flex>
<Box pt={2} flex={'1 0 0'}> <Box pt={2} flex={'1 0 0'}>
......
...@@ -5,7 +5,7 @@ import { useTranslation } from 'next-i18next'; ...@@ -5,7 +5,7 @@ import { useTranslation } from 'next-i18next';
import { Box, Flex, FlexProps, Grid, Image, ModalBody, Switch, useTheme } from '@chakra-ui/react'; import { Box, Flex, FlexProps, Grid, Image, ModalBody, Switch, useTheme } from '@chakra-ui/react';
import MyRadio from '@/components/common/MyRadio'; import MyRadio from '@/components/common/MyRadio';
import { useForm } from 'react-hook-form'; import { useForm } from 'react-hook-form';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { useCopyData } from '@/web/common/hooks/useCopyData'; import { useCopyData } from '@/web/common/hooks/useCopyData';
import { useSelectFile } from '@/web/common/file/hooks/useSelectFile'; import { useSelectFile } from '@/web/common/file/hooks/useSelectFile';
import { fileToBase64 } from '@/web/common/file/utils'; import { fileToBase64 } from '@/web/common/file/utils';
......
...@@ -21,7 +21,7 @@ import { ...@@ -21,7 +21,7 @@ import {
Link Link
} from '@chakra-ui/react'; } from '@chakra-ui/react';
import { QuestionOutlineIcon } from '@chakra-ui/icons'; import { QuestionOutlineIcon } from '@chakra-ui/icons';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { useLoading } from '@/web/common/hooks/useLoading'; import { useLoading } from '@/web/common/hooks/useLoading';
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
import { import {
...@@ -282,7 +282,7 @@ function EditLinkModal({ ...@@ -282,7 +282,7 @@ function EditLinkModal({
return ( return (
<MyModal <MyModal
isOpen={true} isOpen={true}
iconSrc="/imgs/modal/shareLight.svg" iconSrc="/imgs/modal/shareFill.svg"
title={isEdit ? t('outlink.Edit Link') : t('outlink.Create Link')} title={isEdit ? t('outlink.Edit Link') : t('outlink.Create Link')}
> >
<ModalBody> <ModalBody>
......
...@@ -24,13 +24,13 @@ const OutLink = ({ appId }: { appId: string }) => { ...@@ -24,13 +24,13 @@ const OutLink = ({ appId }: { appId: string }) => {
iconSize={'20px'} iconSize={'20px'}
list={[ list={[
{ {
icon: 'support/outlink/shareLight', icon: '/imgs/modal/shareFill.svg',
title: '免登录窗口', title: '免登录窗口',
desc: '分享链接给其他用户,无需登录即可直接进行使用', desc: '分享链接给其他用户,无需登录即可直接进行使用',
value: OutLinkTypeEnum.share value: OutLinkTypeEnum.share
}, },
{ {
icon: 'apikeyFill', icon: 'support/outlink/apikeyFill',
title: 'API 访问', title: 'API 访问',
desc: '通过 API 接入到已有系统中,或企微、飞书等', desc: '通过 API 接入到已有系统中,或企微、飞书等',
value: OutLinkTypeEnum.apikey value: OutLinkTypeEnum.apikey
......
import React, { useState } from 'react';
import { Box, Flex, Button, IconButton } from '@chakra-ui/react';
import { useRequest } from '@/web/common/hooks/useRequest';
import { useConfirm } from '@/web/common/hooks/useConfirm';
import { useRouter } from 'next/router';
import { useToast } from '@/web/common/hooks/useToast';
import { AppSchema } from '@fastgpt/global/core/app/type.d';
import { delModelById } from '@/web/core/app/api';
import { useTranslation } from 'next-i18next';
import { useAppStore } from '@/web/core/app/store/useAppStore';
import PermissionIconText from '@/components/support/permission/IconText';
import dynamic from 'next/dynamic';
import Avatar from '@/components/Avatar';
import MyIcon from '@fastgpt/web/components/common/Icon';
const InfoModal = dynamic(() => import('../InfoModal'));
const AppCard = ({ appId }: { appId: string }) => {
const router = useRouter();
const { t } = useTranslation();
const { toast } = useToast();
const { appDetail } = useAppStore();
const [settingAppInfo, setSettingAppInfo] = useState<AppSchema>();
const { openConfirm: openConfirmDel, ConfirmModal: ConfirmDelModal } = useConfirm({
content: t('app.Confirm Del App Tip')
});
/* 点击删除 */
const { mutate: handleDelModel, isLoading } = useRequest({
mutationFn: async () => {
if (!appDetail) return null;
await delModelById(appDetail._id);
return 'success';
},
onSuccess(res) {
if (!res) return;
toast({
title: t('common.Delete Success'),
status: 'success'
});
router.replace(`/app/list`);
},
errorToast: t('common.Delete Failed')
});
return (
<>
<Box px={4}>
<Flex alignItems={'center'} justifyContent={'space-between'}>
<Box fontSize={['md', 'xl']} fontWeight={'bold'}>
<PermissionIconText permission={appDetail.permission} />
</Box>
<Box color={'myGray.500'} fontSize={'sm'}>
AppId:{' '}
<Box as={'span'} userSelect={'all'}>
{appId}
</Box>
</Box>
</Flex>
{/* basic info */}
<Box
borderWidth={'1px'}
borderColor={'primary.1'}
borderRadius={'md'}
mt={2}
px={5}
py={4}
bg={'primary.50'}
position={'relative'}
>
<Flex alignItems={'center'} py={2}>
<Avatar src={appDetail.avatar} borderRadius={'md'} w={'28px'} />
<Box ml={3} fontWeight={'bold'} fontSize={'lg'}>
{appDetail.name}
</Box>
{appDetail.isOwner && (
<IconButton
className="delete"
position={'absolute'}
top={4}
right={4}
size={'smSquare'}
icon={<MyIcon name={'delete'} w={'14px'} />}
variant={'whiteDanger'}
borderRadius={'md'}
aria-label={'delete'}
isLoading={isLoading}
onClick={openConfirmDel(handleDelModel)}
/>
)}
</Flex>
<Box
flex={1}
my={2}
className={'textEllipsis3'}
wordBreak={'break-all'}
color={'myGray.600'}
>
{appDetail.intro || '快来给应用一个介绍~'}
</Box>
<Flex>
<Button
size={['sm', 'md']}
variant={'whitePrimary'}
leftIcon={<MyIcon name={'core/chat/chatLight'} w={'16px'} />}
onClick={() => router.push(`/chat?appId=${appId}`)}
>
对话
</Button>
<Button
mx={3}
size={['sm', 'md']}
variant={'whitePrimary'}
leftIcon={<MyIcon name={'support/outlink/shareLight'} w={'16px'} />}
onClick={() => {
router.replace({
query: {
appId,
currentTab: 'outLink'
}
});
}}
>
外接
</Button>
{appDetail.isOwner && (
<Button
size={['sm', 'md']}
variant={'whitePrimary'}
leftIcon={<MyIcon name={'common/settingLight'} w={'16px'} />}
onClick={() => setSettingAppInfo(appDetail)}
>
设置
</Button>
)}
</Flex>
</Box>
</Box>
<ConfirmDelModal />
{settingAppInfo && (
<InfoModal defaultApp={settingAppInfo} onClose={() => setSettingAppInfo(undefined)} />
)}
</>
);
};
export default React.memo(AppCard);
import React, { useMemo, useState } from 'react';
import MyModal from '@/components/MyModal';
import { useTranslation } from 'next-i18next';
import { Button, ModalBody, ModalFooter } from '@chakra-ui/react';
import PromptTextarea from '@/components/common/Textarea/PromptTextarea';
import MyTooltip from '@/components/MyTooltip';
import { QuestionOutlineIcon } from '@chakra-ui/icons';
const CfrEditModal = ({
defaultValue = '',
onClose,
onFinish
}: {
defaultValue?: string;
onClose: () => void;
onFinish: (value: string) => void;
}) => {
const { t } = useTranslation();
const [value, setValue] = useState(defaultValue);
return (
<MyModal
isOpen
onClose={onClose}
iconSrc="/imgs/module/cfr.svg"
w={'500px'}
title={t('core.module.template.cfr')}
>
<ModalBody>
{t('core.app.edit.cfr background prompt')}
<MyTooltip label={t('core.app.edit.cfr background tip')} forceShow>
<QuestionOutlineIcon display={['none', 'inline']} ml={1} />
</MyTooltip>
<PromptTextarea
mt={1}
flex={1}
bg={'myWhite.400'}
rows={5}
placeholder={t('core.module.input.placeholder.cfr background')}
defaultValue={value}
onBlur={(e) => {
setValue(e.target.value || '');
}}
/>
</ModalBody>
<ModalFooter>
<Button
onClick={() => {
onFinish(value);
onClose();
}}
>
{t('common.Done')}
</Button>
</ModalFooter>
</MyModal>
);
};
export default React.memo(CfrEditModal);
import { useAppStore } from '@/web/core/app/store/useAppStore';
import { useUserStore } from '@/web/support/user/useUserStore';
import { Box, Flex, IconButton } from '@chakra-ui/react';
import { useTranslation } from 'next-i18next';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import ChatBox, { type ComponentRef, type StartChatFnProps } from '@/components/ChatBox';
import { ModuleItemType } from '@fastgpt/global/core/module/type';
import { ModuleInputKeyEnum } from '@fastgpt/global/core/module/constants';
import { streamFetch } from '@/web/common/api/fetch';
import MyTooltip from '@/components/MyTooltip';
import MyIcon from '@fastgpt/web/components/common/Icon';
import { getGuideModule } from '@fastgpt/global/core/module/utils';
import { checkChatSupportSelectFileByModules } from '@/web/core/chat/utils';
import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
const ChatTest = ({ appId }: { appId: string }) => {
const { t } = useTranslation();
const { userInfo } = useUserStore();
const { appDetail } = useAppStore();
const ChatBoxRef = useRef<ComponentRef>(null);
const [modules, setModules] = useState<ModuleItemType[]>([]);
const startChat = useCallback(
async ({ chatList, controller, generatingMessage, variables }: StartChatFnProps) => {
let historyMaxLen = 0;
modules.forEach((module) => {
module.inputs.forEach((input) => {
if (
(input.key === ModuleInputKeyEnum.history ||
input.key === ModuleInputKeyEnum.historyMaxAmount) &&
typeof input.value === 'number'
) {
historyMaxLen = Math.max(historyMaxLen, input.value);
}
});
});
const history = chatList.slice(-historyMaxLen - 2, -2);
// 流请求,获取数据
const { responseText, responseData } = await streamFetch({
url: '/api/core/chat/chatTest',
data: {
history,
prompt: chatList[chatList.length - 2].value,
modules,
variables,
appId,
appName: `调试-${appDetail.name}`
},
onMessage: generatingMessage,
abortSignal: controller
});
return { responseText, responseData };
},
[modules, appId, appDetail.name]
);
const resetChatBox = useCallback(() => {
ChatBoxRef.current?.resetHistory([]);
ChatBoxRef.current?.resetVariables();
}, []);
useEffect(() => {
resetChatBox();
setModules(appDetail.modules);
}, [appDetail, resetChatBox]);
return (
<Flex
position={'relative'}
flexDirection={'column'}
h={'100%'}
py={4}
overflowX={'auto'}
bg={'white'}
>
<Flex px={[2, 5]}>
<Box fontSize={['md', 'xl']} fontWeight={'bold'} flex={1}>
{t('app.Chat Debug')}
</Box>
<MyTooltip label={t('core.chat.Restart')}>
<IconButton
className="chat"
size={'smSquare'}
icon={<MyIcon name={'common/clearLight'} w={'14px'} />}
variant={'whiteDanger'}
borderRadius={'md'}
aria-label={'delete'}
onClick={(e) => {
e.stopPropagation();
resetChatBox();
}}
/>
</MyTooltip>
</Flex>
<Box flex={1}>
<ChatBox
ref={ChatBoxRef}
appAvatar={appDetail.avatar}
userAvatar={userInfo?.avatar}
showMarkIcon
userGuideModule={getGuideModule(modules)}
showFileSelector={checkChatSupportSelectFileByModules(modules)}
onStartChat={startChat}
onDelMessage={() => {}}
/>
</Box>
{appDetail.type !== AppTypeEnum.simple && (
<Flex
position={'absolute'}
top={0}
right={0}
left={0}
bottom={0}
bg={'rgba(255,255,255,0.6)'}
alignItems={'center'}
justifyContent={'center'}
flexDirection={'column'}
fontSize={'lg'}
color={'black'}
whiteSpace={'pre-wrap'}
textAlign={'center'}
>
<Box>{t('app.Advance App TestTip')}</Box>
</Flex>
)}
</Flex>
);
};
export default React.memo(ChatTest);
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import {
Box,
Flex,
Grid,
BoxProps,
useTheme,
useDisclosure,
Button,
Image
} from '@chakra-ui/react';
import { useQuery } from '@tanstack/react-query';
import { QuestionOutlineIcon, SmallAddIcon } from '@chakra-ui/icons';
import { useForm, useFieldArray } from 'react-hook-form';
import { useSystemStore } from '@/web/common/system/useSystemStore';
import { appModules2Form, getDefaultAppForm } from '@fastgpt/global/core/app/utils';
import type { AppSimpleEditFormType } from '@fastgpt/global/core/app/type.d';
import { chatModelList, simpleModeTemplates } from '@/web/common/system/staticData';
import { chatNodeSystemPromptTip, welcomeTextTip } from '@fastgpt/global/core/module/template/tip';
import { useRequest } from '@/web/common/hooks/useRequest';
import { useConfirm } from '@/web/common/hooks/useConfirm';
import { useRouter } from 'next/router';
import { useTranslation } from 'next-i18next';
import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
import { useDatasetStore } from '@/web/core/dataset/store/dataset';
import { useAppStore } from '@/web/core/app/store/useAppStore';
import { postForm2Modules } from '@/web/core/app/utils';
import dynamic from 'next/dynamic';
import MySelect from '@/components/Select';
import MyTooltip from '@/components/MyTooltip';
import Avatar from '@/components/Avatar';
import MyIcon from '@fastgpt/web/components/common/Icon';
import { SimpleModeTemplate_FastGPT_Universal } from '@/global/core/app/constants';
import VariableEdit from '@/components/core/module/Flow/components/modules/VariableEdit';
import PromptTextarea from '@/components/common/Textarea/PromptTextarea/index';
import { DatasetSearchModeMap } from '@fastgpt/global/core/dataset/constant';
import SelectAiModel from '@/components/Select/SelectAiModel';
const DatasetSelectModal = dynamic(() => import('@/components/core/module/DatasetSelectModal'));
const DatasetParamsModal = dynamic(() => import('@/components/core/module/DatasetParamsModal'));
const AIChatSettingsModal = dynamic(() => import('@/components/core/module/AIChatSettingsModal'));
const TTSSelect = dynamic(
() => import('@/components/core/module/Flow/components/modules/TTSSelect')
);
const QGSwitch = dynamic(() => import('@/components/core/module/Flow/components/modules/QGSwitch'));
const CfrEditModal = dynamic(() => import('./CfrEditModal'));
const EditForm = ({
divRef,
isSticky
}: {
divRef: React.RefObject<HTMLDivElement>;
isSticky: boolean;
}) => {
const theme = useTheme();
const router = useRouter();
const { t } = useTranslation();
const { appDetail, updateAppDetail } = useAppStore();
const { loadAllDatasets, allDatasets } = useDatasetStore();
const { isPc } = useSystemStore();
const [refresh, setRefresh] = useState(false);
const { register, setValue, getValues, reset, handleSubmit, control } =
useForm<AppSimpleEditFormType>({
defaultValues: getDefaultAppForm()
});
const { fields: datasets, replace: replaceKbList } = useFieldArray({
control,
name: 'dataset.datasets'
});
const {
isOpen: isOpenAIChatSetting,
onOpen: onOpenAIChatSetting,
onClose: onCloseAIChatSetting
} = useDisclosure();
const {
isOpen: isOpenDatasetSelect,
onOpen: onOpenKbSelect,
onClose: onCloseKbSelect
} = useDisclosure();
const {
isOpen: isOpenDatasetParams,
onOpen: onOpenDatasetParams,
onClose: onCloseDatasetParams
} = useDisclosure();
const {
isOpen: isOpenCfrModal,
onOpen: onOpenCfrModal,
onClose: onCloseCfrModal
} = useDisclosure();
const { openConfirm: openConfirmSave, ConfirmModal: ConfirmSaveModal } = useConfirm({
content: t('core.app.edit.Confirm Save App Tip')
});
const chatModelSelectList = useMemo(() => {
return chatModelList.map((item) => ({
value: item.model,
label: item.name
}));
}, [refresh]);
const selectDatasets = useMemo(
() => allDatasets.filter((item) => datasets.find((dataset) => dataset.datasetId === item._id)),
[allDatasets, datasets]
);
const selectSimpleTemplate = useMemo(
() =>
simpleModeTemplates?.find((item) => item.id === getValues('templateId')) ||
SimpleModeTemplate_FastGPT_Universal,
[getValues, refresh]
);
const tokenLimit = useMemo(() => {
return (
chatModelList.find((item) => item.model === getValues('aiSettings.model'))?.quoteMaxToken ||
3000
);
}, [getValues, refresh]);
const datasetSearchMode = useMemo(() => {
const mode = getValues('dataset.searchMode');
if (!mode) return '';
return t(DatasetSearchModeMap[mode]?.title);
}, [getValues, t, refresh]);
const { mutate: onSubmitSave, isLoading: isSaving } = useRequest({
mutationFn: async (data: AppSimpleEditFormType) => {
const modules = await postForm2Modules(data, data.templateId);
await updateAppDetail(appDetail._id, {
modules,
type: AppTypeEnum.simple,
simpleTemplateId: data.templateId,
permission: undefined
});
},
successToast: t('common.Save Success'),
errorToast: t('common.Save Failed')
});
const appModule2Form = useCallback(() => {
const formVal = appModules2Form({
templateId: appDetail.simpleTemplateId,
modules: appDetail.modules
});
reset(formVal);
setTimeout(() => {
setRefresh((state) => !state);
}, 100);
}, [appDetail.modules, appDetail.simpleTemplateId, reset]);
useEffect(() => {
appModule2Form();
}, [appModule2Form]);
useQuery(['loadAllDatasets'], loadAllDatasets);
const BoxStyles: BoxProps = {
px: 5,
py: '16px',
borderBottomWidth: '1px',
borderBottomColor: 'borderColor.low'
};
const BoxBtnStyles: BoxProps = {
cursor: 'pointer',
px: 3,
py: 1,
borderRadius: 'md',
_hover: {
bg: 'myGray.150'
}
};
const LabelStyles: BoxProps = {
w: ['60px', '100px'],
flexShrink: 0,
fontSize: ['sm', 'md']
};
return (
<Box>
{/* title */}
<Flex
ref={divRef}
position={'sticky'}
top={-4}
bg={'myGray.25'}
py={4}
justifyContent={'space-between'}
alignItems={'center'}
zIndex={10}
px={4}
{...(isSticky && {
borderBottom: theme.borders.base,
boxShadow: '0 2px 10px rgba(0,0,0,0.12)'
})}
>
<Flex alignItems={'center'}>
<Box fontSize={['md', 'xl']} color={'myGray.800'}>
{t('core.app.App params config')}
</Box>
<MyTooltip label={t('core.app.Simple Config Tip')} forceShow>
<MyIcon name={'common/questionLight'} color={'myGray.500'} ml={2} />
</MyTooltip>
</Flex>
<Button
isLoading={isSaving}
size={['sm', 'md']}
variant={appDetail.type === AppTypeEnum.simple ? 'primary' : 'whitePrimary'}
onClick={() => {
if (appDetail.type !== AppTypeEnum.simple) {
openConfirmSave(handleSubmit((data) => onSubmitSave(data)))();
} else {
handleSubmit((data) => onSubmitSave(data))();
}
}}
>
{isPc ? t('core.app.Save and preview') : t('common.Save')}
</Button>
</Flex>
<Box px={4}>
<Box bg={'white'} borderRadius={'md'} borderWidth={'1px'} borderColor={'borderColor.base'}>
{/* simple mode select */}
<Flex {...BoxStyles}>
<Flex alignItems={'center'} flex={'1 0 0'}>
<Image alt={''} src={'/imgs/module/templates.png'} w={'18px'} />
<Box mx={2}>{t('core.app.simple.mode template select')}</Box>
</Flex>
<MySelect
w={['200px', '250px']}
list={
simpleModeTemplates?.map((item) => ({
alias: item.name,
label: item.desc,
value: item.id
})) || []
}
value={getValues('templateId')}
onchange={(val) => {
setValue('templateId', val);
setRefresh(!refresh);
}}
/>
</Flex>
{/* ai */}
{selectSimpleTemplate?.systemForm?.aiSettings && (
<Box {...BoxStyles}>
<Flex alignItems={'center'}>
<Image alt={''} src={'/imgs/module/AI.png'} w={'18px'} />
<Box ml={2} flex={1}>
{t('app.AI Settings')}
</Box>
{(selectSimpleTemplate.systemForm.aiSettings.maxToken ||
selectSimpleTemplate.systemForm.aiSettings.temperature ||
selectSimpleTemplate.systemForm.aiSettings.quoteTemplate ||
selectSimpleTemplate.systemForm.aiSettings.quotePrompt) && (
<Flex {...BoxBtnStyles} onClick={onOpenAIChatSetting}>
<MyIcon mr={1} name={'common/settingLight'} w={'14px'} />
{t('app.Open AI Advanced Settings')}
</Flex>
)}
</Flex>
{selectSimpleTemplate.systemForm.aiSettings?.model && (
<Flex alignItems={'center'} mt={5}>
<Box {...LabelStyles}>{t('core.ai.Model')}</Box>
<Box flex={'1 0 0'}>
<SelectAiModel
width={'100%'}
value={getValues(`aiSettings.model`)}
list={chatModelSelectList}
onchange={(val: any) => {
setValue('aiSettings.model', val);
const maxToken =
chatModelList.find((item) => item.model === getValues('aiSettings.model'))
?.maxResponse || 4000;
const token = maxToken / 2;
setValue('aiSettings.maxToken', token);
setRefresh(!refresh);
}}
/>
</Box>
</Flex>
)}
{selectSimpleTemplate.systemForm.aiSettings?.systemPrompt && (
<Flex mt={10} alignItems={'flex-start'}>
<Box {...LabelStyles}>
{t('core.ai.Prompt')}
<MyTooltip label={chatNodeSystemPromptTip} forceShow>
<QuestionOutlineIcon display={['none', 'inline']} ml={1} />
</MyTooltip>
</Box>
<PromptTextarea
flex={1}
bg={'myWhite.400'}
rows={5}
placeholder={chatNodeSystemPromptTip}
defaultValue={getValues('aiSettings.systemPrompt')}
onBlur={(e) => {
setValue('aiSettings.systemPrompt', e.target.value || '');
}}
/>
</Flex>
)}
</Box>
)}
{/* dataset */}
{selectSimpleTemplate?.systemForm?.dataset && (
<Box {...BoxStyles}>
<Flex alignItems={'center'}>
<Flex alignItems={'center'} flex={1}>
<Image alt={''} src={'/imgs/module/db.png'} w={'18px'} />
<Box ml={2}>{t('core.dataset.Choose Dataset')}</Box>
</Flex>
{selectSimpleTemplate.systemForm.dataset.datasets && (
<Flex alignItems={'center'} {...BoxBtnStyles} onClick={onOpenKbSelect}>
<SmallAddIcon />
{t('common.Choose')}
</Flex>
)}
{(selectSimpleTemplate.systemForm.dataset.limit ||
selectSimpleTemplate.systemForm.dataset.searchMode ||
selectSimpleTemplate.systemForm.dataset.searchEmptyText ||
selectSimpleTemplate.systemForm.dataset.similarity) && (
<Flex
alignItems={'center'}
ml={3}
{...BoxBtnStyles}
onClick={onOpenDatasetParams}
>
<MyIcon name={'edit'} w={'14px'} mr={1} />
{t('common.Params')}
</Flex>
)}
</Flex>
{getValues('dataset.datasets').length > 0 && (
<Flex mt={1} color={'myGray.600'} fontSize={'sm'} mb={2}>
{t('core.dataset.search.search mode')}: {datasetSearchMode}
{', '}
{t('core.dataset.search.Min Similarity')}: {getValues('dataset.similarity')}
{', '}
{t('core.dataset.search.Max Tokens')}: {getValues('dataset.limit')}
{getValues('dataset.searchEmptyText') === ''
? ''
: t('core.dataset.Set Empty Result Tip')}
</Flex>
)}
<Grid
gridTemplateColumns={['repeat(2, minmax(0, 1fr))', 'repeat(3, minmax(0, 1fr))']}
gridGap={[2, 4]}
>
{selectDatasets.map((item) => (
<MyTooltip key={item._id} label={t('core.dataset.Read Dataset')}>
<Flex
overflow={'hidden'}
alignItems={'center'}
p={2}
bg={'white'}
boxShadow={
'0 4px 8px -2px rgba(16,24,40,.1),0 2px 4px -2px rgba(16,24,40,.06)'
}
borderRadius={'md'}
border={theme.borders.base}
cursor={'pointer'}
onClick={() =>
router.push({
pathname: '/dataset/detail',
query: {
datasetId: item._id
}
})
}
>
<Avatar src={item.avatar} w={'18px'} mr={1} />
<Box flex={'1 0 0'} w={0} className={'textEllipsis'} fontSize={'sm'}>
{item.name}
</Box>
</Flex>
</MyTooltip>
))}
</Grid>
</Box>
)}
{/* cfr */}
{selectSimpleTemplate?.systemForm?.cfr && getValues('dataset.datasets').length > 0 && (
<Flex {...BoxStyles} alignItems={'center'}>
<Image src={'/imgs/module/cfr.svg'} alt={''} w={'18px'} />
<Box ml={2}>{t('core.module.template.cfr')}</Box>
<MyTooltip label={t('core.module.template.cfr intro')} forceShow>
<QuestionOutlineIcon display={['none', 'inline']} ml={1} />
</MyTooltip>
<Box flex={1} />
<Flex {...BoxBtnStyles} onClick={onOpenCfrModal}>
{getValues('cfr.background') === 'none' ? t('common.Not open') : t('common.Opened')}
</Flex>
</Flex>
)}
{/* variable */}
{selectSimpleTemplate?.systemForm?.userGuide?.variables && (
<Box {...BoxStyles}>
<VariableEdit
variables={getValues('userGuide.variables')}
onChange={(e) => {
setValue('userGuide.variables', e);
setRefresh(!refresh);
}}
/>
</Box>
)}
{/* welcome */}
{selectSimpleTemplate?.systemForm?.userGuide?.welcomeText && (
<Box {...BoxStyles}>
<Flex alignItems={'center'}>
<Image alt={''} src={'/imgs/module/userGuide.png'} w={'18px'} />
<Box mx={2}>{t('core.app.Welcome Text')}</Box>
<MyTooltip label={welcomeTextTip} forceShow>
<QuestionOutlineIcon />
</MyTooltip>
</Flex>
<PromptTextarea
mt={2}
bg={'myWhite.400'}
rows={5}
placeholder={welcomeTextTip}
defaultValue={getValues('userGuide.welcomeText')}
onBlur={(e) => {
setValue('userGuide.welcomeText', e.target.value || '');
}}
/>
</Box>
)}
{/* tts */}
{selectSimpleTemplate?.systemForm?.userGuide?.tts && (
<Box {...BoxStyles}>
<TTSSelect
value={getValues('userGuide.tts')}
onChange={(e) => {
setValue('userGuide.tts', e);
setRefresh((state) => !state);
}}
/>
</Box>
)}
{/* question guide */}
{selectSimpleTemplate?.systemForm?.userGuide?.questionGuide && (
<Box {...BoxStyles} borderBottom={'none'}>
<QGSwitch
isChecked={getValues('userGuide.questionGuide')}
size={'lg'}
onChange={(e) => {
const value = e.target.checked;
setValue('userGuide.questionGuide', value);
setRefresh((state) => !state);
}}
/>
</Box>
)}
</Box>
</Box>
<ConfirmSaveModal bg={appDetail.type === AppTypeEnum.simple ? '' : 'red.600'} countDown={5} />
{isOpenAIChatSetting && (
<AIChatSettingsModal
onClose={onCloseAIChatSetting}
onSuccess={(e) => {
setValue('aiSettings', e);
onCloseAIChatSetting();
}}
defaultData={getValues('aiSettings')}
simpleModeTemplate={selectSimpleTemplate}
/>
)}
{isOpenDatasetSelect && (
<DatasetSelectModal
isOpen={isOpenDatasetSelect}
defaultSelectedDatasets={selectDatasets.map((item) => ({
datasetId: item._id,
vectorModel: item.vectorModel
}))}
onClose={onCloseKbSelect}
onChange={replaceKbList}
/>
)}
{isOpenDatasetParams && (
<DatasetParamsModal
// {...getValues('dataset')}
searchMode={getValues('dataset.searchMode')}
searchEmptyText={
selectSimpleTemplate?.systemForm?.dataset?.searchEmptyText
? getValues('dataset.searchEmptyText')
: undefined
}
limit={
selectSimpleTemplate?.systemForm?.dataset?.limit
? getValues('dataset.limit')
: undefined
}
similarity={
selectSimpleTemplate?.systemForm?.dataset?.similarity
? getValues('dataset.similarity')
: undefined
}
usingReRank={
selectSimpleTemplate?.systemForm?.dataset?.usingReRank
? getValues('dataset.usingReRank')
: undefined
}
maxTokens={tokenLimit}
onClose={onCloseDatasetParams}
onSuccess={(e) => {
setValue('dataset', {
...getValues('dataset'),
...e
});
setRefresh((state) => !state);
}}
/>
)}
{isOpenCfrModal && (
<CfrEditModal
onClose={onCloseCfrModal}
defaultValue={getValues('cfr.background')}
onFinish={(e) => {
setValue('cfr.background', e);
}}
/>
)}
</Box>
);
};
export default React.memo(EditForm);
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import React from 'react';
import { import { Box, Grid } from '@chakra-ui/react';
Box,
Flex,
Grid,
BoxProps,
Textarea,
useTheme,
useDisclosure,
Button,
IconButton,
Image
} from '@chakra-ui/react';
import { useUserStore } from '@/web/support/user/useUserStore';
import { useQuery } from '@tanstack/react-query';
import { QuestionOutlineIcon, SmallAddIcon } from '@chakra-ui/icons';
import { useForm, useFieldArray } from 'react-hook-form';
import { useSystemStore } from '@/web/common/system/useSystemStore'; import { useSystemStore } from '@/web/common/system/useSystemStore';
import { appModules2Form, getDefaultAppForm } from '@fastgpt/global/core/app/utils';
import type { AppSimpleEditFormType } from '@fastgpt/global/core/app/type.d';
import { chatModelList, simpleModeTemplates } from '@/web/common/system/staticData';
import { chatNodeSystemPromptTip, welcomeTextTip } from '@fastgpt/global/core/module/template/tip';
import type { ModuleItemType } from '@fastgpt/global/core/module/type';
import { useRequest } from '@/web/common/hooks/useRequest';
import { useConfirm } from '@/web/common/hooks/useConfirm';
import { streamFetch } from '@/web/common/api/fetch';
import { useRouter } from 'next/router';
import { useToast } from '@/web/common/hooks/useToast';
import { AppSchema } from '@fastgpt/global/core/app/type.d';
import { delModelById } from '@/web/core/app/api';
import { useTranslation } from 'next-i18next';
import { getGuideModule } from '@fastgpt/global/core/module/utils';
import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
import { useDatasetStore } from '@/web/core/dataset/store/dataset';
import { useAppStore } from '@/web/core/app/store/useAppStore';
import PermissionIconText from '@/components/support/permission/IconText';
import { checkChatSupportSelectFileByModules } from '@/web/core/chat/utils';
import { useSticky } from '@/web/common/hooks/useSticky'; import { useSticky } from '@/web/common/hooks/useSticky';
import { postForm2Modules } from '@/web/core/app/utils';
import dynamic from 'next/dynamic';
import MySelect from '@/components/Select';
import MyTooltip from '@/components/MyTooltip';
import Avatar from '@/components/Avatar';
import MyIcon from '@/components/Icon';
import ChatBox, { type ComponentRef, type StartChatFnProps } from '@/components/ChatBox';
import { SimpleModeTemplate_FastGPT_Universal } from '@/global/core/app/constants';
import VariableEdit from '@/components/core/module/Flow/components/modules/VariableEdit';
import { ModuleInputKeyEnum } from '@fastgpt/global/core/module/constants';
import PromptTextarea from '@/components/common/Textarea/PromptTextarea/index';
import { DatasetSearchModeMap } from '@fastgpt/global/core/dataset/constant';
import SelectAiModel from '@/components/Select/SelectAiModel';
const InfoModal = dynamic(() => import('../InfoModal')); import ChatTest from './ChatTest';
const DatasetSelectModal = dynamic(() => import('@/components/core/module/DatasetSelectModal')); import AppCard from './AppCard';
const DatasetParamsModal = dynamic(() => import('@/components/core/module/DatasetParamsModal')); import EditForm from './EditForm';
const AIChatSettingsModal = dynamic(() => import('@/components/core/module/AIChatSettingsModal'));
const TTSSelect = dynamic(
() => import('@/components/core/module/Flow/components/modules/TTSSelect')
);
const QGSwitch = dynamic(() => import('@/components/core/module/Flow/components/modules/QGSwitch'));
function ConfigForm({ const SimpleEdit = ({ appId }: { appId: string }) => {
divRef,
isSticky
}: {
divRef: React.RefObject<HTMLDivElement>;
isSticky: boolean;
}) {
const theme = useTheme();
const router = useRouter();
const { t } = useTranslation();
const { appDetail, updateAppDetail } = useAppStore();
const { loadAllDatasets, allDatasets } = useDatasetStore();
const { isPc } = useSystemStore(); const { isPc } = useSystemStore();
const [refresh, setRefresh] = useState(false);
const { register, setValue, getValues, reset, handleSubmit, control } =
useForm<AppSimpleEditFormType>({
defaultValues: getDefaultAppForm()
});
const { fields: datasets, replace: replaceKbList } = useFieldArray({
control,
name: 'dataset.datasets'
});
const {
isOpen: isOpenAIChatSetting,
onOpen: onOpenAIChatSetting,
onClose: onCloseAIChatSetting
} = useDisclosure();
const {
isOpen: isOpenDatasetSelect,
onOpen: onOpenKbSelect,
onClose: onCloseKbSelect
} = useDisclosure();
const {
isOpen: isOpenDatasetParams,
onOpen: onOpenKbParams,
onClose: onCloseKbParams
} = useDisclosure();
const { openConfirm: openConfirmSave, ConfirmModal: ConfirmSaveModal } = useConfirm({
content: t('core.app.edit.Confirm Save App Tip')
});
const chatModelSelectList = useMemo(() => {
return chatModelList.map((item) => ({
value: item.model,
label: item.name
}));
}, [refresh]);
const selectDatasets = useMemo(
() => allDatasets.filter((item) => datasets.find((dataset) => dataset.datasetId === item._id)),
[allDatasets, datasets]
);
const selectSimpleTemplate = useMemo(
() =>
simpleModeTemplates?.find((item) => item.id === getValues('templateId')) ||
SimpleModeTemplate_FastGPT_Universal,
[getValues, refresh]
);
const tokenLimit = useMemo(() => {
return (
chatModelList.find((item) => item.model === getValues('aiSettings.model'))?.quoteMaxToken ||
3000
);
}, [getValues, refresh]);
const datasetSearchMode = useMemo(() => {
const mode = getValues('dataset.searchMode');
if (!mode) return '';
return t(DatasetSearchModeMap[mode]?.title);
}, [getValues, t, refresh]);
const { mutate: onSubmitSave, isLoading: isSaving } = useRequest({
mutationFn: async (data: AppSimpleEditFormType) => {
const modules = await postForm2Modules(data, data.templateId);
await updateAppDetail(appDetail._id, {
modules,
type: AppTypeEnum.simple,
simpleTemplateId: data.templateId,
permission: undefined
});
},
successToast: t('common.Save Success'),
errorToast: t('common.Save Failed')
});
const appModule2Form = useCallback(() => {
const formVal = appModules2Form({
templateId: appDetail.simpleTemplateId,
modules: appDetail.modules
});
reset(formVal);
setTimeout(() => {
setRefresh((state) => !state);
}, 100);
}, [appDetail.modules, appDetail.simpleTemplateId, reset]);
useEffect(() => {
appModule2Form();
}, [appModule2Form]);
useQuery(['loadAllDatasets'], loadAllDatasets);
const BoxStyles: BoxProps = {
bg: 'myWhite.200',
px: 4,
py: 3,
borderRadius: 'lg',
border: theme.borders.base
};
const BoxBtnStyles: BoxProps = {
cursor: 'pointer',
px: 3,
py: '2px',
borderRadius: 'md',
_hover: {
bg: 'myGray.200'
}
};
const LabelStyles: BoxProps = {
w: ['60px', '100px'],
flexShrink: 0,
fontSize: ['sm', 'md']
};
return (
<Box mt={2}>
{/* title */}
<Flex
ref={divRef}
position={'sticky'}
top={-4}
bg={'myGray.25'}
py={4}
justifyContent={'space-between'}
alignItems={'center'}
zIndex={10}
px={4}
{...(isSticky && {
borderBottom: theme.borders.base,
boxShadow: '0 2px 10px rgba(0,0,0,0.12)'
})}
>
<Box fontSize={['md', 'xl']} fontWeight={'bold'}>
{t('core.app.App params config')}
<MyTooltip label={t('core.app.Simple Config Tip')} forceShow>
<QuestionOutlineIcon ml={2} fontSize={'md'} />
</MyTooltip>
</Box>
<Button
isLoading={isSaving}
size={['sm', 'md']}
variant={appDetail.type === AppTypeEnum.simple ? 'primary' : 'whitePrimary'}
onClick={() => {
if (appDetail.type !== AppTypeEnum.simple) {
openConfirmSave(handleSubmit((data) => onSubmitSave(data)))();
} else {
handleSubmit((data) => onSubmitSave(data))();
}
}}
>
{isPc ? t('core.app.Save and preview') : t('common.Save')}
</Button>
</Flex>
<Box px={4}>
{/* simple mode select */}
<Flex {...BoxStyles}>
<Flex alignItems={'center'} flex={'1 0 0'}>
<Image alt={''} src={'/imgs/module/templates.png'} w={'18px'} />
<Box mx={2}>{t('core.app.simple.mode template select')}</Box>
</Flex>
<MySelect
w={['200px', '250px']}
list={
simpleModeTemplates?.map((item) => ({
alias: item.name,
label: item.desc,
value: item.id
})) || []
}
value={getValues('templateId')}
onchange={(val) => {
setValue('templateId', val);
setRefresh(!refresh);
}}
/>
</Flex>
{/* ai */}
{selectSimpleTemplate?.systemForm?.aiSettings && (
<Box mt={5} {...BoxStyles}>
<Flex alignItems={'center'}>
<Image alt={''} src={'/imgs/module/AI.png'} w={'18px'} />
<Box ml={2} flex={1}>
{t('app.AI Settings')}
</Box>
{(selectSimpleTemplate.systemForm.aiSettings.maxToken ||
selectSimpleTemplate.systemForm.aiSettings.temperature ||
selectSimpleTemplate.systemForm.aiSettings.quoteTemplate ||
selectSimpleTemplate.systemForm.aiSettings.quotePrompt) && (
<Flex {...BoxBtnStyles} onClick={onOpenAIChatSetting}>
<MyIcon mr={1} name={'settingLight'} w={'14px'} />
{t('app.Open AI Advanced Settings')}
</Flex>
)}
</Flex>
{selectSimpleTemplate.systemForm.aiSettings?.model && (
<Flex alignItems={'center'} mt={5}>
<Box {...LabelStyles}>{t('core.ai.Model')}</Box>
<Box flex={'1 0 0'}>
<SelectAiModel
width={'100%'}
value={getValues(`aiSettings.model`)}
list={chatModelSelectList}
onchange={(val: any) => {
setValue('aiSettings.model', val);
const maxToken =
chatModelList.find((item) => item.model === getValues('aiSettings.model'))
?.maxResponse || 4000;
const token = maxToken / 2;
setValue('aiSettings.maxToken', token);
setRefresh(!refresh);
}}
/>
</Box>
</Flex>
)}
{selectSimpleTemplate.systemForm.aiSettings?.systemPrompt && (
<Flex mt={10} alignItems={'flex-start'}>
<Box {...LabelStyles}>
{t('core.ai.Prompt')}
<MyTooltip label={chatNodeSystemPromptTip} forceShow>
<QuestionOutlineIcon display={['none', 'inline']} ml={1} />
</MyTooltip>
</Box>
<PromptTextarea
flex={1}
bg={'myWhite.400'}
rows={5}
placeholder={chatNodeSystemPromptTip}
defaultValue={getValues('aiSettings.systemPrompt')}
onBlur={(e) => {
setValue('aiSettings.systemPrompt', e.target.value || '');
}}
/>
</Flex>
)}
</Box>
)}
{/* dataset */}
{selectSimpleTemplate?.systemForm?.dataset && (
<Box mt={5} {...BoxStyles}>
<Flex alignItems={'center'}>
<Flex alignItems={'center'} flex={1}>
<Image alt={''} src={'/imgs/module/db.png'} w={'18px'} />
<Box ml={2}>{t('core.dataset.Choose Dataset')}</Box>
</Flex>
{selectSimpleTemplate.systemForm.dataset.datasets && (
<Flex alignItems={'center'} {...BoxBtnStyles} onClick={onOpenKbSelect}>
<SmallAddIcon />
{t('common.Choose')}
</Flex>
)}
{(selectSimpleTemplate.systemForm.dataset.limit ||
selectSimpleTemplate.systemForm.dataset.searchMode ||
selectSimpleTemplate.systemForm.dataset.searchEmptyText ||
selectSimpleTemplate.systemForm.dataset.similarity) && (
<Flex alignItems={'center'} ml={3} {...BoxBtnStyles} onClick={onOpenKbParams}>
<MyIcon name={'edit'} w={'14px'} mr={1} />
{t('common.Params')}
</Flex>
)}
</Flex>
{getValues('dataset.datasets').length > 0 && (
<Flex mt={1} color={'myGray.600'} fontSize={'sm'} mb={2}>
{t('core.dataset.search.search mode')}: {datasetSearchMode}
{', '}
{t('core.dataset.search.Min Similarity')}: {getValues('dataset.similarity')}
{', '}
{t('core.dataset.search.Max Tokens')}: {getValues('dataset.limit')}
{getValues('dataset.searchEmptyText') === ''
? ''
: t('core.dataset.Set Empty Result Tip')}
</Flex>
)}
<Grid
gridTemplateColumns={['repeat(2, minmax(0, 1fr))', 'repeat(3, minmax(0, 1fr))']}
gridGap={[2, 4]}
>
{selectDatasets.map((item) => (
<MyTooltip key={item._id} label={t('core.dataset.Read Dataset')}>
<Flex
overflow={'hidden'}
alignItems={'center'}
p={2}
bg={'white'}
boxShadow={'0 4px 8px -2px rgba(16,24,40,.1),0 2px 4px -2px rgba(16,24,40,.06)'}
borderRadius={'md'}
border={theme.borders.base}
cursor={'pointer'}
onClick={() =>
router.push({
pathname: '/dataset/detail',
query: {
datasetId: item._id
}
})
}
>
<Avatar src={item.avatar} w={'18px'} mr={1} />
<Box flex={'1 0 0'} w={0} className={'textEllipsis'} fontSize={'sm'}>
{item.name}
</Box>
</Flex>
</MyTooltip>
))}
</Grid>
{selectSimpleTemplate?.systemForm?.cfr && getValues('dataset.datasets').length > 0 && (
<Box mt={10}>
<Box {...LabelStyles} w={'auto'}>
{t('core.app.edit.cfr background prompt')}
<MyTooltip label={t('core.app.edit.cfr background tip')} forceShow>
<QuestionOutlineIcon display={['none', 'inline']} ml={1} />
</MyTooltip>
</Box>
<PromptTextarea
mt={1}
flex={1}
bg={'myWhite.400'}
rows={5}
placeholder={t('core.module.input.placeholder.cfr background')}
defaultValue={getValues('cfr.background')}
onBlur={(e) => {
setValue('cfr.background', e.target.value || '');
}}
/>
</Box>
)}
</Box>
)}
{/* variable */}
{selectSimpleTemplate?.systemForm?.userGuide?.variables && (
<Box mt={2} {...BoxStyles}>
<VariableEdit
variables={getValues('userGuide.variables')}
onChange={(e) => {
setValue('userGuide.variables', e);
setRefresh(!refresh);
}}
/>
</Box>
)}
{/* welcome */}
{selectSimpleTemplate?.systemForm?.userGuide?.welcomeText && (
<Box {...BoxStyles} mt={2}>
<Flex alignItems={'center'}>
<Image alt={''} src={'/imgs/module/userGuide.png'} w={'18px'} />
<Box mx={2}>{t('core.app.Welcome Text')}</Box>
<MyTooltip label={welcomeTextTip} forceShow>
<QuestionOutlineIcon />
</MyTooltip>
</Flex>
<PromptTextarea
mt={2}
bg={'myWhite.400'}
rows={5}
placeholder={welcomeTextTip}
defaultValue={getValues('userGuide.welcomeText')}
onBlur={(e) => {
setValue('userGuide.welcomeText', e.target.value || '');
}}
/>
</Box>
)}
{/* tts */}
{selectSimpleTemplate?.systemForm?.userGuide?.tts && (
<Box mt={5} {...BoxStyles}>
<TTSSelect
value={getValues('userGuide.tts')}
onChange={(e) => {
setValue('userGuide.tts', e);
setRefresh((state) => !state);
}}
/>
</Box>
)}
{/* question guide */}
{selectSimpleTemplate?.systemForm?.userGuide?.questionGuide && (
<Box mt={5} {...BoxStyles}>
<QGSwitch
isChecked={getValues('userGuide.questionGuide')}
size={'lg'}
onChange={(e) => {
const value = e.target.checked;
setValue('userGuide.questionGuide', value);
setRefresh((state) => !state);
}}
/>
</Box>
)}
</Box>
<ConfirmSaveModal bg={appDetail.type === AppTypeEnum.simple ? '' : 'red.600'} countDown={5} />
{isOpenAIChatSetting && (
<AIChatSettingsModal
onClose={onCloseAIChatSetting}
onSuccess={(e) => {
setValue('aiSettings', e);
onCloseAIChatSetting();
}}
defaultData={getValues('aiSettings')}
simpleModeTemplate={selectSimpleTemplate}
/>
)}
{isOpenDatasetSelect && (
<DatasetSelectModal
isOpen={isOpenDatasetSelect}
defaultSelectedDatasets={selectDatasets.map((item) => ({
datasetId: item._id,
vectorModel: item.vectorModel
}))}
onClose={onCloseKbSelect}
onChange={replaceKbList}
/>
)}
{isOpenDatasetParams && (
<DatasetParamsModal
// {...getValues('dataset')}
searchMode={getValues('dataset.searchMode')}
searchEmptyText={
selectSimpleTemplate?.systemForm?.dataset?.searchEmptyText
? getValues('dataset.searchEmptyText')
: undefined
}
limit={
selectSimpleTemplate?.systemForm?.dataset?.limit
? getValues('dataset.limit')
: undefined
}
similarity={
selectSimpleTemplate?.systemForm?.dataset?.similarity
? getValues('dataset.similarity')
: undefined
}
usingReRank={
selectSimpleTemplate?.systemForm?.dataset?.usingReRank
? getValues('dataset.usingReRank')
: undefined
}
maxTokens={tokenLimit}
onClose={onCloseKbParams}
onSuccess={(e) => {
setValue('dataset', {
...getValues('dataset'),
...e
});
setRefresh((state) => !state);
}}
/>
)}
</Box>
);
}
function Settings({ appId }: { appId: string }) {
const theme = useTheme();
const router = useRouter();
const { t } = useTranslation();
const { toast } = useToast();
const { parentRef, divRef, isSticky } = useSticky(); const { parentRef, divRef, isSticky } = useSticky();
const { appDetail } = useAppStore();
const [settingAppInfo, setSettingAppInfo] = useState<AppSchema>();
const { openConfirm: openConfirmDel, ConfirmModal: ConfirmDelModal } = useConfirm({
content: t('app.Confirm Del App Tip')
});
/* 点击删除 */
const { mutate: handleDelModel, isLoading } = useRequest({
mutationFn: async () => {
if (!appDetail) return null;
await delModelById(appDetail._id);
return 'success';
},
onSuccess(res) {
if (!res) return;
toast({
title: t('common.Delete Success'),
status: 'success'
});
router.replace(`/app/list`);
},
errorToast: t('common.Delete Failed')
});
return ( return (
<Grid gridTemplateColumns={['1fr', '550px 1fr']} h={'100%'}>
<Box <Box
ref={parentRef} ref={parentRef}
h={'100%'} h={'100%'}
...@@ -581,233 +22,15 @@ function Settings({ appId }: { appId: string }) { ...@@ -581,233 +22,15 @@ function Settings({ appId }: { appId: string }) {
pb={10} pb={10}
overflow={'overlay'} overflow={'overlay'}
> >
<Box px={4}> <AppCard appId={appId} />
<Flex alignItems={'center'} justifyContent={'space-between'}>
<Box fontSize={['md', 'xl']} fontWeight={'bold'}>
<PermissionIconText permission={appDetail.permission} />
</Box>
<Box color={'myGray.500'} fontSize={'sm'}>
AppId:{' '}
<Box as={'span'} userSelect={'all'}>
{appId}
</Box>
</Box>
</Flex>
{/* basic info */}
<Box
borderWidth={'1px'}
borderColor={'primary.1'}
borderRadius={'md'}
mt={2}
px={5}
py={4}
bg={'primary.50'}
position={'relative'}
>
<Flex alignItems={'center'} py={2}>
<Avatar src={appDetail.avatar} borderRadius={'md'} w={'28px'} />
<Box ml={3} fontWeight={'bold'} fontSize={'lg'}>
{appDetail.name}
</Box>
{appDetail.isOwner && (
<IconButton
className="delete"
position={'absolute'}
top={4}
right={4}
size={'smSquare'}
icon={<MyIcon name={'delete'} w={'14px'} />}
variant={'whiteDanger'}
borderRadius={'md'}
aria-label={'delete'}
isLoading={isLoading}
onClick={openConfirmDel(handleDelModel)}
/>
)}
</Flex>
<Box
flex={1}
my={2}
className={'textEllipsis3'}
wordBreak={'break-all'}
color={'myGray.600'}
>
{appDetail.intro || '快来给应用一个介绍~'}
</Box>
<Flex>
<Button
size={['sm', 'md']}
variant={'whitePrimary'}
leftIcon={<MyIcon name={'chat'} w={'16px'} />}
onClick={() => router.push(`/chat?appId=${appId}`)}
>
对话
</Button>
<Button
mx={3}
size={['sm', 'md']}
variant={'whitePrimary'}
leftIcon={<MyIcon name={'shareLight'} w={'16px'} />}
onClick={() => {
router.replace({
query: {
appId,
currentTab: 'outLink'
}
});
}}
>
外接
</Button>
{appDetail.isOwner && (
<Button
size={['sm', 'md']}
variant={'whitePrimary'}
leftIcon={<MyIcon name={'settingLight'} w={'16px'} />}
onClick={() => setSettingAppInfo(appDetail)}
>
设置
</Button>
)}
</Flex>
</Box>
</Box>
{/* config form */}
<ConfigForm divRef={divRef} isSticky={isSticky} />
<ConfirmDelModal />
{settingAppInfo && (
<InfoModal defaultApp={settingAppInfo} onClose={() => setSettingAppInfo(undefined)} />
)}
</Box>
);
}
function ChatTest({ appId }: { appId: string }) {
const { t } = useTranslation();
const { userInfo } = useUserStore();
const { appDetail } = useAppStore();
const ChatBoxRef = useRef<ComponentRef>(null);
const [modules, setModules] = useState<ModuleItemType[]>([]);
const startChat = useCallback(
async ({ chatList, controller, generatingMessage, variables }: StartChatFnProps) => {
let historyMaxLen = 0;
modules.forEach((module) => {
module.inputs.forEach((input) => {
if (
(input.key === ModuleInputKeyEnum.history ||
input.key === ModuleInputKeyEnum.historyMaxAmount) &&
typeof input.value === 'number'
) {
historyMaxLen = Math.max(historyMaxLen, input.value);
}
});
});
const history = chatList.slice(-historyMaxLen - 2, -2);
// 流请求,获取数据
const { responseText, responseData } = await streamFetch({
url: '/api/core/chat/chatTest',
data: {
history,
prompt: chatList[chatList.length - 2].value,
modules,
variables,
appId,
appName: `调试-${appDetail.name}`
},
onMessage: generatingMessage,
abortSignal: controller
});
return { responseText, responseData };
},
[modules, appId, appDetail.name]
);
const resetChatBox = useCallback(() => {
ChatBoxRef.current?.resetHistory([]);
ChatBoxRef.current?.resetVariables();
}, []);
useEffect(() => { <Box mt={2}>
resetChatBox(); <EditForm divRef={divRef} isSticky={isSticky} />
setModules(appDetail.modules);
}, [appDetail, resetChatBox]);
return (
<Flex
position={'relative'}
flexDirection={'column'}
h={'100%'}
py={4}
overflowX={'auto'}
bg={'white'}
>
<Flex px={[2, 5]}>
<Box fontSize={['md', 'xl']} fontWeight={'bold'} flex={1}>
{t('app.Chat Debug')}
</Box> </Box>
<MyTooltip label={t('core.chat.Restart')}>
<IconButton
className="chat"
size={'smSquare'}
icon={<MyIcon name={'clear'} w={'14px'} />}
variant={'whiteDanger'}
borderRadius={'md'}
aria-label={'delete'}
onClick={(e) => {
e.stopPropagation();
resetChatBox();
}}
/>
</MyTooltip>
</Flex>
<Box flex={1}>
<ChatBox
ref={ChatBoxRef}
appAvatar={appDetail.avatar}
userAvatar={userInfo?.avatar}
showMarkIcon
userGuideModule={getGuideModule(modules)}
showFileSelector={checkChatSupportSelectFileByModules(modules)}
onStartChat={startChat}
onDelMessage={() => {}}
/>
</Box> </Box>
{appDetail.type !== AppTypeEnum.simple && (
<Flex
position={'absolute'}
top={0}
right={0}
left={0}
bottom={0}
bg={'rgba(255,255,255,0.6)'}
alignItems={'center'}
justifyContent={'center'}
flexDirection={'column'}
fontSize={'lg'}
color={'black'}
whiteSpace={'pre-wrap'}
textAlign={'center'}
>
<Box>{t('app.Advance App TestTip')}</Box>
</Flex>
)}
</Flex>
);
}
const SimpleEdit = ({ appId }: { appId: string }) => {
const { isPc } = useSystemStore();
return (
<Grid gridTemplateColumns={['1fr', '550px 1fr']} h={'100%'}>
<Settings appId={appId} />
{isPc && <ChatTest appId={appId} />} {isPc && <ChatTest appId={appId} />}
</Grid> </Grid>
); );
}; };
export default SimpleEdit; export default React.memo(SimpleEdit);
...@@ -9,7 +9,7 @@ import { feConfigs } from '@/web/common/system/staticData'; ...@@ -9,7 +9,7 @@ import { feConfigs } from '@/web/common/system/staticData';
import Tabs from '@/components/Tabs'; import Tabs from '@/components/Tabs';
import SideTabs from '@/components/SideTabs'; import SideTabs from '@/components/SideTabs';
import Avatar from '@/components/Avatar'; import Avatar from '@/components/Avatar';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import PageContainer from '@/components/PageContainer'; import PageContainer from '@/components/PageContainer';
import Loading from '@/components/Loading'; import Loading from '@/components/Loading';
import SimpleEdit from './components/SimpleEdit'; import SimpleEdit from './components/SimpleEdit';
...@@ -52,13 +52,13 @@ const AppDetail = ({ currentTab }: { currentTab: `${TabEnum}` }) => { ...@@ -52,13 +52,13 @@ const AppDetail = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
const tabList = useMemo( const tabList = useMemo(
() => [ () => [
{ label: '简易配置', id: TabEnum.simpleEdit, icon: 'overviewLight' }, { label: '简易配置', id: TabEnum.simpleEdit, icon: 'common/overviewLight' },
...(feConfigs?.hide_app_flow ...(feConfigs?.hide_app_flow
? [] ? []
: [{ label: '高级编排', id: TabEnum.adEdit, icon: 'settingLight' }]), : [{ label: '高级编排', id: TabEnum.adEdit, icon: 'common/settingLight' }]),
{ label: '外部使用', id: TabEnum.outLink, icon: 'shareLight' }, { label: '外部使用', id: TabEnum.outLink, icon: 'support/outlink/shareLight' },
{ label: '对话日志', id: TabEnum.logs, icon: 'core/app/logsLight' }, { label: '对话日志', id: TabEnum.logs, icon: 'core/app/logsLight' },
{ label: '立即对话', id: TabEnum.startChat, icon: 'chat' } { label: '立即对话', id: TabEnum.startChat, icon: 'core/chat/chatLight' }
], ],
[] []
); );
...@@ -139,7 +139,7 @@ const AppDetail = ({ currentTab }: { currentTab: `${TabEnum}` }) => { ...@@ -139,7 +139,7 @@ const AppDetail = ({ currentTab }: { currentTab: `${TabEnum}` }) => {
> >
<IconButton <IconButton
mr={3} mr={3}
icon={<MyIcon name={'backFill'} w={'18px'} color={'primary.500'} />} icon={<MyIcon name={'common/backFill'} w={'18px'} color={'primary.500'} />}
bg={'white'} bg={'white'}
boxShadow={'1px 1px 9px rgba(0,0,0,0.15)'} boxShadow={'1px 1px 9px rgba(0,0,0,0.15)'}
size={'smSquare'} size={'smSquare'}
......
...@@ -19,7 +19,7 @@ import { useConfirm } from '@/web/common/hooks/useConfirm'; ...@@ -19,7 +19,7 @@ import { useConfirm } from '@/web/common/hooks/useConfirm';
import { serviceSideProps } from '@/web/common/utils/i18n'; import { serviceSideProps } from '@/web/common/utils/i18n';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import PageContainer from '@/components/PageContainer'; import PageContainer from '@/components/PageContainer';
import Avatar from '@/components/Avatar'; import Avatar from '@/components/Avatar';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
...@@ -164,7 +164,7 @@ const MyApps = () => { ...@@ -164,7 +164,7 @@ const MyApps = () => {
variant={'whitePrimary'} variant={'whitePrimary'}
icon={ icon={
<MyTooltip label={'去聊天'}> <MyTooltip label={'去聊天'}>
<MyIcon name={'chat'} w={'14px'} /> <MyIcon name={'core/chat/chatLight'} w={'14px'} />
</MyTooltip> </MyTooltip>
} }
aria-label={'chat'} aria-label={'chat'}
......
...@@ -2,7 +2,7 @@ import React from 'react'; ...@@ -2,7 +2,7 @@ import React from 'react';
import { Box, Flex, Button, Card } from '@chakra-ui/react'; import { Box, Flex, Button, Card } from '@chakra-ui/react';
import type { ShareAppItem } from '@/types/app'; import type { ShareAppItem } from '@/types/app';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import Avatar from '@/components/Avatar'; import Avatar from '@/components/Avatar';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
......
import React, { useMemo } from 'react'; import React, { useMemo } from 'react';
import { Flex, useTheme, Box } from '@chakra-ui/react'; import { Flex, useTheme, Box } from '@chakra-ui/react';
import { useSystemStore } from '@/web/common/system/useSystemStore'; import { useSystemStore } from '@/web/common/system/useSystemStore';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import Tag from '@/components/Tag'; import Tag from '@/components/Tag';
import Avatar from '@/components/Avatar'; import Avatar from '@/components/Avatar';
import ToolMenu from './ToolMenu'; import ToolMenu from './ToolMenu';
......
...@@ -15,7 +15,7 @@ import { useEditTitle } from '@/web/common/hooks/useEditTitle'; ...@@ -15,7 +15,7 @@ import { useEditTitle } from '@/web/common/hooks/useEditTitle';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import Avatar from '@/components/Avatar'; import Avatar from '@/components/Avatar';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { useConfirm } from '@/web/common/hooks/useConfirm'; import { useConfirm } from '@/web/common/hooks/useConfirm';
import Tabs from '@/components/Tabs'; import Tabs from '@/components/Tabs';
...@@ -156,7 +156,7 @@ const ChatHistorySlider = ({ ...@@ -156,7 +156,7 @@ const ChatHistorySlider = ({
h={'100%'} h={'100%'}
color={'primary.600'} color={'primary.600'}
borderRadius={'xl'} borderRadius={'xl'}
leftIcon={<MyIcon name={'chat'} w={'16px'} />} leftIcon={<MyIcon name={'core/chat/chatLight'} w={'16px'} />}
overflow={'hidden'} overflow={'hidden'}
onClick={() => onChangeChat()} onClick={() => onChangeChat()}
> >
...@@ -173,7 +173,7 @@ const ChatHistorySlider = ({ ...@@ -173,7 +173,7 @@ const ChatHistorySlider = ({
borderRadius={'50%'} borderRadius={'50%'}
onClick={openConfirm(onClearHistory)} onClick={openConfirm(onClearHistory)}
> >
<MyIcon name={'clear'} w={'16px'} /> <MyIcon name={'common/clearLight'} w={'16px'} />
</IconButton> </IconButton>
)} )}
</Flex> </Flex>
...@@ -211,7 +211,10 @@ const ChatHistorySlider = ({ ...@@ -211,7 +211,10 @@ const ChatHistorySlider = ({
} }
})} })}
> >
<MyIcon name={item.id === activeChatId ? 'chatFill' : 'chat'} w={'16px'} /> <MyIcon
name={item.id === activeChatId ? 'core/chat/chatFill' : 'core/chat/chatLight'}
w={'16px'}
/>
<Box flex={'1 0 0'} ml={3} className="textEllipsis"> <Box flex={'1 0 0'} ml={3} className="textEllipsis">
{item.customTitle || item.title} {item.customTitle || item.title}
</Box> </Box>
...@@ -236,7 +239,7 @@ const ChatHistorySlider = ({ ...@@ -236,7 +239,7 @@ const ChatHistorySlider = ({
onSetHistoryTop({ chatId: item.id, top: !item.top }); onSetHistoryTop({ chatId: item.id, top: !item.top });
}} }}
> >
<MyIcon mr={2} name={'setTop'} w={'16px'}></MyIcon> <MyIcon mr={2} name={'core/chat/setTopLight'} w={'16px'}></MyIcon>
{item.top ? '取消置顶' : '置顶'} {item.top ? '取消置顶' : '置顶'}
</MenuItem> </MenuItem>
)} )}
...@@ -254,7 +257,7 @@ const ChatHistorySlider = ({ ...@@ -254,7 +257,7 @@ const ChatHistorySlider = ({
}); });
}} }}
> >
<MyIcon mr={2} name={'customTitle'} w={'16px'}></MyIcon> <MyIcon mr={2} name={'common/customTitleLight'} w={'16px'}></MyIcon>
{t('common.Custom Title')} {t('common.Custom Title')}
</MenuItem> </MenuItem>
)} )}
...@@ -326,7 +329,7 @@ const ChatHistorySlider = ({ ...@@ -326,7 +329,7 @@ const ChatHistorySlider = ({
> >
<IconButton <IconButton
mr={3} mr={3}
icon={<MyIcon name={'backFill'} w={'18px'} color={'primary.500'} />} icon={<MyIcon name={'common/backFill'} w={'18px'} color={'primary.500'} />}
bg={'white'} bg={'white'}
boxShadow={'1px 1px 9px rgba(0,0,0,0.15)'} boxShadow={'1px 1px 9px rgba(0,0,0,0.15)'}
size={'smSquare'} size={'smSquare'}
......
...@@ -3,7 +3,7 @@ import { Flex, Box, IconButton } from '@chakra-ui/react'; ...@@ -3,7 +3,7 @@ import { Flex, Box, IconButton } from '@chakra-ui/react';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import Avatar from '@/components/Avatar'; import Avatar from '@/components/Avatar';
import { useAppStore } from '@/web/core/app/store/useAppStore'; import { useAppStore } from '@/web/core/app/store/useAppStore';
...@@ -28,7 +28,7 @@ const SliderApps = ({ appId }: { appId: string }) => { ...@@ -28,7 +28,7 @@ const SliderApps = ({ appId }: { appId: string }) => {
> >
<IconButton <IconButton
mr={3} mr={3}
icon={<MyIcon name={'backFill'} w={'18px'} color={'primary.500'} />} icon={<MyIcon name={'common/backFill'} w={'18px'} color={'primary.500'} />}
bg={'white'} bg={'white'}
boxShadow={'1px 1px 9px rgba(0,0,0,0.15)'} boxShadow={'1px 1px 9px rgba(0,0,0,0.15)'}
size={'smSquare'} size={'smSquare'}
......
...@@ -2,7 +2,7 @@ import React, { useMemo } from 'react'; ...@@ -2,7 +2,7 @@ import React, { useMemo } from 'react';
import { useChatBox } from '@/components/ChatBox'; import { useChatBox } from '@/components/ChatBox';
import type { ChatItemType } from '@fastgpt/global/core/chat/type.d'; import type { ChatItemType } from '@fastgpt/global/core/chat/type.d';
import { Menu, MenuButton, MenuList, MenuItem, Box } from '@chakra-ui/react'; import { Menu, MenuButton, MenuList, MenuItem, Box } from '@chakra-ui/react';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
const ToolMenu = ({ history }: { history: ChatItemType[] }) => { const ToolMenu = ({ history }: { history: ChatItemType[] }) => {
...@@ -12,7 +12,7 @@ const ToolMenu = ({ history }: { history: ChatItemType[] }) => { ...@@ -12,7 +12,7 @@ const ToolMenu = ({ history }: { history: ChatItemType[] }) => {
const menuList = useMemo( const menuList = useMemo(
() => [ () => [
{ {
icon: 'chat', icon: 'core/chat/chatLight',
label: '新对话', label: '新对话',
onClick: () => { onClick: () => {
router.replace({ router.replace({
...@@ -24,16 +24,16 @@ const ToolMenu = ({ history }: { history: ChatItemType[] }) => { ...@@ -24,16 +24,16 @@ const ToolMenu = ({ history }: { history: ChatItemType[] }) => {
} }
}, },
{ {
icon: 'apiLight', icon: 'core/app/appApiLight',
label: 'HTML导出', label: 'HTML导出',
onClick: () => onExportChat({ type: 'html', history }) onClick: () => onExportChat({ type: 'html', history })
}, },
{ {
icon: 'markdown', icon: 'file/markdown',
label: 'Markdown导出', label: 'Markdown导出',
onClick: () => onExportChat({ type: 'md', history }) onClick: () => onExportChat({ type: 'md', history })
}, },
{ icon: 'pdf', label: 'PDF导出', onClick: () => onExportChat({ type: 'pdf', history }) } { icon: 'file/pdf', label: 'PDF导出', onClick: () => onExportChat({ type: 'pdf', history }) }
], ],
[history, onExportChat, router] [history, onExportChat, router]
); );
......
...@@ -28,7 +28,7 @@ import { useQuery } from '@tanstack/react-query'; ...@@ -28,7 +28,7 @@ import { useQuery } from '@tanstack/react-query';
import { debounce } from 'lodash'; import { debounce } from 'lodash';
import { useConfirm } from '@/web/common/hooks/useConfirm'; import { useConfirm } from '@/web/common/hooks/useConfirm';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import MyInput from '@/components/MyInput'; import MyInput from '@/components/MyInput';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { useRequest } from '@/web/common/hooks/useRequest'; import { useRequest } from '@/web/common/hooks/useRequest';
...@@ -386,7 +386,7 @@ const CollectionCard = () => { ...@@ -386,7 +386,7 @@ const CollectionCard = () => {
color={'white'} color={'white'}
h={['28px', '35px']} h={['28px', '35px']}
> >
<MyIcon name={'importLight'} mr={2} w={'14px'} /> <MyIcon name={'common/importLight'} mr={2} w={'14px'} />
<Box>{t('dataset.collections.Create And Import')}</Box> <Box>{t('dataset.collections.Create And Import')}</Box>
</Flex> </Flex>
</MenuButton> </MenuButton>
......
...@@ -29,7 +29,7 @@ import { getErrText } from '@fastgpt/global/common/error/utils'; ...@@ -29,7 +29,7 @@ import { getErrText } from '@fastgpt/global/common/error/utils';
import { useConfirm } from '@/web/common/hooks/useConfirm'; import { useConfirm } from '@/web/common/hooks/useConfirm';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import MyInput from '@/components/MyInput'; import MyInput from '@/components/MyInput';
import { useLoading } from '@/web/common/hooks/useLoading'; import { useLoading } from '@/web/common/hooks/useLoading';
import InputDataModal, { RawSourceText, type InputDataType } from '../components/InputDataModal'; import InputDataModal, { RawSourceText, type InputDataType } from '../components/InputDataModal';
...@@ -167,7 +167,7 @@ const DataCard = () => { ...@@ -167,7 +167,7 @@ const DataCard = () => {
<Flex alignItems={'center'}> <Flex alignItems={'center'}>
<IconButton <IconButton
mr={3} mr={3}
icon={<MyIcon name={'backFill'} w={['14px', '18px']} color={'primary.500'} />} icon={<MyIcon name={'common/backFill'} w={['14px', '18px']} color={'primary.500'} />}
variant={'whitePrimary'} variant={'whitePrimary'}
size={'smSquare'} size={'smSquare'}
borderRadius={'50%'} borderRadius={'50%'}
......
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { useLoading } from '@/web/common/hooks/useLoading'; import { useLoading } from '@/web/common/hooks/useLoading';
import { useSelectFile } from '@/web/common/file/hooks/useSelectFile'; import { useSelectFile } from '@/web/common/file/hooks/useSelectFile';
import { useToast } from '@/web/common/hooks/useToast'; import { useToast } from '@/web/common/hooks/useToast';
...@@ -392,7 +392,7 @@ const FileSelect = ({ ...@@ -392,7 +392,7 @@ const FileSelect = ({
onDrop={handleDrop} onDrop={handleDrop}
> >
<Flex justifyContent={'center'} alignItems={'center'}> <Flex justifyContent={'center'} alignItems={'center'}>
<MyIcon mr={1} name={'uploadFile'} w={'16px'} /> <MyIcon mr={1} name={'file/uploadFile'} w={'16px'} />
{isDragging ? ( {isDragging ? (
t('file.Release the mouse to upload the file') t('file.Release the mouse to upload the file')
) : ( ) : (
......
...@@ -98,19 +98,19 @@ const ImportData = ({ ...@@ -98,19 +98,19 @@ const ImportData = ({
gridTemplateColumns={['repeat(1,1fr)', 'repeat(3,1fr)']} gridTemplateColumns={['repeat(1,1fr)', 'repeat(3,1fr)']}
list={[ list={[
{ {
icon: 'indexImport', icon: 'file/indexImport',
title: t('core.dataset.import.Chunk Split'), title: t('core.dataset.import.Chunk Split'),
desc: t('core.dataset.import.Chunk Split Tip'), desc: t('core.dataset.import.Chunk Split Tip'),
value: ImportTypeEnum.chunk value: ImportTypeEnum.chunk
}, },
{ {
icon: 'qaImport', icon: 'file/qaImport',
title: t('core.dataset.import.QA Import'), title: t('core.dataset.import.QA Import'),
desc: t('core.dataset.import.QA Import Tip'), desc: t('core.dataset.import.QA Import Tip'),
value: ImportTypeEnum.qa value: ImportTypeEnum.qa
}, },
{ {
icon: 'csvImport', icon: 'file/csv',
title: t('core.dataset.import.CSV Import'), title: t('core.dataset.import.CSV Import'),
desc: t('core.dataset.import.CSV Import Tip'), desc: t('core.dataset.import.CSV Import Tip'),
value: ImportTypeEnum.csv value: ImportTypeEnum.csv
......
...@@ -22,8 +22,8 @@ import { ...@@ -22,8 +22,8 @@ import {
} from '@fastgpt/global/core/dataset/constant'; } from '@fastgpt/global/core/dataset/constant';
import { Box, Flex, Image, useTheme } from '@chakra-ui/react'; import { Box, Flex, Image, useTheme } from '@chakra-ui/react';
import { CloseIcon } from '@chakra-ui/icons'; import { CloseIcon } from '@chakra-ui/icons';
import DeleteIcon, { hoverDeleteStyles } from '@/components/Icon/delete'; import DeleteIcon, { hoverDeleteStyles } from '@fastgpt/web/components/common/Icon/delete';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { chunksUpload } from '@/web/core/dataset/utils'; import { chunksUpload } from '@/web/core/dataset/utils';
import { postCreateTrainingBill } from '@/web/support/wallet/bill/api'; import { postCreateTrainingBill } from '@/web/support/wallet/bill/api';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
......
...@@ -9,7 +9,7 @@ import { ...@@ -9,7 +9,7 @@ import {
} from '@/web/core/dataset/api'; } from '@/web/core/dataset/api';
import { useToast } from '@/web/common/hooks/useToast'; import { useToast } from '@/web/common/hooks/useToast';
import { getErrText } from '@fastgpt/global/common/error/utils'; import { getErrText } from '@fastgpt/global/common/error/utils';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import MyModal from '@/components/MyModal'; import MyModal from '@/components/MyModal';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
import { QuestionOutlineIcon } from '@chakra-ui/icons'; import { QuestionOutlineIcon } from '@chakra-ui/icons';
...@@ -26,7 +26,7 @@ import { DatasetDataIndexTypeEnum } from '@fastgpt/global/core/dataset/constant' ...@@ -26,7 +26,7 @@ import { DatasetDataIndexTypeEnum } from '@fastgpt/global/core/dataset/constant'
import { DatasetDataIndexItemType } from '@fastgpt/global/core/dataset/type'; import { DatasetDataIndexItemType } from '@fastgpt/global/core/dataset/type';
import SideTabs from '@/components/SideTabs'; import SideTabs from '@/components/SideTabs';
import { useLoading } from '@/web/common/hooks/useLoading'; import { useLoading } from '@/web/common/hooks/useLoading';
import DeleteIcon from '@/components/Icon/delete'; import DeleteIcon from '@fastgpt/web/components/common/Icon/delete';
import { defaultCollectionDetail } from '@/constants/dataset'; import { defaultCollectionDetail } from '@/constants/dataset';
import { getDocPath } from '@/web/common/system/doc'; import { getDocPath } from '@/web/common/system/doc';
...@@ -83,7 +83,7 @@ const InputDataModal = ({ ...@@ -83,7 +83,7 @@ const InputDataModal = ({
}); });
const tabList = [ const tabList = [
{ label: t('dataset.data.edit.Content'), id: TabEnum.content, icon: 'overviewLight' }, { label: t('dataset.data.edit.Content'), id: TabEnum.content, icon: 'common/overviewLight' },
{ {
label: t('dataset.data.edit.Index', { amount: indexes.length }), label: t('dataset.data.edit.Index', { amount: indexes.length }),
id: TabEnum.index, id: TabEnum.index,
......
...@@ -18,7 +18,7 @@ import { ...@@ -18,7 +18,7 @@ import {
import { useDatasetStore } from '@/web/core/dataset/store/dataset'; import { useDatasetStore } from '@/web/core/dataset/store/dataset';
import { useSearchTestStore, SearchTestStoreItemType } from '@/web/core/dataset/store/searchTest'; import { useSearchTestStore, SearchTestStoreItemType } from '@/web/core/dataset/store/searchTest';
import { postSearchText } from '@/web/core/dataset/api'; import { postSearchText } from '@/web/core/dataset/api';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { useRequest } from '@/web/common/hooks/useRequest'; import { useRequest } from '@/web/common/hooks/useRequest';
import { formatTimeToChatTime } from '@/utils/tools'; import { formatTimeToChatTime } from '@/utils/tools';
import { getErrText } from '@fastgpt/global/common/error/utils'; import { getErrText } from '@fastgpt/global/common/error/utils';
...@@ -190,7 +190,7 @@ const Test = ({ datasetId }: { datasetId: string }) => { ...@@ -190,7 +190,7 @@ const Test = ({ datasetId }: { datasetId: string }) => {
// { // {
// label: ( // label: (
// <Flex alignItems={'center'}> // <Flex alignItems={'center'}>
// <MyIcon mr={2} name={'csvImport'} w={'14px'} color={'primary.600'} /> // <MyIcon mr={2} name={'file/csv'} w={'14px'} color={'primary.600'} />
// <Box fontSize={'sm'} fontWeight={'bold'} flex={1}> // <Box fontSize={'sm'} fontWeight={'bold'} flex={1}>
// {t('core.dataset.test.Batch test')} // {t('core.dataset.test.Batch test')}
// </Box> // </Box>
...@@ -244,7 +244,7 @@ const Test = ({ datasetId }: { datasetId: string }) => { ...@@ -244,7 +244,7 @@ const Test = ({ datasetId }: { datasetId: string }) => {
}} }}
onClick={onOpen} onClick={onOpen}
> >
<MyIcon mr={2} name={'csvImport'} w={'24px'} /> <MyIcon mr={2} name={'file/csv'} w={'24px'} />
<Box> <Box>
{selectFile ? selectFile.name : t('core.dataset.test.Batch test Placeholder')} {selectFile ? selectFile.name : t('core.dataset.test.Batch test Placeholder')}
</Box> </Box>
......
...@@ -7,7 +7,7 @@ import { getErrText } from '@fastgpt/global/common/error/utils'; ...@@ -7,7 +7,7 @@ import { getErrText } from '@fastgpt/global/common/error/utils';
import { useSystemStore } from '@/web/common/system/useSystemStore'; import { useSystemStore } from '@/web/common/system/useSystemStore';
import Tabs from '@/components/Tabs'; import Tabs from '@/components/Tabs';
import dynamic from 'next/dynamic'; import dynamic from 'next/dynamic';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import SideTabs from '@/components/SideTabs'; import SideTabs from '@/components/SideTabs';
import PageContainer from '@/components/PageContainer'; import PageContainer from '@/components/PageContainer';
import Avatar from '@/components/Avatar'; import Avatar from '@/components/Avatar';
...@@ -54,10 +54,10 @@ const Detail = ({ datasetId, currentTab }: { datasetId: string; currentTab: `${T ...@@ -54,10 +54,10 @@ const Detail = ({ datasetId, currentTab }: { datasetId: string; currentTab: `${T
const { userInfo } = useUserStore(); const { userInfo } = useUserStore();
const tabList = [ const tabList = [
{ label: t('core.dataset.Dataset'), id: TabEnum.collectionCard, icon: 'overviewLight' }, { label: t('core.dataset.Dataset'), id: TabEnum.collectionCard, icon: 'common/overviewLight' },
{ label: t('core.dataset.test.Search Test'), id: TabEnum.test, icon: 'kbTest' }, { label: t('core.dataset.test.Search Test'), id: TabEnum.test, icon: 'kbTest' },
...(userInfo?.team.canWrite && datasetDetail.isOwner ...(userInfo?.team.canWrite && datasetDetail.isOwner
? [{ label: t('common.Config'), id: TabEnum.info, icon: 'settingLight' }] ? [{ label: t('common.Config'), id: TabEnum.info, icon: 'common/settingLight' }]
: []) : [])
]; ];
...@@ -240,7 +240,7 @@ const Detail = ({ datasetId, currentTab }: { datasetId: string; currentTab: `${T ...@@ -240,7 +240,7 @@ const Detail = ({ datasetId, currentTab }: { datasetId: string; currentTab: `${T
> >
<IconButton <IconButton
mr={3} mr={3}
icon={<MyIcon name={'backFill'} w={'18px'} color={'primary.500'} />} icon={<MyIcon name={'common/backFill'} w={'18px'} color={'primary.500'} />}
bg={'white'} bg={'white'}
boxShadow={'1px 1px 9px rgba(0,0,0,0.15)'} boxShadow={'1px 1px 9px rgba(0,0,0,0.15)'}
size={'smSquare'} size={'smSquare'}
......
...@@ -13,7 +13,7 @@ import { ...@@ -13,7 +13,7 @@ import {
import Avatar from '@/components/Avatar'; import Avatar from '@/components/Avatar';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
import MyModal from '@/components/MyModal'; import MyModal from '@/components/MyModal';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { DatasetTypeEnum } from '@fastgpt/global/core/dataset/constant'; import { DatasetTypeEnum } from '@fastgpt/global/core/dataset/constant';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { useQuery } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query';
......
...@@ -25,7 +25,7 @@ import { ...@@ -25,7 +25,7 @@ import {
} from '@/web/core/dataset/api'; } from '@/web/core/dataset/api';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import Avatar from '@/components/Avatar'; import Avatar from '@/components/Avatar';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { serviceSideProps } from '@/web/common/utils/i18n'; import { serviceSideProps } from '@/web/common/utils/i18n';
import dynamic from 'next/dynamic'; import dynamic from 'next/dynamic';
import { import {
......
...@@ -19,7 +19,7 @@ import type { ResLogin } from '@/global/support/api/userRes'; ...@@ -19,7 +19,7 @@ import type { ResLogin } from '@/global/support/api/userRes';
import { useToast } from '@/web/common/hooks/useToast'; import { useToast } from '@/web/common/hooks/useToast';
import { feConfigs } from '@/web/common/system/staticData'; import { feConfigs } from '@/web/common/system/staticData';
import { useSystemStore } from '@/web/common/system/useSystemStore'; import { useSystemStore } from '@/web/common/system/useSystemStore';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { customAlphabet } from 'nanoid'; import { customAlphabet } from 'nanoid';
import { getDocPath } from '@/web/common/system/doc'; import { getDocPath } from '@/web/common/system/doc';
import Avatar from '@/components/Avatar'; import Avatar from '@/components/Avatar';
...@@ -86,7 +86,7 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => { ...@@ -86,7 +86,7 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => {
{ {
label: t('support.user.login.Github'), label: t('support.user.login.Github'),
provider: OAuthEnum.github, provider: OAuthEnum.github,
icon: 'gitFill', icon: 'common/gitFill',
redirectUrl: `https://github.com/login/oauth/authorize?client_id=${feConfigs?.oauth?.github}&redirect_uri=${redirectUri}&state=${state.current}&scope=user:email%20read:user` redirectUrl: `https://github.com/login/oauth/authorize?client_id=${feConfigs?.oauth?.github}&redirect_uri=${redirectUri}&state=${state.current}&scope=user:email%20read:user`
} }
] ]
...@@ -96,7 +96,7 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => { ...@@ -96,7 +96,7 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => {
{ {
label: t('support.user.login.Google'), label: t('support.user.login.Google'),
provider: OAuthEnum.google, provider: OAuthEnum.google,
icon: 'googleFill', icon: 'common/googleFill',
redirectUrl: `https://accounts.google.com/o/oauth2/v2/auth?client_id=${feConfigs?.oauth?.google}&redirect_uri=${redirectUri}&state=${state.current}&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email%20openid&include_granted_scopes=true` redirectUrl: `https://accounts.google.com/o/oauth2/v2/auth?client_id=${feConfigs?.oauth?.google}&redirect_uri=${redirectUri}&state=${state.current}&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email%20openid&include_granted_scopes=true`
} }
] ]
......
...@@ -5,7 +5,7 @@ import { useRequest } from '@/web/common/hooks/useRequest'; ...@@ -5,7 +5,7 @@ import { useRequest } from '@/web/common/hooks/useRequest';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { useCopyData } from '@/web/common/hooks/useCopyData'; import { useCopyData } from '@/web/common/hooks/useCopyData';
import dynamic from 'next/dynamic'; import dynamic from 'next/dynamic';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import MyTooltip from '@/components/MyTooltip'; import MyTooltip from '@/components/MyTooltip';
import { getFlowStore } from '@/components/core/module/Flow/FlowProvider'; import { getFlowStore } from '@/components/core/module/Flow/FlowProvider';
import { filterExportModules, flowNode2Modules } from '@/components/core/module/utils'; import { filterExportModules, flowNode2Modules } from '@/components/core/module/utils';
...@@ -123,7 +123,7 @@ const Header = ({ plugin, onClose }: Props) => { ...@@ -123,7 +123,7 @@ const Header = ({ plugin, onClose }: Props) => {
<MyTooltip label={t('common.Back')} offset={[10, 10]}> <MyTooltip label={t('common.Back')} offset={[10, 10]}>
<IconButton <IconButton
size={'smSquare'} size={'smSquare'}
icon={<MyIcon name={'back'} w={'14px'} />} icon={<MyIcon name={'common/backLight'} w={'14px'} />}
variant={'whiteBase'} variant={'whiteBase'}
aria-label={''} aria-label={''}
onClick={() => { onClick={() => {
...@@ -138,7 +138,7 @@ const Header = ({ plugin, onClose }: Props) => { ...@@ -138,7 +138,7 @@ const Header = ({ plugin, onClose }: Props) => {
<MyTooltip label={t('app.Import Configs')}> <MyTooltip label={t('app.Import Configs')}>
<IconButton <IconButton
mr={[3, 6]} mr={[3, 6]}
icon={<MyIcon name={'importLight'} w={['14px', '16px']} />} icon={<MyIcon name={'common/importLight'} w={['14px', '16px']} />}
variant={'whitePrimary'} variant={'whitePrimary'}
size={'smSquare'} size={'smSquare'}
aria-label={'save'} aria-label={'save'}
...@@ -163,7 +163,7 @@ const Header = ({ plugin, onClose }: Props) => { ...@@ -163,7 +163,7 @@ const Header = ({ plugin, onClose }: Props) => {
<MyTooltip label={t('module.Preview Plugin')}> <MyTooltip label={t('module.Preview Plugin')}>
<IconButton <IconButton
mr={[3, 6]} mr={[3, 6]}
icon={<MyIcon name={'core/module/previewLight'} w={['14px', '16px']} />} icon={<MyIcon name={'core/modules/previewLight'} w={['14px', '16px']} />}
size={'smSquare'} size={'smSquare'}
aria-label={'save'} aria-label={'save'}
variant={'whitePrimary'} variant={'whitePrimary'}
......
...@@ -14,7 +14,7 @@ import MyTooltip from '@/components/MyTooltip'; ...@@ -14,7 +14,7 @@ import MyTooltip from '@/components/MyTooltip';
import MyModal from '@/components/MyModal'; import MyModal from '@/components/MyModal';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { useConfirm } from '@/web/common/hooks/useConfirm'; import { useConfirm } from '@/web/common/hooks/useConfirm';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { CreateOnePluginParams } from '@fastgpt/global/core/plugin/controller'; import { CreateOnePluginParams } from '@fastgpt/global/core/plugin/controller';
import { customAlphabet } from 'nanoid'; import { customAlphabet } from 'nanoid';
const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz1234567890', 12); const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz1234567890', 12);
......
...@@ -6,7 +6,7 @@ import { AddIcon } from '@chakra-ui/icons'; ...@@ -6,7 +6,7 @@ import { AddIcon } from '@chakra-ui/icons';
import { serviceSideProps } from '@/web/common/utils/i18n'; import { serviceSideProps } from '@/web/common/utils/i18n';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import PageContainer from '@/components/PageContainer'; import PageContainer from '@/components/PageContainer';
import Avatar from '@/components/Avatar'; import Avatar from '@/components/Avatar';
import EditModal, { defaultForm, FormType } from './component/EditModal'; import EditModal, { defaultForm, FormType } from './component/EditModal';
......
import React from 'react'; import React from 'react';
import { Box, Flex } from '@chakra-ui/react'; import { Box, Flex } from '@chakra-ui/react';
import { ChevronRightIcon } from '@chakra-ui/icons'; import { ChevronRightIcon } from '@chakra-ui/icons';
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import { feConfigs } from '@/web/common/system/staticData'; import { feConfigs } from '@/web/common/system/staticData';
import { serviceSideProps } from '@/web/common/utils/i18n'; import { serviceSideProps } from '@/web/common/utils/i18n';
...@@ -13,19 +13,10 @@ const Tools = () => { ...@@ -13,19 +13,10 @@ const Tools = () => {
const router = useRouter(); const router = useRouter();
const list = [ const list = [
{ {
icon: 'dbLight', icon: 'core/dataset/datasetLight',
label: '我的知识库', label: '我的知识库',
link: '/dataset/list' link: '/dataset/list'
}, },
...(feConfigs?.show_appStore
? [
{
icon: 'appStoreLight',
label: 'AI应用市场',
link: '/appStore'
}
]
: []),
{ {
icon: 'common/navbar/pluginLight', icon: 'common/navbar/pluginLight',
label: '自定义模块', label: '自定义模块',
...@@ -34,7 +25,7 @@ const Tools = () => { ...@@ -34,7 +25,7 @@ const Tools = () => {
...(feConfigs?.show_git ...(feConfigs?.show_git
? [ ? [
{ {
icon: 'git', icon: 'common/gitLight',
label: 'GitHub 地址', label: 'GitHub 地址',
link: 'https://github.com/labring/FastGPT' link: 'https://github.com/labring/FastGPT'
} }
......
...@@ -26,7 +26,9 @@ export const dispatchCFR = async ({ ...@@ -26,7 +26,9 @@ export const dispatchCFR = async ({
return Promise.reject('Question is empty'); return Promise.reject('Question is empty');
} }
if (histories.length === 0 && !systemPrompt) { // none
// first chat and no system prompt
if (systemPrompt === 'none' || (histories.length === 0 && !systemPrompt)) {
return { return {
[ModuleOutputKeyEnum.text]: userChatInput [ModuleOutputKeyEnum.text]: userChatInput
}; };
......
import MyIcon from '@/components/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import MyModal from '@/components/MyModal'; import MyModal from '@/components/MyModal';
import ParentPaths from '@/components/common/ParentPaths'; import ParentPaths from '@/components/common/ParentPaths';
import { useLoading } from '@/web/common/hooks/useLoading'; import { useLoading } from '@/web/common/hooks/useLoading';
......
const path = require('path');
const fs = require('fs');
const express = require('express');
function findSvgFiles(dir, relativePath = '') {
let svgFiles = [];
const items = fs.readdirSync(dir, { withFileTypes: true });
for (const item of items) {
const fullPath = path.resolve(dir, item.name);
const relativeItemPath = path.join(relativePath, item.name);
if (item.isDirectory()) {
const nestedSvgs = findSvgFiles(fullPath, relativeItemPath);
svgFiles = svgFiles.concat(nestedSvgs);
} else if (item.isFile() && item.name.endsWith('.svg')) {
svgFiles.push(relativeItemPath);
}
}
return svgFiles;
}
const svgDir = path.resolve(__dirname, '../../packages/web/components/common/Icon/icons');
const svgPaths = findSvgFiles(svgDir);
const app = express();
app.use('/icons', express.static(svgDir));
app.get('/', (req, res) => {
let iconHtml = ``;
svgPaths.forEach((filePath) => {
const name = filePath.split('.')[0];
iconHtml += `<div class="item" id="${name}" onclick="onclickCopy(${name})">
<img src="/icons/${filePath}" width="30" height="30" />
<div>${name}</div>
</div>`;
});
const html = `
<html><head><title>SVG Icons</title></head>
<style>
* {
box-sizing: border-box;
}
.grid {
display: grid;
grid-gap: 10px;
grid-template-columns: repeat(6, 1fr);
padding: 10px;
background-color: #F0F1F6;
}
.item {
width: 100%;
height: 100%;
text-align: center;
border: 1px solid #DFE2EA;
padding: 10px 5px;
border-radius: 6px;
cursor: pointer;
font-size: 14px;
}
.item:hover{
background-color: rgba(17, 24, 36, 0.1);
}
img {
margin-bottom: 5px;
}
</style>
<body>
<div class="grid">
${iconHtml}
</div>
</body>
<script>
const onclickCopy = (name) => {
console.log(name.id)
try {
if (navigator.clipboard) {
navigator.clipboard.writeText(name.id);
} else {
throw new Error('');
}
} catch (error) {
const textarea = document.createElement('textarea');
textarea.value = name.id;
document.body.appendChild(textarea);
textarea.select();
document.execCommand('copy');
document.body?.removeChild(textarea);
}
};
</script>
</html>
`;
res.send(html);
});
const PORT = process.env.PORT || 3005;
app.listen(PORT, () => {
console.log(`Preview icons server running at http://localhost:${PORT}`);
});
const path = require('path');
const fs = require('fs');
// 递归读取 packages/web/components/common/Icon/icons 下所有的 svg
function findSvgFiles(dir, relativePath = '') {
let svgFiles = [];
const items = fs.readdirSync(dir, { withFileTypes: true });
for (const item of items) {
const fullPath = path.join(dir, item.name);
const relativeItemPath = path.join(relativePath, item.name);
if (item.isDirectory()) {
const nestedSvgs = findSvgFiles(fullPath, relativeItemPath);
svgFiles = svgFiles.concat(nestedSvgs);
} else if (item.isFile() && item.name.endsWith('.svg')) {
svgFiles.push(relativeItemPath);
}
}
return svgFiles;
}
const svgPaths = findSvgFiles(`${__dirname}/../../packages/web/components/common/Icon/icons`);
let result = ``;
svgPaths.forEach((path) => {
const name = path.split('.')[0];
result += ` '${name}': () => import('./icons/${path}'),\n`;
});
// 把 result 结果写入 '../../packages/web/components/common/Icon/constants'
fs.writeFileSync(
`${__dirname}/../../packages/web/components/common/Icon/constants.ts`,
`// @ts-nocheck
export const iconPaths = {
${result}
};`
);
{
"name": "icon",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "icon",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"express": "^4.18.2"
}
},
"node_modules/accepts": {
"version": "1.3.8",
"resolved": "https://registry.npmmirror.com/accepts/-/accepts-1.3.8.tgz",
"integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
"dependencies": {
"mime-types": "~2.1.34",
"negotiator": "0.6.3"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npmmirror.com/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
},
"node_modules/body-parser": {
"version": "1.20.1",
"resolved": "https://registry.npmmirror.com/body-parser/-/body-parser-1.20.1.tgz",
"integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==",
"dependencies": {
"bytes": "3.1.2",
"content-type": "~1.0.4",
"debug": "2.6.9",
"depd": "2.0.0",
"destroy": "1.2.0",
"http-errors": "2.0.0",
"iconv-lite": "0.4.24",
"on-finished": "2.4.1",
"qs": "6.11.0",
"raw-body": "2.5.1",
"type-is": "~1.6.18",
"unpipe": "1.0.0"
},
"engines": {
"node": ">= 0.8",
"npm": "1.2.8000 || >= 1.4.16"
}
},
"node_modules/bytes": {
"version": "3.1.2",
"resolved": "https://registry.npmmirror.com/bytes/-/bytes-3.1.2.tgz",
"integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/call-bind": {
"version": "1.0.5",
"resolved": "https://registry.npmmirror.com/call-bind/-/call-bind-1.0.5.tgz",
"integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==",
"dependencies": {
"function-bind": "^1.1.2",
"get-intrinsic": "^1.2.1",
"set-function-length": "^1.1.1"
}
},
"node_modules/content-disposition": {
"version": "0.5.4",
"resolved": "https://registry.npmmirror.com/content-disposition/-/content-disposition-0.5.4.tgz",
"integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
"dependencies": {
"safe-buffer": "5.2.1"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/content-type": {
"version": "1.0.5",
"resolved": "https://registry.npmmirror.com/content-type/-/content-type-1.0.5.tgz",
"integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/cookie": {
"version": "0.5.0",
"resolved": "https://registry.npmmirror.com/cookie/-/cookie-0.5.0.tgz",
"integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/cookie-signature": {
"version": "1.0.6",
"resolved": "https://registry.npmmirror.com/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
},
"node_modules/debug": {
"version": "2.6.9",
"resolved": "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dependencies": {
"ms": "2.0.0"
}
},
"node_modules/define-data-property": {
"version": "1.1.1",
"resolved": "https://registry.npmmirror.com/define-data-property/-/define-data-property-1.1.1.tgz",
"integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==",
"dependencies": {
"get-intrinsic": "^1.2.1",
"gopd": "^1.0.1",
"has-property-descriptors": "^1.0.0"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/depd": {
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/depd/-/depd-2.0.0.tgz",
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/destroy": {
"version": "1.2.0",
"resolved": "https://registry.npmmirror.com/destroy/-/destroy-1.2.0.tgz",
"integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
"engines": {
"node": ">= 0.8",
"npm": "1.2.8000 || >= 1.4.16"
}
},
"node_modules/ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmmirror.com/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
},
"node_modules/encodeurl": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/encodeurl/-/encodeurl-1.0.2.tgz",
"integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/escape-html/-/escape-html-1.0.3.tgz",
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
},
"node_modules/etag": {
"version": "1.8.1",
"resolved": "https://registry.npmmirror.com/etag/-/etag-1.8.1.tgz",
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/express": {
"version": "4.18.2",
"resolved": "https://registry.npmmirror.com/express/-/express-4.18.2.tgz",
"integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==",
"dependencies": {
"accepts": "~1.3.8",
"array-flatten": "1.1.1",
"body-parser": "1.20.1",
"content-disposition": "0.5.4",
"content-type": "~1.0.4",
"cookie": "0.5.0",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "2.0.0",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"finalhandler": "1.2.0",
"fresh": "0.5.2",
"http-errors": "2.0.0",
"merge-descriptors": "1.0.1",
"methods": "~1.1.2",
"on-finished": "2.4.1",
"parseurl": "~1.3.3",
"path-to-regexp": "0.1.7",
"proxy-addr": "~2.0.7",
"qs": "6.11.0",
"range-parser": "~1.2.1",
"safe-buffer": "5.2.1",
"send": "0.18.0",
"serve-static": "1.15.0",
"setprototypeof": "1.2.0",
"statuses": "2.0.1",
"type-is": "~1.6.18",
"utils-merge": "1.0.1",
"vary": "~1.1.2"
},
"engines": {
"node": ">= 0.10.0"
}
},
"node_modules/finalhandler": {
"version": "1.2.0",
"resolved": "https://registry.npmmirror.com/finalhandler/-/finalhandler-1.2.0.tgz",
"integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==",
"dependencies": {
"debug": "2.6.9",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"on-finished": "2.4.1",
"parseurl": "~1.3.3",
"statuses": "2.0.1",
"unpipe": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/forwarded": {
"version": "0.2.0",
"resolved": "https://registry.npmmirror.com/forwarded/-/forwarded-0.2.0.tgz",
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/fresh": {
"version": "0.5.2",
"resolved": "https://registry.npmmirror.com/fresh/-/fresh-0.5.2.tgz",
"integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/function-bind": {
"version": "1.1.2",
"resolved": "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz",
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="
},
"node_modules/get-intrinsic": {
"version": "1.2.2",
"resolved": "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.2.2.tgz",
"integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==",
"dependencies": {
"function-bind": "^1.1.2",
"has-proto": "^1.0.1",
"has-symbols": "^1.0.3",
"hasown": "^2.0.0"
}
},
"node_modules/gopd": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.0.1.tgz",
"integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==",
"dependencies": {
"get-intrinsic": "^1.1.3"
}
},
"node_modules/has-property-descriptors": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz",
"integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==",
"dependencies": {
"get-intrinsic": "^1.2.2"
}
},
"node_modules/has-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/has-proto/-/has-proto-1.0.1.tgz",
"integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/has-symbols": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.0.3.tgz",
"integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/hasown": {
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/hasown/-/hasown-2.0.0.tgz",
"integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==",
"dependencies": {
"function-bind": "^1.1.2"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/http-errors": {
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-2.0.0.tgz",
"integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
"dependencies": {
"depd": "2.0.0",
"inherits": "2.0.4",
"setprototypeof": "1.2.0",
"statuses": "2.0.1",
"toidentifier": "1.0.1"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/iconv-lite": {
"version": "0.4.24",
"resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.4.24.tgz",
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"node_modules/ipaddr.js": {
"version": "1.9.1",
"resolved": "https://registry.npmmirror.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
"engines": {
"node": ">= 0.10"
}
},
"node_modules/media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmmirror.com/media-typer/-/media-typer-0.3.0.tgz",
"integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/merge-descriptors": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
"integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="
},
"node_modules/methods": {
"version": "1.1.2",
"resolved": "https://registry.npmmirror.com/methods/-/methods-1.1.2.tgz",
"integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime": {
"version": "1.6.0",
"resolved": "https://registry.npmmirror.com/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
"bin": {
"mime": "cli.js"
},
"engines": {
"node": ">=4"
}
},
"node_modules/mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"dependencies": {
"mime-db": "1.52.0"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz",
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
},
"node_modules/negotiator": {
"version": "0.6.3",
"resolved": "https://registry.npmmirror.com/negotiator/-/negotiator-0.6.3.tgz",
"integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/object-inspect": {
"version": "1.13.1",
"resolved": "https://registry.npmmirror.com/object-inspect/-/object-inspect-1.13.1.tgz",
"integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ=="
},
"node_modules/on-finished": {
"version": "2.4.1",
"resolved": "https://registry.npmmirror.com/on-finished/-/on-finished-2.4.1.tgz",
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
"dependencies": {
"ee-first": "1.1.1"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/parseurl": {
"version": "1.3.3",
"resolved": "https://registry.npmmirror.com/parseurl/-/parseurl-1.3.3.tgz",
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/path-to-regexp": {
"version": "0.1.7",
"resolved": "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
"integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
},
"node_modules/proxy-addr": {
"version": "2.0.7",
"resolved": "https://registry.npmmirror.com/proxy-addr/-/proxy-addr-2.0.7.tgz",
"integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
"dependencies": {
"forwarded": "0.2.0",
"ipaddr.js": "1.9.1"
},
"engines": {
"node": ">= 0.10"
}
},
"node_modules/qs": {
"version": "6.11.0",
"resolved": "https://registry.npmmirror.com/qs/-/qs-6.11.0.tgz",
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
"dependencies": {
"side-channel": "^1.0.4"
},
"engines": {
"node": ">=0.6"
}
},
"node_modules/range-parser": {
"version": "1.2.1",
"resolved": "https://registry.npmmirror.com/range-parser/-/range-parser-1.2.1.tgz",
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/raw-body": {
"version": "2.5.1",
"resolved": "https://registry.npmmirror.com/raw-body/-/raw-body-2.5.1.tgz",
"integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==",
"dependencies": {
"bytes": "3.1.2",
"http-errors": "2.0.0",
"iconv-lite": "0.4.24",
"unpipe": "1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
},
"node_modules/safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"node_modules/send": {
"version": "0.18.0",
"resolved": "https://registry.npmmirror.com/send/-/send-0.18.0.tgz",
"integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==",
"dependencies": {
"debug": "2.6.9",
"depd": "2.0.0",
"destroy": "1.2.0",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"fresh": "0.5.2",
"http-errors": "2.0.0",
"mime": "1.6.0",
"ms": "2.1.3",
"on-finished": "2.4.1",
"range-parser": "~1.2.1",
"statuses": "2.0.1"
},
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/send/node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
},
"node_modules/serve-static": {
"version": "1.15.0",
"resolved": "https://registry.npmmirror.com/serve-static/-/serve-static-1.15.0.tgz",
"integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==",
"dependencies": {
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"parseurl": "~1.3.3",
"send": "0.18.0"
},
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/set-function-length": {
"version": "1.1.1",
"resolved": "https://registry.npmmirror.com/set-function-length/-/set-function-length-1.1.1.tgz",
"integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==",
"dependencies": {
"define-data-property": "^1.1.1",
"get-intrinsic": "^1.2.1",
"gopd": "^1.0.1",
"has-property-descriptors": "^1.0.0"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/setprototypeof": {
"version": "1.2.0",
"resolved": "https://registry.npmmirror.com/setprototypeof/-/setprototypeof-1.2.0.tgz",
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
},
"node_modules/side-channel": {
"version": "1.0.4",
"resolved": "https://registry.npmmirror.com/side-channel/-/side-channel-1.0.4.tgz",
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
"dependencies": {
"call-bind": "^1.0.0",
"get-intrinsic": "^1.0.2",
"object-inspect": "^1.9.0"
}
},
"node_modules/statuses": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/statuses/-/statuses-2.0.1.tgz",
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/toidentifier": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/toidentifier/-/toidentifier-1.0.1.tgz",
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
"engines": {
"node": ">=0.6"
}
},
"node_modules/type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmmirror.com/type-is/-/type-is-1.6.18.tgz",
"integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
"dependencies": {
"media-typer": "0.3.0",
"mime-types": "~2.1.24"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/unpipe/-/unpipe-1.0.0.tgz",
"integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/utils-merge": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/utils-merge/-/utils-merge-1.0.1.tgz",
"integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
"engines": {
"node": ">= 0.4.0"
}
},
"node_modules/vary": {
"version": "1.1.2",
"resolved": "https://registry.npmmirror.com/vary/-/vary-1.1.2.tgz",
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
"engines": {
"node": ">= 0.8"
}
}
}
}
{
"name": "icon",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.18.2"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment