diff --git a/docSite/assets/imgs/sealos_price.png b/docSite/assets/imgs/sealos_price.png new file mode 100644 index 00000000000..370849a8ca8 Binary files /dev/null and b/docSite/assets/imgs/sealos_price.png differ diff --git a/docSite/content/docs/commercial/intro.md b/docSite/content/docs/commercial/intro.md index 8ddf9bfde4f..ca018f5aa0e 100644 --- a/docSite/content/docs/commercial/intro.md +++ b/docSite/content/docs/commercial/intro.md @@ -50,9 +50,12 @@ FastGPT 商业版软件根据不同的部署方式,分为 4 类收费模式。 | Sealos全托管 | 1. 有效期内免费升级。
2. 免运维服务&数据库。
3. 赠送 10000 元 Sealos 云资源额度。 | 半天 | 3000元起/月(3个月起)

30000元起/年 | | 自有服务器-单机版 | 1. 6个版本的升级服务。 | 14天内 | 60000元/套(不限时长) | | 自有服务器-Sealos版 | 1. 6个版本的升级服务。 | 14天内 | 150000元/套(不限时长)| - {{< /table >}} +{{% alert icon="🤖 " context="success" %}} +6个版本的升级服务不是指只能用 6 个版本,而是指依赖 FastGPT 团队提供的升级服务。大部分时候,建议自行升级,也不麻烦。 +{{% /alert %}} + ## 技术支持 @@ -84,4 +87,11 @@ FastGPT 商业版软件根据不同的部署方式,分为 4 类收费模式。 2. 二次开发如何操作? - 可自行修改开源版代码进行二次开发,不支持修改商业版镜像。 \ No newline at end of file + 可自行修改开源版代码进行二次开发,不支持修改商业版镜像。 + + +## Sealos 费用 + +Sealos 云服务属于按量计费,下面是它的价格表: + +![](/imgs/sealos_price.png) diff --git a/docSite/content/docs/development/configuration.md b/docSite/content/docs/development/configuration.md index fb720249179..beff5a682d1 100644 --- a/docSite/content/docs/development/configuration.md +++ b/docSite/content/docs/development/configuration.md @@ -178,7 +178,8 @@ weight: 708 { "model": "gpt-3.5-turbo-1106", "name": "GPT35-1106", - "price": 0, // 除以 100000 后等于1个token的价格 + "inputPrice": 0, // 输入价格。 xx元/1k tokens + "outputPrice": 0, // 输出价格。 xx元/1k tokens "maxContext": 16000, // 最大上下文长度 "maxResponse": 4000, // 最大回复长度 "quoteMaxToken": 2000, // 最大引用内容长度 @@ -192,7 +193,8 @@ weight: 708 "name": "GPT35-16k", "maxContext": 16000, "maxResponse": 16000, - "price": 0, + "inputPrice": 0, + "outputPrice": 0, "quoteMaxToken": 8000, "maxTemperature": 1.2, "censor": false, @@ -204,7 +206,8 @@ weight: 708 "name": "GPT4-8k", "maxContext": 8000, "maxResponse": 8000, - "price": 0, + "inputPrice": 0, + "outputPrice": 0, "quoteMaxToken": 4000, "maxTemperature": 1.2, "censor": false, @@ -216,7 +219,8 @@ weight: 708 "name": "GPT4-Vision", "maxContext": 128000, "maxResponse": 4000, - "price": 0, + "inputPrice": 0, + "outputPrice": 0, "quoteMaxToken": 100000, "maxTemperature": 1.2, "censor": false, @@ -239,7 +243,8 @@ weight: 708 "name": "GPT35-1106", "maxContext": 16000, "maxResponse": 4000, - "price": 0, + "inputPrice": 0, + "outputPrice": 0, "toolChoice": true, // 是否支持openai的 toolChoice, 不支持的模型需要设置为 false,会走提示词生成 "functionPrompt": "" }, @@ -248,7 +253,7 @@ weight: 708 "name": "GPT4-8k", "maxContext": 8000, "maxResponse": 8000, - "price": 0, + "inputPrice": 0, "toolChoice": true, "functionPrompt": "" } @@ -259,7 +264,7 @@ weight: 708 "name": "GPT35-1106", "maxContext": 16000, "maxResponse": 4000, - "price": 0, + "outputPrice": 0, "toolChoice": true, "functionPrompt": "" } @@ -270,14 +275,15 @@ weight: 708 "name": "GPT35-1106", "maxContext": 1600, "maxResponse": 4000, - "price": 0 + "inputPrice": 0, + "outputPrice": 0, } ], "vectorModels": [ // 向量模型 { "model": "text-embedding-ada-002", "name": "Embedding-2", - "price": 0.2, + "inputPrice": 0, "defaultToken": 700, "maxToken": 3000 } @@ -287,7 +293,7 @@ weight: 708 { "model": "tts-1", "name": "OpenAI TTS1", - "price": 0, + "inputPrice": 0, "baseUrl": "", "key": "", "voices": [ @@ -303,7 +309,7 @@ weight: 708 "whisperModel": { "model": "whisper-1", "name": "Whisper1", - "price": 0 + "inputPrice": 0 } } ``` diff --git a/docSite/content/docs/development/qa.md b/docSite/content/docs/development/qa.md index b5178ab984c..5be3a5818b6 100644 --- a/docSite/content/docs/development/qa.md +++ b/docSite/content/docs/development/qa.md @@ -35,12 +35,16 @@ OneAPI 中没有配置该模型渠道。 ### 如何更新? -执行下面命令会自动拉取最新镜像,一般情况下不需要执行额外操作。 +1. 查看[更新文档](/docs/development/upgrading/intro/),确认要升级的版本,避免跨版本升级。 +2. 修改镜像 tag 到指定版本 +3. 执行下面命令会自动拉取镜像: -```bash -docker-compose pull -docker-compose up -d -``` + ```bash + docker-compose pull + docker-compose up -d + ``` + +4. 执行初始化脚本(如果有) ### 如何自定义配置文件? diff --git a/docSite/content/docs/development/sealos.md b/docSite/content/docs/development/sealos.md index 18ed6d70cc6..7b4d11c8113 100644 --- a/docSite/content/docs/development/sealos.md +++ b/docSite/content/docs/development/sealos.md @@ -59,14 +59,17 @@ FastGPT 商业版共包含了3个应用(fastgpt, fastgpt-plus, fastgpt-admin 例如,目前是4.5 版本,要升级到4.5.1,就先把镜像版本改成v4.5.1,执行一下升级脚本,等待完成后再继续升级。如果目标版本不需要执行初始化,则可以跳过。 升级步骤: -1. 打开sealos的应用管理 -2. 有3个应用 fastgpt , fastgpt-plugin 和 fastgpt-admin -3. 点击对应应用右边3个点,变更。或者点详情后右上角的变更。 -4. 修改镜像名栏 + +1. 查看[更新文档](/docs/development/upgrading/intro/),确认要升级的版本,避免跨版本升级。 +2. 打开 sealos 的应用管理 +3. 有2个应用 fastgpt , fastgpt-pro +4. 点击对应应用右边3个点,变更。或者点详情后右上角的变更。 +5. 修改镜像的版本号 + ![](/imgs/onsealos2.png) -5. 点击变更/重启,会自动拉取最新镜像进行更新 -6. 执行对应版本的初始化脚本 +6. 点击变更/重启,会自动拉取最新镜像进行更新 +7. 执行对应版本的初始化脚本(如果有) ### 如何获取 FastGPT 访问链接 @@ -88,34 +91,6 @@ FastGPT 商业版共包含了3个应用(fastgpt, fastgpt-plus, fastgpt-admin [配置文件参考](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 修改应用的环境变量,增加 @@ -134,6 +109,7 @@ SYSTEM_FAVICON 可以是一个网络地址 新增一个挂载文件,文件名为:/app/projects/app/public/icon/logo.svg ,值为 svg 对应的值。 ![](/imgs/onsealos7.png) + ![](/imgs/onsealos8.png) ### 管理后台 @@ -148,45 +124,8 @@ SYSTEM_FAVICON 可以是一个网络地址 "license": "", "system": { "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 使用 diff --git a/docSite/content/docs/development/upgrading/466.md b/docSite/content/docs/development/upgrading/466.md index 89aac365d0c..671a7e86d22 100644 --- a/docSite/content/docs/development/upgrading/466.md +++ b/docSite/content/docs/development/upgrading/466.md @@ -1,5 +1,5 @@ --- -title: 'V4.6.6-alpha(需要改配置文件)' +title: 'V4.6.6(需要改配置文件)' description: 'FastGPT V4.6.6' icon: 'upgrade' draft: false @@ -7,8 +7,6 @@ toc: true weight: 830 --- -**版本仍在开发中……** - ## 配置文件变更 为了减少代码重复度,我们对配置文件做了一些修改:[点击查看最新的配置文件](/docs/development/configuration/) @@ -18,4 +16,5 @@ weight: 830 1. 新增 - 搜索方式:分离向量语义检索,全文检索和重排,通过 RRF 进行排序合并。 2. 优化 - 问题分类提示词,id引导。测试国产商用 api 模型(百度阿里智谱讯飞)使用 Prompt 模式均可分类。 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) \ No newline at end of file +4. 优化代码:Icon 抽离和自动化获取。 +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 diff --git a/docSite/content/docs/use-cases/datasetEngine.md b/docSite/content/docs/use-cases/datasetEngine.md index 19fa4adddd0..959dec472ba 100644 --- a/docSite/content/docs/use-cases/datasetEngine.md +++ b/docSite/content/docs/use-cases/datasetEngine.md @@ -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 - 直接分段导入 @@ -57,7 +57,7 @@ FastGPT 采用了 `PostgresSQL` 的 `PG Vector` 插件作为向量检索器, | 交互 | 结果 | | --- | --- | -| ![](/imgs/datasetEngine4.png) | ![](/imgs/datasetEngine5.png) | +| ![](/imgs/datasetEngine4.jpg) | ![](/imgs/datasetEngine5.jpg) | ### 导入数据方案2 - QA导入 @@ -66,7 +66,7 @@ FastGPT 采用了 `PostgresSQL` 的 `PG Vector` 插件作为向量检索器, | 交互 | 结果 | | --- | --- | -| ![](/imgs/datasetEngine6.png) | ![](/imgs/datasetEngine7.png) | +| ![](/imgs/datasetEngine6.jpg) | ![](/imgs/datasetEngine7.jpg) | ### 导入数据方案3 - 手动录入 @@ -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录入 diff --git a/docSite/content/docs/use-cases/onwechat.md b/docSite/content/docs/use-cases/onwechat.md index 408f0f484ff..6d45ae25f0c 100644 --- a/docSite/content/docs/use-cases/onwechat.md +++ b/docSite/content/docs/use-cases/onwechat.md @@ -21,7 +21,7 @@ weight: 504 密钥需要自己保管好,一旦关闭就无法再复制密钥,只能创建新密钥再复制。 {{% /alert %}} -![](/imgs/fastgpt-api.png) +![](/imgs/fastgpt-api.jpg) ## 3. 创建 docker-compose.yml 文件 diff --git a/docSite/content/docs/use-cases/openapi.md b/docSite/content/docs/use-cases/openapi.md index 76b4bef804b..9dec264bbe6 100644 --- a/docSite/content/docs/use-cases/openapi.md +++ b/docSite/content/docs/use-cases/openapi.md @@ -15,7 +15,7 @@ weight: 505 密钥需要自己保管好,一旦关闭就无法再复制密钥,只能创建新密钥再复制。 {{% /alert %}} -![](/imgs/fastgpt-api.png) +![](/imgs/fastgpt-api.jpg) {{% alert icon="🍅" context="success" %}} Tips: 安全起见,你可以设置一个额度或者过期时间,放置 key 被滥用。 diff --git a/docSite/content/docs/workflow/examples/google_search.md b/docSite/content/docs/workflow/examples/google_search.md index 9568872fde7..6700b7cb143 100644 --- a/docSite/content/docs/workflow/examples/google_search.md +++ b/docSite/content/docs/workflow/examples/google_search.md @@ -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 模型,具体的搜索效果需要依赖提示词和搜索引擎,尤其是【搜索引擎】,简单的搜索引擎无法获取更详细的内容,这部分可能需要更多的调试。 diff --git a/docSite/content/docs/workflow/examples/lab_appointment.md b/docSite/content/docs/workflow/examples/lab_appointment.md index 2ada07a319d..f7baeafbf55 100644 --- a/docSite/content/docs/workflow/examples/lab_appointment.md +++ b/docSite/content/docs/workflow/examples/lab_appointment.md @@ -9,8 +9,8 @@ weight: 403 | | | | --------------------- | --------------------- | -| ![](/imgs/demo-appointment1.png) | ![](/imgs/demo-appointment2.png) | -| ![](/imgs/demo-appointment3.png) | ![](/imgs/demo-appointment4.png) | +| ![](/imgs/demo-appointment1.jpg) | ![](/imgs/demo-appointment2.jpg) | +| ![](/imgs/demo-appointment3.jpg) | ![](/imgs/demo-appointment4.jpg) | @@ -26,7 +26,7 @@ weight: 403 ## 2. 问题分类 -![](/imgs/demo-appointment5.png) +![](/imgs/demo-appointment5.jpg) 如上图,用户问题作为对话的起点,流入【问题分类模块】,根据用户问题的内容,判断用户是询问实验室相关问题、预约实验室或其他问题。如果用户询问的是非实验问题,会直接拒绝回复内容。再根据问题是属于询问实验室相关/预约类问题,执行不同的流程。 @@ -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 带来的十分重要的能力,可以从自然语言中提取出结构化的数据,从而方便进行逻辑处理。 @@ -57,7 +57,7 @@ weight: 403 HTTP 模块允许你调用任意 GET/POST 类型的 HTTP 接口,从而实现一些复杂的业务逻辑。这里我们调用了一个预约实验室的接口,传入的是信息提取模块的结果和预约行为。 -![](/imgs/demo-appointment9.png) +![](/imgs/demo-appointment9.jpg) 具体的入参结构可以参考[HTTP模块](/docs/workflow/modules/http/),实在不行在接口里多打印 Debug。 diff --git a/docSite/content/docs/workflow/modules/coreferenceResolution.md b/docSite/content/docs/workflow/modules/coreferenceResolution.md index 5fe3ae801df..f0e9d6be28f 100644 --- a/docSite/content/docs/workflow/modules/coreferenceResolution.md +++ b/docSite/content/docs/workflow/modules/coreferenceResolution.md @@ -13,7 +13,7 @@ weight: 364 - 有外部输入 - 触发执行 -![](/imgs/coreferenceResolution1.png) +![](/imgs/coreferenceResolution1.jpg) ## 背景 @@ -21,11 +21,11 @@ weight: 364 在搜索的过程中,尤其是连续对话的搜索,我们通常会发现后续的问题难以搜索到合适的内容,其中一个原因是知识库搜索只会使用“当前”的问题去执行。看下面的例子: -![](/imgs/coreferenceResolution2.png) +![](/imgs/coreferenceResolution2.jpg) 用户在提问“第二点是什么”的时候,只会去知识库里查找“第二点是什么”,压根查不到内容。实际上需要查询的是“QA结构是什么”。因此我们需要引入一个【问题补全】模块,来对用户当前的问题进行补全,从而使得知识库搜索能够搜索到合适的内容。使用补全后效果如下: -![](/imgs/coreferenceResolution3.png) +![](/imgs/coreferenceResolution3.jpg) ## 功能 diff --git a/docSite/content/docs/workflow/modules/custom_feedback.md b/docSite/content/docs/workflow/modules/custom_feedback.md index e43d09577b8..c6733e95b63 100644 --- a/docSite/content/docs/workflow/modules/custom_feedback.md +++ b/docSite/content/docs/workflow/modules/custom_feedback.md @@ -18,8 +18,8 @@ weight: 354 | | | | --------------------- | --------------------- | -| ![](/imgs/customfeedback1.png) | ![](/imgs/customfeedback2.png) | -| ![](/imgs/customfeedback3.png) | ![](/imgs/customfeedback4.png) | +| ![](/imgs/customfeedback1.jpg) | ![](/imgs/customfeedback2.jpg) | +| ![](/imgs/customfeedback3.jpg) | ![](/imgs/customfeedback4.jpg) | ## 介绍 diff --git a/docSite/content/docs/workflow/modules/http.md b/docSite/content/docs/workflow/modules/http.md index 7ad57927b70..b2d627f2494 100644 --- a/docSite/content/docs/workflow/modules/http.md +++ b/docSite/content/docs/workflow/modules/http.md @@ -15,7 +15,7 @@ weight: 355 - 触发执行 - 核中核模块 -![](/imgs/http1.png) +![](/imgs/http1.jpg) ## 介绍 diff --git a/package.json b/package.json index 614c70596a2..617e266bc53 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,9 @@ "format-code": "prettier --config \"./.prettierrc.js\" --write \"./**/src/**/*.{ts,tsx,scss}\"", "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", - "postinstall": "sh ./scripts/postinstall.sh" + "postinstall": "sh ./scripts/postinstall.sh", + "initIcon": "node ./scripts/icon/init.js", + "previewIcon": "node ./scripts/icon/index.js" }, "devDependencies": { "@chakra-ui/cli": "^2.4.1", diff --git a/packages/global/core/module/template/system/coreferenceResolution.ts b/packages/global/core/module/template/system/coreferenceResolution.ts index 651d38b869c..1fe6e942415 100644 --- a/packages/global/core/module/template/system/coreferenceResolution.ts +++ b/packages/global/core/module/template/system/coreferenceResolution.ts @@ -42,7 +42,7 @@ export const AiCFR: FlowModuleTemplateType = { label: 'core.module.input.label.cfr background', max: 300, valueType: ModuleIOValueTypeEnum.string, - description: 'core.module.input.description.cfr background', + description: 'core.app.edit.cfr background tip', placeholder: 'core.module.input.placeholder.cfr background', showTargetInApp: true, showTargetInPlugin: true diff --git a/projects/app/src/components/Icon/close.tsx b/packages/web/components/common/Icon/close.tsx similarity index 78% rename from projects/app/src/components/Icon/close.tsx rename to packages/web/components/common/Icon/close.tsx index cb8e4eef82f..2c6f7f0f398 100644 --- a/projects/app/src/components/Icon/close.tsx +++ b/packages/web/components/common/Icon/close.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Flex, type FlexProps } from '@chakra-ui/react'; -import MyIcon from '@/components/Icon'; +import MyIcon from './index'; const CloseIcon = (props: FlexProps) => { return ( @@ -14,7 +14,7 @@ const CloseIcon = (props: FlexProps) => { _hover={{ bg: 'myGray.200' }} {...props} > - + ); }; diff --git a/projects/app/src/components/Icon/index.tsx b/packages/web/components/common/Icon/constants.ts similarity index 64% rename from projects/app/src/components/Icon/index.tsx rename to packages/web/components/common/Icon/constants.ts index ae342d3fe53..01ce497ae6b 100644 --- a/projects/app/src/components/Icon/index.tsx +++ b/packages/web/components/common/Icon/constants.ts @@ -1,159 +1,129 @@ -import React, { useEffect, useState } from 'react'; -import type { IconProps } from '@chakra-ui/react'; -import { Icon } from '@chakra-ui/react'; +// @ts-nocheck -const iconPaths = { - copy: () => import('./icons/copy.svg'), - delete: () => import('./icons/delete.svg'), - stop: () => import('./icons/stop.svg'), +export const iconPaths = { + chat: () => import('./icons/chat.svg'), + chatSend: () => import('./icons/chatSend.svg'), + closeSolid: () => import('./icons/closeSolid.svg'), collectionLight: () => import('./icons/collectionLight.svg'), collectionSolid: () => import('./icons/collectionSolid.svg'), - empty: () => import('./icons/empty.svg'), - back: () => import('./icons/back.svg'), - backFill: () => import('./icons/fill/back.svg'), - more: () => import('./icons/more.svg'), - tabbarChat: () => import('./icons/phoneTabbar/chat.svg'), - tabbarModel: () => import('./icons/phoneTabbar/app.svg'), - tabbarMore: () => import('./icons/phoneTabbar/more.svg'), - tabbarMe: () => import('./icons/phoneTabbar/me.svg'), - closeSolid: () => import('./icons/closeSolid.svg'), - wx: () => import('./icons/wx.svg'), - out: () => import('./icons/out.svg'), - git: () => import('./icons/git.svg'), - gitFill: () => import('./icons/fill/git.svg'), - googleFill: () => import('./icons/fill/google.svg'), - menu: () => import('./icons/menu.svg'), - edit: () => import('./icons/edit.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/addCircleLight': () => import('./icons/common/addCircleLight.svg'), + 'common/backFill': () => import('./icons/common/backFill.svg'), + 'common/backLight': () => import('./icons/common/backLight.svg'), + 'common/clearLight': () => import('./icons/common/clearLight.svg'), + 'common/closeLight': () => import('./icons/common/closeLight.svg'), + 'common/confirm/commonTip': () => import('./icons/common/confirm/commonTip.svg'), + 'common/confirm/deleteTip': () => import('./icons/common/confirm/deleteTip.svg'), + 'common/courseLight': () => import('./icons/common/courseLight.svg'), + 'common/customTitleLight': () => import('./icons/common/customTitleLight.svg'), + 'common/file/move': () => import('./icons/common/file/move.svg'), + 'common/fullScreenLight': () => import('./icons/common/fullScreenLight.svg'), + 'common/gitFill': () => import('./icons/common/gitFill.svg'), + 'common/gitLight': () => import('./icons/common/gitLight.svg'), + 'common/googleFill': () => import('./icons/common/googleFill.svg'), + 'common/importLight': () => import('./icons/common/importLight.svg'), + 'common/inviteLight': () => import('./icons/common/inviteLight.svg'), 'common/language/en': () => import('./icons/common/language/en.svg'), 'common/language/zh': () => import('./icons/common/language/zh.svg'), - 'support/outlink/shareLight': () => import('./icons/support/outlink/shareLight.svg'), - 'support/outlink/iframeLight': () => import('./icons/support/outlink/iframeLight.svg'), - 'common/addCircleLight': () => import('./icons/common/addCircleLight.svg'), + 'common/loading': () => import('./icons/common/loading.svg'), + 'common/navbar/pluginFill': () => import('./icons/common/navbar/pluginFill.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/courseLight': () => import('./icons/common/courseLight.svg'), - 'support/account/promotionLight': () => import('./icons/support/account/promotionLight.svg'), - 'core/app/logsLight': () => import('./icons/core/app/logsLight.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/playLight': () => import('./icons/common/playLight.svg'), + 'common/questionLight': () => import('./icons/common/questionLight.svg'), + 'common/refreshLight': () => import('./icons/common/refreshLight.svg'), 'common/retryLight': () => import('./icons/common/retryLight.svg'), 'common/rightArrowLight': () => import('./icons/common/rightArrowLight.svg'), + 'common/routePushLight': () => import('./icons/common/routePushLight.svg'), 'common/searchLight': () => import('./icons/common/searchLight.svg'), - 'common/file/move': () => import('./icons/common/file/move.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/settingLight': () => import('./icons/common/settingLight.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/inviteLight': () => import('./icons/common/inviteLight.svg'), - 'support/team/memberLight': () => import('./icons/support/team/memberLight.svg'), - 'support/permission/privateLight': () => import('./icons/support/permission/privateLight.svg'), - 'support/permission/publicLight': () => import('./icons/support/permission/publicLight.svg'), - 'core/app/ttsFill': () => import('./icons/core/app/ttsFill.svg'), - 'core/app/tts': () => import('./icons/core/app/tts.svg'), + 'common/viewLight': () => import('./icons/common/viewLight.svg'), + 'common/voiceLight': () => import('./icons/common/voiceLight.svg'), + copy: () => import('./icons/copy.svg'), + 'core/app/aiFill': () => import('./icons/core/app/aiFill.svg'), + 'core/app/aiLight': () => import('./icons/core/app/aiLight.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'), - '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/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/stopSpeechFill': () => import('./icons/core/chat/stopSpeechFill.svg'), - 'core/chat/stopSpeech': () => import('./icons/core/chat/stopSpeech.svg'), + 'core/chat/sendFill': () => import('./icons/core/chat/sendFill.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/fileSelect': () => import('./icons/core/chat/fileSelect.svg'), - 'core/dataset/modeEmbedding': () => import('./icons/core/dataset/modeEmbedding.svg'), + 'core/chat/stopSpeech': () => import('./icons/core/chat/stopSpeech.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/mixedRecall': () => import('./icons/core/dataset/mixedRecall.svg'), - 'core/app/variable/input': () => import('./icons/core/app/variable/input.svg'), - 'core/app/variable/textarea': () => import('./icons/core/app/variable/textarea.svg'), - 'core/app/variable/select': () => import('./icons/core/app/variable/select.svg'), + 'core/dataset/modeEmbedding': () => import('./icons/core/dataset/modeEmbedding.svg'), + 'core/dataset/rerank': () => import('./icons/core/dataset/rerank.svg'), 'core/dataset/websiteDataset': () => import('./icons/core/dataset/websiteDataset.svg'), - 'core/dataset/commonDataset': () => import('./icons/core/dataset/commonDataset.svg'), - 'core/dataset/folderDataset': () => import('./icons/core/dataset/folderDataset.svg'), - 'common/confirm/deleteTip': () => import('./icons/common/confirm/deleteTip.svg'), - 'common/confirm/commonTip': () => import('./icons/common/confirm/commonTip.svg'), - 'common/routePushLight': () => import('./icons/common/routePushLight.svg'), - 'common/viewLight': () => import('./icons/common/viewLight.svg'), - 'core/app/customFeedback': () => import('./icons/core/app/customFeedback.svg'), + 'core/modules/previewLight': () => import('./icons/core/modules/previewLight.svg'), + 'core/modules/variable': () => import('./icons/core/modules/variable.svg'), + 'core/modules/welcomeText': () => import('./icons/core/modules/welcomeText.svg'), + date: () => import('./icons/date.svg'), + delete: () => import('./icons/delete.svg'), + edit: () => import('./icons/edit.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'), - 'core/dataset/rerank': () => import('./icons/core/dataset/rerank.svg') -}; - -export type IconName = keyof typeof iconPaths; - -const MyIcon = ({ name, w = 'auto', h = 'auto', ...props }: { name: IconName } & IconProps) => { - const [IconComponent, setIconComponent] = useState(null); - - useEffect(() => { - iconPaths[name]?.() - .then((icon) => { - setIconComponent({ as: icon.default }); - }) - .catch((error) => console.log(error)); - }, [name]); - - return !!name && !!iconPaths[name] ? ( - - ) : null; + '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'), + 'support/user/informLight': () => import('./icons/support/user/informLight.svg'), + 'support/user/userFill': () => import('./icons/support/user/userFill.svg'), + 'support/user/userLight': () => import('./icons/support/user/userLight.svg'), + text: () => import('./icons/text.svg'), + user: () => import('./icons/user.svg'), + wx: () => import('./icons/wx.svg') }; - -export default MyIcon; diff --git a/projects/app/src/components/Icon/delete.tsx b/packages/web/components/common/Icon/delete.tsx similarity index 91% rename from projects/app/src/components/Icon/delete.tsx rename to packages/web/components/common/Icon/delete.tsx index 236934c91a8..1e52ae802fc 100644 --- a/projects/app/src/components/Icon/delete.tsx +++ b/packages/web/components/common/Icon/delete.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import MyIcon from '@/components/Icon'; +import MyIcon from './index'; import { IconProps } from '@chakra-ui/react'; const DeleteIcon = (props: IconProps) => { diff --git a/projects/app/src/components/Icon/icons/chat.svg b/packages/web/components/common/Icon/icons/chat.svg similarity index 100% rename from projects/app/src/components/Icon/icons/chat.svg rename to packages/web/components/common/Icon/icons/chat.svg diff --git a/projects/app/src/components/Icon/icons/chatSend.svg b/packages/web/components/common/Icon/icons/chatSend.svg similarity index 100% rename from projects/app/src/components/Icon/icons/chatSend.svg rename to packages/web/components/common/Icon/icons/chatSend.svg diff --git a/projects/app/src/components/Icon/icons/closeSolid.svg b/packages/web/components/common/Icon/icons/closeSolid.svg similarity index 100% rename from projects/app/src/components/Icon/icons/closeSolid.svg rename to packages/web/components/common/Icon/icons/closeSolid.svg diff --git a/projects/app/src/components/Icon/icons/collectionLight.svg b/packages/web/components/common/Icon/icons/collectionLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/collectionLight.svg rename to packages/web/components/common/Icon/icons/collectionLight.svg diff --git a/projects/app/src/components/Icon/icons/collectionSolid.svg b/packages/web/components/common/Icon/icons/collectionSolid.svg similarity index 100% rename from projects/app/src/components/Icon/icons/collectionSolid.svg rename to packages/web/components/common/Icon/icons/collectionSolid.svg diff --git a/projects/app/src/components/Icon/icons/common/addCircleLight.svg b/packages/web/components/common/Icon/icons/common/addCircleLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/addCircleLight.svg rename to packages/web/components/common/Icon/icons/common/addCircleLight.svg diff --git a/projects/app/src/components/Icon/icons/fill/back.svg b/packages/web/components/common/Icon/icons/common/backFill.svg similarity index 100% rename from projects/app/src/components/Icon/icons/fill/back.svg rename to packages/web/components/common/Icon/icons/common/backFill.svg diff --git a/projects/app/src/components/Icon/icons/back.svg b/packages/web/components/common/Icon/icons/common/backLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/back.svg rename to packages/web/components/common/Icon/icons/common/backLight.svg diff --git a/projects/app/src/components/Icon/icons/light/clear.svg b/packages/web/components/common/Icon/icons/common/clearLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/light/clear.svg rename to packages/web/components/common/Icon/icons/common/clearLight.svg diff --git a/projects/app/src/components/Icon/icons/light/close.svg b/packages/web/components/common/Icon/icons/common/closeLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/light/close.svg rename to packages/web/components/common/Icon/icons/common/closeLight.svg diff --git a/projects/app/src/components/Icon/icons/common/confirm/commonTip.svg b/packages/web/components/common/Icon/icons/common/confirm/commonTip.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/confirm/commonTip.svg rename to packages/web/components/common/Icon/icons/common/confirm/commonTip.svg diff --git a/projects/app/src/components/Icon/icons/common/confirm/deleteTip.svg b/packages/web/components/common/Icon/icons/common/confirm/deleteTip.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/confirm/deleteTip.svg rename to packages/web/components/common/Icon/icons/common/confirm/deleteTip.svg diff --git a/projects/app/src/components/Icon/icons/common/courseLight.svg b/packages/web/components/common/Icon/icons/common/courseLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/courseLight.svg rename to packages/web/components/common/Icon/icons/common/courseLight.svg diff --git a/projects/app/src/components/Icon/icons/light/customTitle.svg b/packages/web/components/common/Icon/icons/common/customTitleLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/light/customTitle.svg rename to packages/web/components/common/Icon/icons/common/customTitleLight.svg diff --git a/projects/app/src/components/Icon/icons/common/file/move.svg b/packages/web/components/common/Icon/icons/common/file/move.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/file/move.svg rename to packages/web/components/common/Icon/icons/common/file/move.svg diff --git a/projects/app/src/components/Icon/icons/light/fullScreen.svg b/packages/web/components/common/Icon/icons/common/fullScreenLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/light/fullScreen.svg rename to packages/web/components/common/Icon/icons/common/fullScreenLight.svg diff --git a/projects/app/src/components/Icon/icons/fill/git.svg b/packages/web/components/common/Icon/icons/common/gitFill.svg similarity index 100% rename from projects/app/src/components/Icon/icons/fill/git.svg rename to packages/web/components/common/Icon/icons/common/gitFill.svg diff --git a/projects/app/src/components/Icon/icons/git.svg b/packages/web/components/common/Icon/icons/common/gitLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/git.svg rename to packages/web/components/common/Icon/icons/common/gitLight.svg diff --git a/projects/app/src/components/Icon/icons/fill/google.svg b/packages/web/components/common/Icon/icons/common/googleFill.svg similarity index 100% rename from projects/app/src/components/Icon/icons/fill/google.svg rename to packages/web/components/common/Icon/icons/common/googleFill.svg diff --git a/projects/app/src/components/Icon/icons/light/import.svg b/packages/web/components/common/Icon/icons/common/importLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/light/import.svg rename to packages/web/components/common/Icon/icons/common/importLight.svg diff --git a/projects/app/src/components/Icon/icons/common/inviteLight.svg b/packages/web/components/common/Icon/icons/common/inviteLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/inviteLight.svg rename to packages/web/components/common/Icon/icons/common/inviteLight.svg diff --git a/projects/app/src/components/Icon/icons/common/language/en.svg b/packages/web/components/common/Icon/icons/common/language/en.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/language/en.svg rename to packages/web/components/common/Icon/icons/common/language/en.svg diff --git a/projects/app/src/components/Icon/icons/common/language/zh.svg b/packages/web/components/common/Icon/icons/common/language/zh.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/language/zh.svg rename to packages/web/components/common/Icon/icons/common/language/zh.svg diff --git a/projects/app/src/components/Icon/icons/common/loading.svg b/packages/web/components/common/Icon/icons/common/loading.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/loading.svg rename to packages/web/components/common/Icon/icons/common/loading.svg diff --git a/projects/app/src/components/Icon/icons/common/navbar/pluginFill.svg b/packages/web/components/common/Icon/icons/common/navbar/pluginFill.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/navbar/pluginFill.svg rename to packages/web/components/common/Icon/icons/common/navbar/pluginFill.svg diff --git a/projects/app/src/components/Icon/icons/common/navbar/pluginLight.svg b/packages/web/components/common/Icon/icons/common/navbar/pluginLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/navbar/pluginLight.svg rename to packages/web/components/common/Icon/icons/common/navbar/pluginLight.svg diff --git a/projects/app/src/components/Icon/icons/light/overview.svg b/packages/web/components/common/Icon/icons/common/overviewLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/light/overview.svg rename to packages/web/components/common/Icon/icons/common/overviewLight.svg diff --git a/projects/app/src/components/Icon/icons/common/playFill.svg b/packages/web/components/common/Icon/icons/common/playFill.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/playFill.svg rename to packages/web/components/common/Icon/icons/common/playFill.svg diff --git a/projects/app/src/components/Icon/icons/common/playLight.svg b/packages/web/components/common/Icon/icons/common/playLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/playLight.svg rename to packages/web/components/common/Icon/icons/common/playLight.svg diff --git a/packages/web/components/common/Icon/icons/common/questionLight.svg b/packages/web/components/common/Icon/icons/common/questionLight.svg new file mode 100644 index 00000000000..f6fc6095eba --- /dev/null +++ b/packages/web/components/common/Icon/icons/common/questionLight.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/projects/app/src/components/Icon/icons/common/refreshLight.svg b/packages/web/components/common/Icon/icons/common/refreshLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/refreshLight.svg rename to packages/web/components/common/Icon/icons/common/refreshLight.svg diff --git a/projects/app/src/components/Icon/icons/common/retryLight.svg b/packages/web/components/common/Icon/icons/common/retryLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/retryLight.svg rename to packages/web/components/common/Icon/icons/common/retryLight.svg diff --git a/projects/app/src/components/Icon/icons/common/rightArrowLight.svg b/packages/web/components/common/Icon/icons/common/rightArrowLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/rightArrowLight.svg rename to packages/web/components/common/Icon/icons/common/rightArrowLight.svg diff --git a/projects/app/src/components/Icon/icons/common/routePushLight.svg b/packages/web/components/common/Icon/icons/common/routePushLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/routePushLight.svg rename to packages/web/components/common/Icon/icons/common/routePushLight.svg diff --git a/projects/app/src/components/Icon/icons/common/searchLight.svg b/packages/web/components/common/Icon/icons/common/searchLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/searchLight.svg rename to packages/web/components/common/Icon/icons/common/searchLight.svg diff --git a/projects/app/src/components/Icon/icons/light/setting.svg b/packages/web/components/common/Icon/icons/common/settingLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/light/setting.svg rename to packages/web/components/common/Icon/icons/common/settingLight.svg diff --git a/projects/app/src/components/Icon/icons/common/text/t.svg b/packages/web/components/common/Icon/icons/common/text/t.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/text/t.svg rename to packages/web/components/common/Icon/icons/common/text/t.svg diff --git a/projects/app/src/components/Icon/icons/common/tickFill.svg b/packages/web/components/common/Icon/icons/common/tickFill.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/tickFill.svg rename to packages/web/components/common/Icon/icons/common/tickFill.svg diff --git a/projects/app/src/components/Icon/icons/common/viewLight.svg b/packages/web/components/common/Icon/icons/common/viewLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/common/viewLight.svg rename to packages/web/components/common/Icon/icons/common/viewLight.svg diff --git a/projects/app/src/components/Icon/icons/voice.svg b/packages/web/components/common/Icon/icons/common/voiceLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/voice.svg rename to packages/web/components/common/Icon/icons/common/voiceLight.svg diff --git a/projects/app/src/components/Icon/icons/copy.svg b/packages/web/components/common/Icon/icons/copy.svg similarity index 100% rename from projects/app/src/components/Icon/icons/copy.svg rename to packages/web/components/common/Icon/icons/copy.svg diff --git a/projects/app/src/components/Icon/icons/core/app/aiFill.svg b/packages/web/components/common/Icon/icons/core/app/aiFill.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/app/aiFill.svg rename to packages/web/components/common/Icon/icons/core/app/aiFill.svg diff --git a/projects/app/src/components/Icon/icons/core/app/aiLight.svg b/packages/web/components/common/Icon/icons/core/app/aiLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/app/aiLight.svg rename to packages/web/components/common/Icon/icons/core/app/aiLight.svg diff --git a/projects/app/src/components/Icon/icons/light/appApi.svg b/packages/web/components/common/Icon/icons/core/app/appApiLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/light/appApi.svg rename to packages/web/components/common/Icon/icons/core/app/appApiLight.svg diff --git a/projects/app/src/components/Icon/icons/core/app/customFeedback.svg b/packages/web/components/common/Icon/icons/core/app/customFeedback.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/app/customFeedback.svg rename to packages/web/components/common/Icon/icons/core/app/customFeedback.svg diff --git a/projects/app/src/components/Icon/icons/core/app/headphones.svg b/packages/web/components/common/Icon/icons/core/app/headphones.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/app/headphones.svg rename to packages/web/components/common/Icon/icons/core/app/headphones.svg diff --git a/projects/app/src/components/Icon/icons/core/app/logsLight.svg b/packages/web/components/common/Icon/icons/core/app/logsLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/app/logsLight.svg rename to packages/web/components/common/Icon/icons/core/app/logsLight.svg diff --git a/projects/app/src/components/Icon/icons/core/app/markLight.svg b/packages/web/components/common/Icon/icons/core/app/markLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/app/markLight.svg rename to packages/web/components/common/Icon/icons/core/app/markLight.svg diff --git a/projects/app/src/components/Icon/icons/core/app/questionGuide.svg b/packages/web/components/common/Icon/icons/core/app/questionGuide.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/app/questionGuide.svg rename to packages/web/components/common/Icon/icons/core/app/questionGuide.svg diff --git a/projects/app/src/components/Icon/icons/core/app/tts.svg b/packages/web/components/common/Icon/icons/core/app/tts.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/app/tts.svg rename to packages/web/components/common/Icon/icons/core/app/tts.svg diff --git a/projects/app/src/components/Icon/icons/core/app/ttsFill.svg b/packages/web/components/common/Icon/icons/core/app/ttsFill.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/app/ttsFill.svg rename to packages/web/components/common/Icon/icons/core/app/ttsFill.svg diff --git a/projects/app/src/components/Icon/icons/core/app/variable/input.svg b/packages/web/components/common/Icon/icons/core/app/variable/input.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/app/variable/input.svg rename to packages/web/components/common/Icon/icons/core/app/variable/input.svg diff --git a/projects/app/src/components/Icon/icons/core/app/variable/select.svg b/packages/web/components/common/Icon/icons/core/app/variable/select.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/app/variable/select.svg rename to packages/web/components/common/Icon/icons/core/app/variable/select.svg diff --git a/projects/app/src/components/Icon/icons/core/app/variable/textarea.svg b/packages/web/components/common/Icon/icons/core/app/variable/textarea.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/app/variable/textarea.svg rename to packages/web/components/common/Icon/icons/core/app/variable/textarea.svg diff --git a/projects/app/src/components/Icon/icons/core/chat/QGFill.svg b/packages/web/components/common/Icon/icons/core/chat/QGFill.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/chat/QGFill.svg rename to packages/web/components/common/Icon/icons/core/chat/QGFill.svg diff --git a/projects/app/src/components/Icon/icons/fill/chat.svg b/packages/web/components/common/Icon/icons/core/chat/chatFill.svg similarity index 100% rename from projects/app/src/components/Icon/icons/fill/chat.svg rename to packages/web/components/common/Icon/icons/core/chat/chatFill.svg diff --git a/projects/app/src/components/Icon/icons/light/chat.svg b/packages/web/components/common/Icon/icons/core/chat/chatLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/light/chat.svg rename to packages/web/components/common/Icon/icons/core/chat/chatLight.svg diff --git a/projects/app/src/components/Icon/icons/core/chat/chatModelTag.svg b/packages/web/components/common/Icon/icons/core/chat/chatModelTag.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/chat/chatModelTag.svg rename to packages/web/components/common/Icon/icons/core/chat/chatModelTag.svg diff --git a/projects/app/src/components/Icon/icons/core/chat/feedback/badLight.svg b/packages/web/components/common/Icon/icons/core/chat/feedback/badLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/chat/feedback/badLight.svg rename to packages/web/components/common/Icon/icons/core/chat/feedback/badLight.svg diff --git a/projects/app/src/components/Icon/icons/core/chat/feedback/goodLight.svg b/packages/web/components/common/Icon/icons/core/chat/feedback/goodLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/chat/feedback/goodLight.svg rename to packages/web/components/common/Icon/icons/core/chat/feedback/goodLight.svg diff --git a/projects/app/src/components/Icon/icons/core/chat/fileSelect.svg b/packages/web/components/common/Icon/icons/core/chat/fileSelect.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/chat/fileSelect.svg rename to packages/web/components/common/Icon/icons/core/chat/fileSelect.svg diff --git a/projects/app/src/components/Icon/icons/core/chat/quoteFill.svg b/packages/web/components/common/Icon/icons/core/chat/quoteFill.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/chat/quoteFill.svg rename to packages/web/components/common/Icon/icons/core/chat/quoteFill.svg diff --git a/projects/app/src/components/Icon/icons/core/chat/quoteSign.svg b/packages/web/components/common/Icon/icons/core/chat/quoteSign.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/chat/quoteSign.svg rename to packages/web/components/common/Icon/icons/core/chat/quoteSign.svg diff --git a/projects/app/src/components/Icon/icons/core/chat/recordFill.svg b/packages/web/components/common/Icon/icons/core/chat/recordFill.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/chat/recordFill.svg rename to packages/web/components/common/Icon/icons/core/chat/recordFill.svg diff --git a/projects/app/src/components/Icon/icons/core/chat/sendFill.svg b/packages/web/components/common/Icon/icons/core/chat/sendFill.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/chat/sendFill.svg rename to packages/web/components/common/Icon/icons/core/chat/sendFill.svg diff --git a/projects/app/src/components/Icon/icons/core/chat/sendLight.svg b/packages/web/components/common/Icon/icons/core/chat/sendLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/chat/sendLight.svg rename to packages/web/components/common/Icon/icons/core/chat/sendLight.svg diff --git a/projects/app/src/components/Icon/icons/light/setTop.svg b/packages/web/components/common/Icon/icons/core/chat/setTopLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/light/setTop.svg rename to packages/web/components/common/Icon/icons/core/chat/setTopLight.svg diff --git a/projects/app/src/components/Icon/icons/core/chat/speaking.svg b/packages/web/components/common/Icon/icons/core/chat/speaking.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/chat/speaking.svg rename to packages/web/components/common/Icon/icons/core/chat/speaking.svg diff --git a/projects/app/src/components/Icon/icons/core/chat/stopSpeech.svg b/packages/web/components/common/Icon/icons/core/chat/stopSpeech.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/chat/stopSpeech.svg rename to packages/web/components/common/Icon/icons/core/chat/stopSpeech.svg diff --git a/projects/app/src/components/Icon/icons/core/chat/stopSpeechFill.svg b/packages/web/components/common/Icon/icons/core/chat/stopSpeechFill.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/chat/stopSpeechFill.svg rename to packages/web/components/common/Icon/icons/core/chat/stopSpeechFill.svg diff --git a/projects/app/src/components/Icon/icons/core/dataset/commonDataset.svg b/packages/web/components/common/Icon/icons/core/dataset/commonDataset.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/dataset/commonDataset.svg rename to packages/web/components/common/Icon/icons/core/dataset/commonDataset.svg diff --git a/projects/app/src/components/Icon/icons/fill/db.svg b/packages/web/components/common/Icon/icons/core/dataset/datasetFill.svg similarity index 100% rename from projects/app/src/components/Icon/icons/fill/db.svg rename to packages/web/components/common/Icon/icons/core/dataset/datasetFill.svg diff --git a/projects/app/src/components/Icon/icons/light/db.svg b/packages/web/components/common/Icon/icons/core/dataset/datasetLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/light/db.svg rename to packages/web/components/common/Icon/icons/core/dataset/datasetLight.svg diff --git a/projects/app/src/components/Icon/icons/core/dataset/folderDataset.svg b/packages/web/components/common/Icon/icons/core/dataset/folderDataset.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/dataset/folderDataset.svg rename to packages/web/components/common/Icon/icons/core/dataset/folderDataset.svg diff --git a/projects/app/src/components/Icon/icons/core/dataset/fullTextRecall.svg b/packages/web/components/common/Icon/icons/core/dataset/fullTextRecall.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/dataset/fullTextRecall.svg rename to packages/web/components/common/Icon/icons/core/dataset/fullTextRecall.svg diff --git a/projects/app/src/components/Icon/icons/core/dataset/mixedRecall.svg b/packages/web/components/common/Icon/icons/core/dataset/mixedRecall.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/dataset/mixedRecall.svg rename to packages/web/components/common/Icon/icons/core/dataset/mixedRecall.svg diff --git a/projects/app/src/components/Icon/icons/core/dataset/modeEmbedding.svg b/packages/web/components/common/Icon/icons/core/dataset/modeEmbedding.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/dataset/modeEmbedding.svg rename to packages/web/components/common/Icon/icons/core/dataset/modeEmbedding.svg diff --git a/projects/app/src/components/Icon/icons/core/dataset/rerank.svg b/packages/web/components/common/Icon/icons/core/dataset/rerank.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/dataset/rerank.svg rename to packages/web/components/common/Icon/icons/core/dataset/rerank.svg diff --git a/projects/app/src/components/Icon/icons/core/dataset/websiteDataset.svg b/packages/web/components/common/Icon/icons/core/dataset/websiteDataset.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/dataset/websiteDataset.svg rename to packages/web/components/common/Icon/icons/core/dataset/websiteDataset.svg diff --git a/projects/app/src/components/Icon/icons/core/module/previewLight.svg b/packages/web/components/common/Icon/icons/core/modules/previewLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/core/module/previewLight.svg rename to packages/web/components/common/Icon/icons/core/modules/previewLight.svg diff --git a/projects/app/src/components/Icon/icons/modules/variable.svg b/packages/web/components/common/Icon/icons/core/modules/variable.svg similarity index 100% rename from projects/app/src/components/Icon/icons/modules/variable.svg rename to packages/web/components/common/Icon/icons/core/modules/variable.svg diff --git a/projects/app/src/components/Icon/icons/modules/welcomeText.svg b/packages/web/components/common/Icon/icons/core/modules/welcomeText.svg similarity index 100% rename from projects/app/src/components/Icon/icons/modules/welcomeText.svg rename to packages/web/components/common/Icon/icons/core/modules/welcomeText.svg diff --git a/projects/app/src/components/Icon/icons/date.svg b/packages/web/components/common/Icon/icons/date.svg similarity index 100% rename from projects/app/src/components/Icon/icons/date.svg rename to packages/web/components/common/Icon/icons/date.svg diff --git a/projects/app/src/components/Icon/icons/delete.svg b/packages/web/components/common/Icon/icons/delete.svg similarity index 100% rename from projects/app/src/components/Icon/icons/delete.svg rename to packages/web/components/common/Icon/icons/delete.svg diff --git a/projects/app/src/components/Icon/icons/edit.svg b/packages/web/components/common/Icon/icons/edit.svg similarity index 100% rename from projects/app/src/components/Icon/icons/edit.svg rename to packages/web/components/common/Icon/icons/edit.svg diff --git a/projects/app/src/components/Icon/icons/empty.svg b/packages/web/components/common/Icon/icons/empty.svg similarity index 100% rename from projects/app/src/components/Icon/icons/empty.svg rename to packages/web/components/common/Icon/icons/empty.svg diff --git a/projects/app/src/components/Icon/icons/export.svg b/packages/web/components/common/Icon/icons/export.svg similarity index 100% rename from projects/app/src/components/Icon/icons/export.svg rename to packages/web/components/common/Icon/icons/export.svg diff --git a/projects/app/src/components/Icon/icons/file/csv.svg b/packages/web/components/common/Icon/icons/file/csv.svg similarity index 100% rename from projects/app/src/components/Icon/icons/file/csv.svg rename to packages/web/components/common/Icon/icons/file/csv.svg diff --git a/projects/app/src/components/Icon/icons/file/html.svg b/packages/web/components/common/Icon/icons/file/html.svg similarity index 100% rename from projects/app/src/components/Icon/icons/file/html.svg rename to packages/web/components/common/Icon/icons/file/html.svg diff --git a/projects/app/src/components/Icon/icons/file/indexImport.svg b/packages/web/components/common/Icon/icons/file/indexImport.svg similarity index 100% rename from projects/app/src/components/Icon/icons/file/indexImport.svg rename to packages/web/components/common/Icon/icons/file/indexImport.svg diff --git a/projects/app/src/components/Icon/icons/file/manualImport.svg b/packages/web/components/common/Icon/icons/file/manualImport.svg similarity index 100% rename from projects/app/src/components/Icon/icons/file/manualImport.svg rename to packages/web/components/common/Icon/icons/file/manualImport.svg diff --git a/projects/app/src/components/Icon/icons/file/markdown.svg b/packages/web/components/common/Icon/icons/file/markdown.svg similarity index 100% rename from projects/app/src/components/Icon/icons/file/markdown.svg rename to packages/web/components/common/Icon/icons/file/markdown.svg diff --git a/projects/app/src/components/Icon/icons/file/pdf.svg b/packages/web/components/common/Icon/icons/file/pdf.svg similarity index 100% rename from projects/app/src/components/Icon/icons/file/pdf.svg rename to packages/web/components/common/Icon/icons/file/pdf.svg diff --git a/projects/app/src/components/Icon/icons/file/qaImport.svg b/packages/web/components/common/Icon/icons/file/qaImport.svg similarity index 100% rename from projects/app/src/components/Icon/icons/file/qaImport.svg rename to packages/web/components/common/Icon/icons/file/qaImport.svg diff --git a/projects/app/src/components/Icon/icons/file/uploadFile.svg b/packages/web/components/common/Icon/icons/file/uploadFile.svg similarity index 100% rename from projects/app/src/components/Icon/icons/file/uploadFile.svg rename to packages/web/components/common/Icon/icons/file/uploadFile.svg diff --git a/projects/app/src/components/Icon/icons/history.svg b/packages/web/components/common/Icon/icons/history.svg similarity index 100% rename from projects/app/src/components/Icon/icons/history.svg rename to packages/web/components/common/Icon/icons/history.svg diff --git a/projects/app/src/components/Icon/icons/inform.svg b/packages/web/components/common/Icon/icons/inform.svg similarity index 100% rename from projects/app/src/components/Icon/icons/inform.svg rename to packages/web/components/common/Icon/icons/inform.svg diff --git a/projects/app/src/components/Icon/icons/kbTest.svg b/packages/web/components/common/Icon/icons/kbTest.svg similarity index 100% rename from projects/app/src/components/Icon/icons/kbTest.svg rename to packages/web/components/common/Icon/icons/kbTest.svg diff --git a/projects/app/src/components/Icon/icons/menu.svg b/packages/web/components/common/Icon/icons/menu.svg similarity index 100% rename from projects/app/src/components/Icon/icons/menu.svg rename to packages/web/components/common/Icon/icons/menu.svg diff --git a/projects/app/src/components/Icon/icons/minus.svg b/packages/web/components/common/Icon/icons/minus.svg similarity index 100% rename from projects/app/src/components/Icon/icons/minus.svg rename to packages/web/components/common/Icon/icons/minus.svg diff --git a/projects/app/src/components/Icon/icons/more.svg b/packages/web/components/common/Icon/icons/more.svg similarity index 100% rename from projects/app/src/components/Icon/icons/more.svg rename to packages/web/components/common/Icon/icons/more.svg diff --git a/projects/app/src/components/Icon/icons/out.svg b/packages/web/components/common/Icon/icons/out.svg similarity index 100% rename from projects/app/src/components/Icon/icons/out.svg rename to packages/web/components/common/Icon/icons/out.svg diff --git a/projects/app/src/components/Icon/icons/phoneTabbar/me.svg b/packages/web/components/common/Icon/icons/phoneTabbar/me.svg similarity index 100% rename from projects/app/src/components/Icon/icons/phoneTabbar/me.svg rename to packages/web/components/common/Icon/icons/phoneTabbar/me.svg diff --git a/projects/app/src/components/Icon/icons/phoneTabbar/more.svg b/packages/web/components/common/Icon/icons/phoneTabbar/more.svg similarity index 100% rename from projects/app/src/components/Icon/icons/phoneTabbar/more.svg rename to packages/web/components/common/Icon/icons/phoneTabbar/more.svg diff --git a/projects/app/src/components/Icon/icons/save.svg b/packages/web/components/common/Icon/icons/save.svg similarity index 100% rename from projects/app/src/components/Icon/icons/save.svg rename to packages/web/components/common/Icon/icons/save.svg diff --git a/projects/app/src/components/Icon/icons/stop.svg b/packages/web/components/common/Icon/icons/stop.svg similarity index 100% rename from projects/app/src/components/Icon/icons/stop.svg rename to packages/web/components/common/Icon/icons/stop.svg diff --git a/projects/app/src/components/Icon/icons/support/account/loginoutLight.svg b/packages/web/components/common/Icon/icons/support/account/loginoutLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/support/account/loginoutLight.svg rename to packages/web/components/common/Icon/icons/support/account/loginoutLight.svg diff --git a/projects/app/src/components/Icon/icons/support/account/promotionLight.svg b/packages/web/components/common/Icon/icons/support/account/promotionLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/support/account/promotionLight.svg rename to packages/web/components/common/Icon/icons/support/account/promotionLight.svg diff --git a/projects/app/src/components/Icon/icons/light/billRecord.svg b/packages/web/components/common/Icon/icons/support/bill/billRecordLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/light/billRecord.svg rename to packages/web/components/common/Icon/icons/support/bill/billRecordLight.svg diff --git a/projects/app/src/components/Icon/icons/fill/apikey.svg b/packages/web/components/common/Icon/icons/support/outlink/apikeyFill.svg similarity index 100% rename from projects/app/src/components/Icon/icons/fill/apikey.svg rename to packages/web/components/common/Icon/icons/support/outlink/apikeyFill.svg diff --git a/projects/app/src/components/Icon/icons/apikey.svg b/packages/web/components/common/Icon/icons/support/outlink/apikeyLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/apikey.svg rename to packages/web/components/common/Icon/icons/support/outlink/apikeyLight.svg diff --git a/projects/app/src/components/Icon/icons/support/outlink/iframeLight.svg b/packages/web/components/common/Icon/icons/support/outlink/iframeLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/support/outlink/iframeLight.svg rename to packages/web/components/common/Icon/icons/support/outlink/iframeLight.svg diff --git a/projects/app/src/components/Icon/icons/light/share.svg b/packages/web/components/common/Icon/icons/support/outlink/share.svg similarity index 100% rename from projects/app/src/components/Icon/icons/light/share.svg rename to packages/web/components/common/Icon/icons/support/outlink/share.svg diff --git a/packages/web/components/common/Icon/icons/support/outlink/shareLight.svg b/packages/web/components/common/Icon/icons/support/outlink/shareLight.svg new file mode 100644 index 00000000000..4ab65220151 --- /dev/null +++ b/packages/web/components/common/Icon/icons/support/outlink/shareLight.svg @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/projects/app/src/components/Icon/icons/support/pay/payRecordLight.svg b/packages/web/components/common/Icon/icons/support/pay/payRecordLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/support/pay/payRecordLight.svg rename to packages/web/components/common/Icon/icons/support/pay/payRecordLight.svg diff --git a/projects/app/src/components/Icon/icons/support/pay/priceLight.svg b/packages/web/components/common/Icon/icons/support/pay/priceLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/support/pay/priceLight.svg rename to packages/web/components/common/Icon/icons/support/pay/priceLight.svg diff --git a/projects/app/src/components/Icon/icons/support/permission/privateLight.svg b/packages/web/components/common/Icon/icons/support/permission/privateLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/support/permission/privateLight.svg rename to packages/web/components/common/Icon/icons/support/permission/privateLight.svg diff --git a/projects/app/src/components/Icon/icons/support/permission/publicLight.svg b/packages/web/components/common/Icon/icons/support/permission/publicLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/support/permission/publicLight.svg rename to packages/web/components/common/Icon/icons/support/permission/publicLight.svg diff --git a/projects/app/src/components/Icon/icons/support/team/memberLight.svg b/packages/web/components/common/Icon/icons/support/team/memberLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/support/team/memberLight.svg rename to packages/web/components/common/Icon/icons/support/team/memberLight.svg diff --git a/projects/app/src/components/Icon/icons/light/inform.svg b/packages/web/components/common/Icon/icons/support/user/informLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/light/inform.svg rename to packages/web/components/common/Icon/icons/support/user/informLight.svg diff --git a/projects/app/src/components/Icon/icons/fill/me.svg b/packages/web/components/common/Icon/icons/support/user/userFill.svg similarity index 100% rename from projects/app/src/components/Icon/icons/fill/me.svg rename to packages/web/components/common/Icon/icons/support/user/userFill.svg diff --git a/projects/app/src/components/Icon/icons/light/me.svg b/packages/web/components/common/Icon/icons/support/user/userLight.svg similarity index 100% rename from projects/app/src/components/Icon/icons/light/me.svg rename to packages/web/components/common/Icon/icons/support/user/userLight.svg diff --git a/projects/app/src/components/Icon/icons/text.svg b/packages/web/components/common/Icon/icons/text.svg similarity index 100% rename from projects/app/src/components/Icon/icons/text.svg rename to packages/web/components/common/Icon/icons/text.svg diff --git a/projects/app/src/components/Icon/icons/user.svg b/packages/web/components/common/Icon/icons/user.svg similarity index 100% rename from projects/app/src/components/Icon/icons/user.svg rename to packages/web/components/common/Icon/icons/user.svg diff --git a/projects/app/src/components/Icon/icons/wx.svg b/packages/web/components/common/Icon/icons/wx.svg similarity index 100% rename from projects/app/src/components/Icon/icons/wx.svg rename to packages/web/components/common/Icon/icons/wx.svg diff --git a/packages/web/components/common/Icon/index.tsx b/packages/web/components/common/Icon/index.tsx new file mode 100644 index 00000000000..ff5dd3299b9 --- /dev/null +++ b/packages/web/components/common/Icon/index.tsx @@ -0,0 +1,31 @@ +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(null); + + useEffect(() => { + iconPaths[name]?.() + .then((icon) => { + setIconComponent({ as: icon.default }); + }) + .catch((error) => console.log(error)); + }, [name]); + + return !!name && !!iconPaths[name] ? ( + + ) : null; +}; + +export default MyIcon; diff --git a/packages/web/components/common/Icon/type.d.ts b/packages/web/components/common/Icon/type.d.ts new file mode 100644 index 00000000000..91ac9091da0 --- /dev/null +++ b/packages/web/components/common/Icon/type.d.ts @@ -0,0 +1,3 @@ +import { iconPaths } from './constants'; + +export type IconNameType = keyof typeof iconPaths; diff --git a/packages/web/package.json b/packages/web/package.json index 9aae252ce1b..d7bc1cd51cf 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -4,9 +4,24 @@ "dependencies": { "@fastgpt/global": "workspace:*", "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": { - "@types/turndown": "^5.0.4" + "@types/turndown": "^5.0.4", + "@types/react": "18.2.0", + "@types/react-dom": "18.2.0" } } diff --git a/packages/web/tsconfig.json b/packages/web/tsconfig.json index 13c4daa3bed..d57aec33fb5 100644 --- a/packages/web/tsconfig.json +++ b/packages/web/tsconfig.json @@ -14,8 +14,11 @@ "isolatedModules": true, "jsx": "preserve", "incremental": true, - "baseUrl": "." + "baseUrl": ".", + "paths": { + "@/*": ["./*"] + } }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.d.ts", "../**/*.d.ts"], - "exclude": ["node_modules"] + "exclude": ["node_modules","./components/common/Icon/constants.ts"] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0bc845e98b8..5b0e1917f1c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -136,16 +136,61 @@ importers: packages/web: 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': specifier: workspace:* version: link:../global + i18next: + specifier: ^22.5.1 + version: registry.npmmirror.com/i18next@22.5.1 joplin-turndown-plugin-gfm: specifier: ^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: specifier: ^7.1.2 version: registry.npmmirror.com/turndown@7.1.2 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': specifier: ^5.0.4 version: registry.npmmirror.com/@types/turndown@5.0.4 @@ -346,112 +391,6 @@ importers: specifier: 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: registry.npmmirror.com/@aashutoshrathi/word-wrap@1.2.6: @@ -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} name: '@types/nprogress' version: 0.2.0 + dev: false 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} diff --git a/projects/app/data/config.json b/projects/app/data/config.json index 2ee834c26f8..1c21762528f 100644 --- a/projects/app/data/config.json +++ b/projects/app/data/config.json @@ -9,7 +9,8 @@ { "model": "gpt-3.5-turbo", "name": "GPT35", - "price": 0, + "inputPrice": 0, + "outputPrice": 0, "maxContext": 4000, "maxResponse": 4000, "quoteMaxToken": 2000, @@ -23,7 +24,8 @@ "name": "GPT35-16k", "maxContext": 16000, "maxResponse": 16000, - "price": 0, + "inputPrice": 0, + "outputPrice": 0, "quoteMaxToken": 8000, "maxTemperature": 1.2, "censor": false, @@ -35,7 +37,8 @@ "name": "GPT4-8k", "maxContext": 8000, "maxResponse": 8000, - "price": 0, + "inputPrice": 0, + "outputPrice": 0, "quoteMaxToken": 4000, "maxTemperature": 1.2, "censor": false, @@ -47,7 +50,8 @@ "name": "GPT4-Vision", "maxContext": 128000, "maxResponse": 4000, - "price": 0, + "inputPrice": 0, + "outputPrice": 0, "quoteMaxToken": 100000, "maxTemperature": 1.2, "censor": false, @@ -61,7 +65,8 @@ "name": "GPT35-16k", "maxContext": 16000, "maxResponse": 16000, - "price": 0 + "inputPrice": 0, + "outputPrice": 0 } ], "cqModels": [ @@ -70,7 +75,8 @@ "name": "GPT35", "maxContext": 4000, "maxResponse": 4000, - "price": 0, + "inputPrice": 0, + "outputPrice": 0, "toolChoice": true, "functionPrompt": "" }, @@ -79,7 +85,8 @@ "name": "GPT4-8k", "maxContext": 8000, "maxResponse": 8000, - "price": 0, + "inputPrice": 0, + "outputPrice": 0, "toolChoice": true, "functionPrompt": "" } @@ -90,7 +97,8 @@ "name": "GPT35-1106", "maxContext": 16000, "maxResponse": 4000, - "price": 0, + "inputPrice": 0, + "outputPrice": 0, "toolChoice": true, "functionPrompt": "" } @@ -101,14 +109,16 @@ "name": "GPT35-1106", "maxContext": 1600, "maxResponse": 4000, - "price": 0 + "inputPrice": 0, + "outputPrice": 0 } ], "vectorModels": [ { "model": "text-embedding-ada-002", "name": "Embedding-2", - "price": 0.2, + "inputPrice": 0, + "outputPrice": 0, "defaultToken": 700, "maxToken": 3000, "weight": 100 @@ -119,7 +129,8 @@ { "model": "tts-1", "name": "OpenAI TTS1", - "price": 0, + "inputPrice": 0, + "outputPrice": 0, "voices": [ { "label": "Alloy", "value": "alloy", "bufferId": "openai-Alloy" }, { "label": "Echo", "value": "echo", "bufferId": "openai-Echo" }, @@ -133,6 +144,7 @@ "whisperModel": { "model": "whisper-1", "name": "Whisper1", - "price": 0 + "inputPrice": 0, + "outputPrice": 0 } } diff --git a/projects/app/public/imgs/modal/shareFill.svg b/projects/app/public/imgs/modal/shareFill.svg new file mode 100644 index 00000000000..8f000c73482 --- /dev/null +++ b/projects/app/public/imgs/modal/shareFill.svg @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/projects/app/public/imgs/modal/shareLight.svg b/projects/app/public/imgs/modal/shareLight.svg deleted file mode 100644 index 04b18a98589..00000000000 --- a/projects/app/public/imgs/modal/shareLight.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/projects/app/public/locales/en/common.json b/projects/app/public/locales/en/common.json index 45346ea6596..e75b2f10325 100644 --- a/projects/app/public/locales/en/common.json +++ b/projects/app/public/locales/en/common.json @@ -133,7 +133,9 @@ "Name is empty": "Name is empty", "New Create": "Create", "Next Step": "Next", + "Not open": "Close", "OK": "OK", + "Opened": "Opened", "Output": "Output", "Params": "Params", "Password inconsistency": "Password inconsistency", @@ -244,12 +246,13 @@ "create app": "Create App", "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!", + "Open cfr": "Open Cfr", "Out Ad Edit": "You are about to exit the Advanced orchestration page, please confirm", "Prompt Editor": "Prompt Editor", "Save and out": "Save out", "UnSave": "UnSave", - "cfr background prompt": "Question completion - 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 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 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": { "Custom feedback": "Custom feedback", @@ -637,7 +640,7 @@ "TFSwitch": "", "TFSwitch intro": "", "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.", "textEditor": "Text Editor", "textEditor intro": "Output of fixed or incoming text after edit" diff --git a/projects/app/public/locales/zh/common.json b/projects/app/public/locales/zh/common.json index a77c40120dd..a4826e3be6e 100644 --- a/projects/app/public/locales/zh/common.json +++ b/projects/app/public/locales/zh/common.json @@ -133,7 +133,9 @@ "Name is empty": "名称不能为空", "New Create": "新建", "Next Step": "下一步", + "Not open": "未开启", "OK": "好的", + "Opened": "已开启", "Output": "输出", "Params": "参数", "Password inconsistency": "两次密码不一致", @@ -244,12 +246,13 @@ "create app": "创建属于你的 AI 应用", "edit": { "Confirm Save App Tip": "该应用可能为高级编排模式,保存后将会覆盖高级编排配置,请确认!", + "Open cfr": "开启自动补全", "Out Ad Edit": "您即将退出高级编排页面,请确认", "Prompt Editor": "提示词编辑", "Save and out": "保存并退出", "UnSave": "不保存", - "cfr background prompt": "问题补全 - 对话背景描述", - "cfr background tip": "描述当前对话的范围,便于AI补全首次问题或模糊的问题,从而增强知识库连续对话的能力。\n为空时,表示不使用问题补全功能。" + "cfr background prompt": "对话背景描述", + "cfr background tip": "描述当前对话的范围,便于AI补全首次问题或模糊的问题,从而增强知识库连续对话的能力。\n值为空时,表示【首个问题】不使用问题补全功能。\n值为 none 时,表示不使用问题补全功能。" }, "feedback": { "Custom feedback": "自定义反馈", diff --git a/projects/app/src/components/ChatBox/MessageInput.tsx b/projects/app/src/components/ChatBox/MessageInput.tsx index b252939e161..35115679009 100644 --- a/projects/app/src/components/ChatBox/MessageInput.tsx +++ b/projects/app/src/components/ChatBox/MessageInput.tsx @@ -4,8 +4,7 @@ import { Box, Flex, Image, Spinner, Textarea } from '@chakra-ui/react'; import React, { useRef, useEffect, useCallback, useState } from 'react'; import { useTranslation } from 'next-i18next'; import MyTooltip from '../MyTooltip'; -import MyIcon from '../Icon'; -import styles from './index.module.scss'; +import MyIcon from '@fastgpt/web/components/common/Icon'; import { useRouter } from 'next/router'; import { useSelectFile } from '@/web/common/file/hooks/useSelectFile'; import { compressImgFileAndUpload } from '@/web/common/file/controller'; @@ -137,7 +136,7 @@ const MessageInput = ({ rawFile: file, type: FileTypeEnum.file, name: file.name, - icon: 'pdf' + icon: 'file/pdf' }); } }) diff --git a/projects/app/src/components/ChatBox/SelectMarkCollection.tsx b/projects/app/src/components/ChatBox/SelectMarkCollection.tsx index 39f8f5024c5..db67d9b7b9f 100644 --- a/projects/app/src/components/ChatBox/SelectMarkCollection.tsx +++ b/projects/app/src/components/ChatBox/SelectMarkCollection.tsx @@ -2,7 +2,7 @@ import React, { useMemo, useState } from 'react'; import { ModalBody, useTheme, ModalFooter, Button, Box, Card, Flex, Grid } from '@chakra-ui/react'; import { useTranslation } from 'next-i18next'; 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 DatasetSelectModal, { useDatasetSelect } from '@/components/core/dataset/SelectModal'; import dynamic from 'next/dynamic'; diff --git a/projects/app/src/components/ChatBox/index.tsx b/projects/app/src/components/ChatBox/index.tsx index 323e0014722..ef09f57249d 100644 --- a/projects/app/src/components/ChatBox/index.tsx +++ b/projects/app/src/components/ChatBox/index.tsx @@ -51,7 +51,7 @@ import { } from '@/web/core/chat/api'; import type { AdminMarkType } from './SelectMarkCollection'; -import MyIcon from '@/components/Icon'; +import MyIcon from '@fastgpt/web/components/common/Icon'; import Avatar from '@/components/Avatar'; import Markdown, { CodeClassName } from '@/components/Markdown'; import MySelect from '@/components/Select'; @@ -629,7 +629,7 @@ const ChatBox = ( ))} {!variableIsFinish && ( + + {appDetail.isOwner && ( + + )} + + + + + + {settingAppInfo && ( + setSettingAppInfo(undefined)} /> + )} + + ); +}; + +export default React.memo(AppCard); diff --git a/projects/app/src/pages/app/detail/components/SimpleEdit/CfrEditModal.tsx b/projects/app/src/pages/app/detail/components/SimpleEdit/CfrEditModal.tsx new file mode 100644 index 00000000000..ff62e02342a --- /dev/null +++ b/projects/app/src/pages/app/detail/components/SimpleEdit/CfrEditModal.tsx @@ -0,0 +1,61 @@ +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 ( + + + {t('core.app.edit.cfr background prompt')} + + + + { + setValue(e.target.value || ''); + }} + /> + + + + + + ); +}; + +export default React.memo(CfrEditModal); diff --git a/projects/app/src/pages/app/detail/components/SimpleEdit/ChatTest.tsx b/projects/app/src/pages/app/detail/components/SimpleEdit/ChatTest.tsx new file mode 100644 index 00000000000..5e49bcd156c --- /dev/null +++ b/projects/app/src/pages/app/detail/components/SimpleEdit/ChatTest.tsx @@ -0,0 +1,133 @@ +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(null); + const [modules, setModules] = useState([]); + + 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 ( + + + + {t('app.Chat Debug')} + + + } + variant={'whiteDanger'} + borderRadius={'md'} + aria-label={'delete'} + onClick={(e) => { + e.stopPropagation(); + resetChatBox(); + }} + /> + + + + {}} + /> + + {appDetail.type !== AppTypeEnum.simple && ( + + {t('app.Advance App TestTip')} + + )} + + ); +}; + +export default React.memo(ChatTest); diff --git a/projects/app/src/pages/app/detail/components/SimpleEdit/EditForm.tsx b/projects/app/src/pages/app/detail/components/SimpleEdit/EditForm.tsx new file mode 100644 index 00000000000..cf4eadbe6eb --- /dev/null +++ b/projects/app/src/pages/app/detail/components/SimpleEdit/EditForm.tsx @@ -0,0 +1,546 @@ +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; + 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({ + 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 ( + + {/* title */} + + + + {t('core.app.App params config')} + + + + + + + + + + + {/* simple mode select */} + + + {''} + {t('core.app.simple.mode template select')} + + ({ + alias: item.name, + label: item.desc, + value: item.id + })) || [] + } + value={getValues('templateId')} + onchange={(val) => { + setValue('templateId', val); + setRefresh(!refresh); + }} + /> + + + {/* ai */} + {selectSimpleTemplate?.systemForm?.aiSettings && ( + + + {''} + + {t('app.AI Settings')} + + {(selectSimpleTemplate.systemForm.aiSettings.maxToken || + selectSimpleTemplate.systemForm.aiSettings.temperature || + selectSimpleTemplate.systemForm.aiSettings.quoteTemplate || + selectSimpleTemplate.systemForm.aiSettings.quotePrompt) && ( + + + {t('app.Open AI Advanced Settings')} + + )} + + {selectSimpleTemplate.systemForm.aiSettings?.model && ( + + {t('core.ai.Model')} + + { + 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); + }} + /> + + + )} + + {selectSimpleTemplate.systemForm.aiSettings?.systemPrompt && ( + + + {t('core.ai.Prompt')} + + + + + { + setValue('aiSettings.systemPrompt', e.target.value || ''); + }} + /> + + )} + + )} + + {/* dataset */} + {selectSimpleTemplate?.systemForm?.dataset && ( + + + + {''} + {t('core.dataset.Choose Dataset')} + + {selectSimpleTemplate.systemForm.dataset.datasets && ( + + + {t('common.Choose')} + + )} + {(selectSimpleTemplate.systemForm.dataset.limit || + selectSimpleTemplate.systemForm.dataset.searchMode || + selectSimpleTemplate.systemForm.dataset.searchEmptyText || + selectSimpleTemplate.systemForm.dataset.similarity) && ( + + + {t('common.Params')} + + )} + + {getValues('dataset.datasets').length > 0 && ( + + {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')} + + )} + + {selectDatasets.map((item) => ( + + + router.push({ + pathname: '/dataset/detail', + query: { + datasetId: item._id + } + }) + } + > + + + {item.name} + + + + ))} + + + )} + + {/* cfr */} + {selectSimpleTemplate?.systemForm?.cfr && getValues('dataset.datasets').length > 0 && ( + + {''} + {t('core.module.template.cfr')} + + + + + + {getValues('cfr.background') === 'none' ? t('common.Not open') : t('common.Opened')} + + + )} + + {/* variable */} + {selectSimpleTemplate?.systemForm?.userGuide?.variables && ( + + { + setValue('userGuide.variables', e); + setRefresh(!refresh); + }} + /> + + )} + + {/* welcome */} + {selectSimpleTemplate?.systemForm?.userGuide?.welcomeText && ( + + + {''} + {t('core.app.Welcome Text')} + + + + + { + setValue('userGuide.welcomeText', e.target.value || ''); + }} + /> + + )} + + {/* tts */} + {selectSimpleTemplate?.systemForm?.userGuide?.tts && ( + + { + setValue('userGuide.tts', e); + setRefresh((state) => !state); + }} + /> + + )} + + {/* question guide */} + {selectSimpleTemplate?.systemForm?.userGuide?.questionGuide && ( + + { + const value = e.target.checked; + setValue('userGuide.questionGuide', value); + setRefresh((state) => !state); + }} + /> + + )} + + + + + {isOpenAIChatSetting && ( + { + setValue('aiSettings', e); + onCloseAIChatSetting(); + }} + defaultData={getValues('aiSettings')} + simpleModeTemplate={selectSimpleTemplate} + /> + )} + {isOpenDatasetSelect && ( + ({ + datasetId: item._id, + vectorModel: item.vectorModel + }))} + onClose={onCloseKbSelect} + onChange={replaceKbList} + /> + )} + {isOpenDatasetParams && ( + { + setValue('dataset', { + ...getValues('dataset'), + ...e + }); + + setRefresh((state) => !state); + }} + /> + )} + {isOpenCfrModal && ( + { + setValue('cfr.background', e); + }} + /> + )} + + ); +}; + +export default React.memo(EditForm); diff --git a/projects/app/src/pages/app/detail/components/SimpleEdit/index.tsx b/projects/app/src/pages/app/detail/components/SimpleEdit/index.tsx index d4d60ccebde..3ae2bdc319f 100644 --- a/projects/app/src/pages/app/detail/components/SimpleEdit/index.tsx +++ b/projects/app/src/pages/app/detail/components/SimpleEdit/index.tsx @@ -1,813 +1,36 @@ -import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import { - 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 React from 'react'; +import { Box, Grid } from '@chakra-ui/react'; 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 { 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')); -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')); +import ChatTest from './ChatTest'; +import AppCard from './AppCard'; +import EditForm from './EditForm'; -function ConfigForm({ - divRef, - isSticky -}: { - divRef: React.RefObject; - isSticky: boolean; -}) { - const theme = useTheme(); - const router = useRouter(); - const { t } = useTranslation(); - const { appDetail, updateAppDetail } = useAppStore(); - const { loadAllDatasets, allDatasets } = useDatasetStore(); +const SimpleEdit = ({ appId }: { appId: string }) => { const { isPc } = useSystemStore(); - const [refresh, setRefresh] = useState(false); - - const { register, setValue, getValues, reset, handleSubmit, control } = - useForm({ - 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 ( - - {/* title */} - - - {t('core.app.App params config')} - - - - - - - - - {/* simple mode select */} - - - {''} - {t('core.app.simple.mode template select')} - - ({ - alias: item.name, - label: item.desc, - value: item.id - })) || [] - } - value={getValues('templateId')} - onchange={(val) => { - setValue('templateId', val); - setRefresh(!refresh); - }} - /> - - - {/* ai */} - {selectSimpleTemplate?.systemForm?.aiSettings && ( - - - {''} - - {t('app.AI Settings')} - - {(selectSimpleTemplate.systemForm.aiSettings.maxToken || - selectSimpleTemplate.systemForm.aiSettings.temperature || - selectSimpleTemplate.systemForm.aiSettings.quoteTemplate || - selectSimpleTemplate.systemForm.aiSettings.quotePrompt) && ( - - - {t('app.Open AI Advanced Settings')} - - )} - - {selectSimpleTemplate.systemForm.aiSettings?.model && ( - - {t('core.ai.Model')} - - { - 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); - }} - /> - - - )} - - {selectSimpleTemplate.systemForm.aiSettings?.systemPrompt && ( - - - {t('core.ai.Prompt')} - - - - - { - setValue('aiSettings.systemPrompt', e.target.value || ''); - }} - /> - - )} - - )} - - {/* dataset */} - {selectSimpleTemplate?.systemForm?.dataset && ( - - - - {''} - {t('core.dataset.Choose Dataset')} - - {selectSimpleTemplate.systemForm.dataset.datasets && ( - - - {t('common.Choose')} - - )} - {(selectSimpleTemplate.systemForm.dataset.limit || - selectSimpleTemplate.systemForm.dataset.searchMode || - selectSimpleTemplate.systemForm.dataset.searchEmptyText || - selectSimpleTemplate.systemForm.dataset.similarity) && ( - - - {t('common.Params')} - - )} - - {getValues('dataset.datasets').length > 0 && ( - - {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')} - - )} - - {selectDatasets.map((item) => ( - - - router.push({ - pathname: '/dataset/detail', - query: { - datasetId: item._id - } - }) - } - > - - - {item.name} - - - - ))} - - - {selectSimpleTemplate?.systemForm?.cfr && getValues('dataset.datasets').length > 0 && ( - - - {t('core.app.edit.cfr background prompt')} - - - - - { - setValue('cfr.background', e.target.value || ''); - }} - /> - - )} - - )} - - {/* variable */} - {selectSimpleTemplate?.systemForm?.userGuide?.variables && ( - - { - setValue('userGuide.variables', e); - setRefresh(!refresh); - }} - /> - - )} - - {/* welcome */} - {selectSimpleTemplate?.systemForm?.userGuide?.welcomeText && ( - - - {''} - {t('core.app.Welcome Text')} - - - - - { - setValue('userGuide.welcomeText', e.target.value || ''); - }} - /> - - )} - - {/* tts */} - {selectSimpleTemplate?.systemForm?.userGuide?.tts && ( - - { - setValue('userGuide.tts', e); - setRefresh((state) => !state); - }} - /> - - )} - - {/* question guide */} - {selectSimpleTemplate?.systemForm?.userGuide?.questionGuide && ( - - { - const value = e.target.checked; - setValue('userGuide.questionGuide', value); - setRefresh((state) => !state); - }} - /> - - )} - - - - {isOpenAIChatSetting && ( - { - setValue('aiSettings', e); - onCloseAIChatSetting(); - }} - defaultData={getValues('aiSettings')} - simpleModeTemplate={selectSimpleTemplate} - /> - )} - {isOpenDatasetSelect && ( - ({ - datasetId: item._id, - vectorModel: item.vectorModel - }))} - onClose={onCloseKbSelect} - onChange={replaceKbList} - /> - )} - {isOpenDatasetParams && ( - { - setValue('dataset', { - ...getValues('dataset'), - ...e - }); - - setRefresh((state) => !state); - }} - /> - )} - - ); -} - -function Settings({ appId }: { appId: string }) { - const theme = useTheme(); - const router = useRouter(); - const { t } = useTranslation(); - const { toast } = useToast(); const { parentRef, divRef, isSticky } = useSticky(); - const { appDetail } = useAppStore(); - const [settingAppInfo, setSettingAppInfo] = useState(); - - 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 ( - - - - - - - - AppId:{' '} - - {appId} - - - - {/* basic info */} - - - - - {appDetail.name} - - {appDetail.isOwner && ( - } - variant={'whiteDanger'} - borderRadius={'md'} - aria-label={'delete'} - isLoading={isLoading} - onClick={openConfirmDel(handleDelModel)} - /> - )} - - - {appDetail.intro || '快来给应用一个介绍~'} - - - - - {appDetail.isOwner && ( - - )} - - - - {/* config form */} - - - - {settingAppInfo && ( - setSettingAppInfo(undefined)} /> - )} - - ); -} - -function ChatTest({ appId }: { appId: string }) { - const { t } = useTranslation(); - const { userInfo } = useUserStore(); - const { appDetail } = useAppStore(); - const ChatBoxRef = useRef(null); - const [modules, setModules] = useState([]); - - 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 ( - - - - {t('app.Chat Debug')} + + - - } - variant={'whiteDanger'} - borderRadius={'md'} - aria-label={'delete'} - onClick={(e) => { - e.stopPropagation(); - resetChatBox(); - }} - /> - - - - {}} - /> - {appDetail.type !== AppTypeEnum.simple && ( - - {t('app.Advance App TestTip')} - - )} - - ); -} - -const SimpleEdit = ({ appId }: { appId: string }) => { - const { isPc } = useSystemStore(); - return ( - - {isPc && } ); }; -export default SimpleEdit; +export default React.memo(SimpleEdit); diff --git a/projects/app/src/pages/app/detail/index.tsx b/projects/app/src/pages/app/detail/index.tsx index 7d9989416aa..03991d2f8f4 100644 --- a/projects/app/src/pages/app/detail/index.tsx +++ b/projects/app/src/pages/app/detail/index.tsx @@ -9,7 +9,7 @@ import { feConfigs } from '@/web/common/system/staticData'; import Tabs from '@/components/Tabs'; import SideTabs from '@/components/SideTabs'; import Avatar from '@/components/Avatar'; -import MyIcon from '@/components/Icon'; +import MyIcon from '@fastgpt/web/components/common/Icon'; import PageContainer from '@/components/PageContainer'; import Loading from '@/components/Loading'; import SimpleEdit from './components/SimpleEdit'; @@ -52,13 +52,13 @@ const AppDetail = ({ currentTab }: { currentTab: `${TabEnum}` }) => { const tabList = useMemo( () => [ - { label: '简易配置', id: TabEnum.simpleEdit, icon: 'overviewLight' }, + { label: '简易配置', id: TabEnum.simpleEdit, icon: 'common/overviewLight' }, ...(feConfigs?.hide_app_flow ? [] - : [{ label: '高级编排', id: TabEnum.adEdit, icon: 'settingLight' }]), - { label: '外部使用', id: TabEnum.outLink, icon: 'shareLight' }, + : [{ label: '高级编排', id: TabEnum.adEdit, icon: 'common/settingLight' }]), + { label: '外部使用', id: TabEnum.outLink, icon: 'support/outlink/shareLight' }, { 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}` }) => { > } + icon={} bg={'white'} boxShadow={'1px 1px 9px rgba(0,0,0,0.15)'} size={'smSquare'} diff --git a/projects/app/src/pages/app/list/index.tsx b/projects/app/src/pages/app/list/index.tsx index ee9ca67e68f..b7094cae3c3 100644 --- a/projects/app/src/pages/app/list/index.tsx +++ b/projects/app/src/pages/app/list/index.tsx @@ -19,7 +19,7 @@ import { useConfirm } from '@/web/common/hooks/useConfirm'; import { serviceSideProps } from '@/web/common/utils/i18n'; import { useTranslation } from 'next-i18next'; -import MyIcon from '@/components/Icon'; +import MyIcon from '@fastgpt/web/components/common/Icon'; import PageContainer from '@/components/PageContainer'; import Avatar from '@/components/Avatar'; import MyTooltip from '@/components/MyTooltip'; @@ -164,7 +164,7 @@ const MyApps = () => { variant={'whitePrimary'} icon={ - + } aria-label={'chat'} diff --git a/projects/app/src/pages/appStore/components/list.tsx b/projects/app/src/pages/appStore/components/list.tsx index 42e01c0f041..e4361eaffc3 100644 --- a/projects/app/src/pages/appStore/components/list.tsx +++ b/projects/app/src/pages/appStore/components/list.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { Box, Flex, Button, Card } from '@chakra-ui/react'; import type { ShareAppItem } from '@/types/app'; import { useRouter } from 'next/router'; -import MyIcon from '@/components/Icon'; +import MyIcon from '@fastgpt/web/components/common/Icon'; import Avatar from '@/components/Avatar'; import MyTooltip from '@/components/MyTooltip'; diff --git a/projects/app/src/pages/chat/components/ChatHeader.tsx b/projects/app/src/pages/chat/components/ChatHeader.tsx index 32002bb4ed9..b80cb3b2bd9 100644 --- a/projects/app/src/pages/chat/components/ChatHeader.tsx +++ b/projects/app/src/pages/chat/components/ChatHeader.tsx @@ -1,7 +1,7 @@ import React, { useMemo } from 'react'; import { Flex, useTheme, Box } from '@chakra-ui/react'; 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 Avatar from '@/components/Avatar'; import ToolMenu from './ToolMenu'; diff --git a/projects/app/src/pages/chat/components/ChatHistorySlider.tsx b/projects/app/src/pages/chat/components/ChatHistorySlider.tsx index 231d172c215..767615220ea 100644 --- a/projects/app/src/pages/chat/components/ChatHistorySlider.tsx +++ b/projects/app/src/pages/chat/components/ChatHistorySlider.tsx @@ -15,7 +15,7 @@ import { useEditTitle } from '@/web/common/hooks/useEditTitle'; import { useRouter } from 'next/router'; import Avatar from '@/components/Avatar'; import MyTooltip from '@/components/MyTooltip'; -import MyIcon from '@/components/Icon'; +import MyIcon from '@fastgpt/web/components/common/Icon'; import { useTranslation } from 'next-i18next'; import { useConfirm } from '@/web/common/hooks/useConfirm'; import Tabs from '@/components/Tabs'; @@ -156,7 +156,7 @@ const ChatHistorySlider = ({ h={'100%'} color={'primary.600'} borderRadius={'xl'} - leftIcon={} + leftIcon={} overflow={'hidden'} onClick={() => onChangeChat()} > @@ -173,7 +173,7 @@ const ChatHistorySlider = ({ borderRadius={'50%'} onClick={openConfirm(onClearHistory)} > - + )} @@ -211,7 +211,10 @@ const ChatHistorySlider = ({ } })} > - + {item.customTitle || item.title} @@ -236,7 +239,7 @@ const ChatHistorySlider = ({ onSetHistoryTop({ chatId: item.id, top: !item.top }); }} > - + {item.top ? '取消置顶' : '置顶'} )} @@ -254,7 +257,7 @@ const ChatHistorySlider = ({ }); }} > - + {t('common.Custom Title')} )} @@ -326,7 +329,7 @@ const ChatHistorySlider = ({ > } + icon={} bg={'white'} boxShadow={'1px 1px 9px rgba(0,0,0,0.15)'} size={'smSquare'} diff --git a/projects/app/src/pages/chat/components/SliderApps.tsx b/projects/app/src/pages/chat/components/SliderApps.tsx index de64417a8ca..5960a46f7f5 100644 --- a/projects/app/src/pages/chat/components/SliderApps.tsx +++ b/projects/app/src/pages/chat/components/SliderApps.tsx @@ -3,7 +3,7 @@ import { Flex, Box, IconButton } from '@chakra-ui/react'; import { useRouter } from 'next/router'; import { useQuery } from '@tanstack/react-query'; import { useTranslation } from 'next-i18next'; -import MyIcon from '@/components/Icon'; +import MyIcon from '@fastgpt/web/components/common/Icon'; import Avatar from '@/components/Avatar'; import { useAppStore } from '@/web/core/app/store/useAppStore'; @@ -28,7 +28,7 @@ const SliderApps = ({ appId }: { appId: string }) => { > } + icon={} bg={'white'} boxShadow={'1px 1px 9px rgba(0,0,0,0.15)'} size={'smSquare'} diff --git a/projects/app/src/pages/chat/components/ToolMenu.tsx b/projects/app/src/pages/chat/components/ToolMenu.tsx index c5e27af499f..af4b91dc2e8 100644 --- a/projects/app/src/pages/chat/components/ToolMenu.tsx +++ b/projects/app/src/pages/chat/components/ToolMenu.tsx @@ -2,7 +2,7 @@ import React, { useMemo } from 'react'; import { useChatBox } from '@/components/ChatBox'; import type { ChatItemType } from '@fastgpt/global/core/chat/type.d'; 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'; const ToolMenu = ({ history }: { history: ChatItemType[] }) => { @@ -12,7 +12,7 @@ const ToolMenu = ({ history }: { history: ChatItemType[] }) => { const menuList = useMemo( () => [ { - icon: 'chat', + icon: 'core/chat/chatLight', label: '新对话', onClick: () => { router.replace({ @@ -24,16 +24,16 @@ const ToolMenu = ({ history }: { history: ChatItemType[] }) => { } }, { - icon: 'apiLight', + icon: 'core/app/appApiLight', label: 'HTML导出', onClick: () => onExportChat({ type: 'html', history }) }, { - icon: 'markdown', + icon: 'file/markdown', label: 'Markdown导出', 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] ); diff --git a/projects/app/src/pages/dataset/detail/components/CollectionCard.tsx b/projects/app/src/pages/dataset/detail/components/CollectionCard.tsx index f021f791065..e2dce4bcefc 100644 --- a/projects/app/src/pages/dataset/detail/components/CollectionCard.tsx +++ b/projects/app/src/pages/dataset/detail/components/CollectionCard.tsx @@ -28,7 +28,7 @@ import { useQuery } from '@tanstack/react-query'; import { debounce } from 'lodash'; import { useConfirm } from '@/web/common/hooks/useConfirm'; import { useTranslation } from 'next-i18next'; -import MyIcon from '@/components/Icon'; +import MyIcon from '@fastgpt/web/components/common/Icon'; import MyInput from '@/components/MyInput'; import dayjs from 'dayjs'; import { useRequest } from '@/web/common/hooks/useRequest'; @@ -386,7 +386,7 @@ const CollectionCard = () => { color={'white'} h={['28px', '35px']} > - + {t('dataset.collections.Create And Import')} diff --git a/projects/app/src/pages/dataset/detail/components/DataCard.tsx b/projects/app/src/pages/dataset/detail/components/DataCard.tsx index e126a9d74c7..9286c37573d 100644 --- a/projects/app/src/pages/dataset/detail/components/DataCard.tsx +++ b/projects/app/src/pages/dataset/detail/components/DataCard.tsx @@ -29,7 +29,7 @@ import { getErrText } from '@fastgpt/global/common/error/utils'; import { useConfirm } from '@/web/common/hooks/useConfirm'; import { useTranslation } from 'next-i18next'; import { useRouter } from 'next/router'; -import MyIcon from '@/components/Icon'; +import MyIcon from '@fastgpt/web/components/common/Icon'; import MyInput from '@/components/MyInput'; import { useLoading } from '@/web/common/hooks/useLoading'; import InputDataModal, { RawSourceText, type InputDataType } from '../components/InputDataModal'; @@ -167,7 +167,7 @@ const DataCard = () => { } + icon={} variant={'whitePrimary'} size={'smSquare'} borderRadius={'50%'} diff --git a/projects/app/src/pages/dataset/detail/components/Import/FileSelect.tsx b/projects/app/src/pages/dataset/detail/components/Import/FileSelect.tsx index dbc1cde7f0e..f4917cda0c4 100644 --- a/projects/app/src/pages/dataset/detail/components/Import/FileSelect.tsx +++ b/projects/app/src/pages/dataset/detail/components/Import/FileSelect.tsx @@ -1,4 +1,4 @@ -import MyIcon from '@/components/Icon'; +import MyIcon from '@fastgpt/web/components/common/Icon'; import { useLoading } from '@/web/common/hooks/useLoading'; import { useSelectFile } from '@/web/common/file/hooks/useSelectFile'; import { useToast } from '@/web/common/hooks/useToast'; @@ -392,7 +392,7 @@ const FileSelect = ({ onDrop={handleDrop} > - + {isDragging ? ( t('file.Release the mouse to upload the file') ) : ( diff --git a/projects/app/src/pages/dataset/detail/components/Import/ImportModal.tsx b/projects/app/src/pages/dataset/detail/components/Import/ImportModal.tsx index 6d91b69827b..1848e947b9a 100644 --- a/projects/app/src/pages/dataset/detail/components/Import/ImportModal.tsx +++ b/projects/app/src/pages/dataset/detail/components/Import/ImportModal.tsx @@ -98,19 +98,19 @@ const ImportData = ({ gridTemplateColumns={['repeat(1,1fr)', 'repeat(3,1fr)']} list={[ { - icon: 'indexImport', + icon: 'file/indexImport', title: t('core.dataset.import.Chunk Split'), desc: t('core.dataset.import.Chunk Split Tip'), value: ImportTypeEnum.chunk }, { - icon: 'qaImport', + icon: 'file/qaImport', title: t('core.dataset.import.QA Import'), desc: t('core.dataset.import.QA Import Tip'), value: ImportTypeEnum.qa }, { - icon: 'csvImport', + icon: 'file/csv', title: t('core.dataset.import.CSV Import'), desc: t('core.dataset.import.CSV Import Tip'), value: ImportTypeEnum.csv diff --git a/projects/app/src/pages/dataset/detail/components/Import/Provider.tsx b/projects/app/src/pages/dataset/detail/components/Import/Provider.tsx index 2406ec11bb8..52625fd97dc 100644 --- a/projects/app/src/pages/dataset/detail/components/Import/Provider.tsx +++ b/projects/app/src/pages/dataset/detail/components/Import/Provider.tsx @@ -22,8 +22,8 @@ import { } from '@fastgpt/global/core/dataset/constant'; import { Box, Flex, Image, useTheme } from '@chakra-ui/react'; import { CloseIcon } from '@chakra-ui/icons'; -import DeleteIcon, { hoverDeleteStyles } from '@/components/Icon/delete'; -import MyIcon from '@/components/Icon'; +import DeleteIcon, { hoverDeleteStyles } from '@fastgpt/web/components/common/Icon/delete'; +import MyIcon from '@fastgpt/web/components/common/Icon'; import { chunksUpload } from '@/web/core/dataset/utils'; import { postCreateTrainingBill } from '@/web/support/wallet/bill/api'; import { useTranslation } from 'next-i18next'; diff --git a/projects/app/src/pages/dataset/detail/components/InputDataModal.tsx b/projects/app/src/pages/dataset/detail/components/InputDataModal.tsx index e5bdb6b621c..53856041450 100644 --- a/projects/app/src/pages/dataset/detail/components/InputDataModal.tsx +++ b/projects/app/src/pages/dataset/detail/components/InputDataModal.tsx @@ -9,7 +9,7 @@ import { } from '@/web/core/dataset/api'; import { useToast } from '@/web/common/hooks/useToast'; 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 MyTooltip from '@/components/MyTooltip'; import { QuestionOutlineIcon } from '@chakra-ui/icons'; @@ -26,7 +26,7 @@ import { DatasetDataIndexTypeEnum } from '@fastgpt/global/core/dataset/constant' import { DatasetDataIndexItemType } from '@fastgpt/global/core/dataset/type'; import SideTabs from '@/components/SideTabs'; 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 { getDocPath } from '@/web/common/system/doc'; @@ -83,7 +83,7 @@ const InputDataModal = ({ }); 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 }), id: TabEnum.index, diff --git a/projects/app/src/pages/dataset/detail/components/Test.tsx b/projects/app/src/pages/dataset/detail/components/Test.tsx index ed3f4e031e7..09f753e48a1 100644 --- a/projects/app/src/pages/dataset/detail/components/Test.tsx +++ b/projects/app/src/pages/dataset/detail/components/Test.tsx @@ -18,7 +18,7 @@ import { import { useDatasetStore } from '@/web/core/dataset/store/dataset'; import { useSearchTestStore, SearchTestStoreItemType } from '@/web/core/dataset/store/searchTest'; 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 { formatTimeToChatTime } from '@/utils/tools'; import { getErrText } from '@fastgpt/global/common/error/utils'; @@ -190,7 +190,7 @@ const Test = ({ datasetId }: { datasetId: string }) => { // { // label: ( // - // + // // // {t('core.dataset.test.Batch test')} // @@ -244,7 +244,7 @@ const Test = ({ datasetId }: { datasetId: string }) => { }} onClick={onOpen} > - + {selectFile ? selectFile.name : t('core.dataset.test.Batch test Placeholder')} diff --git a/projects/app/src/pages/dataset/detail/index.tsx b/projects/app/src/pages/dataset/detail/index.tsx index f1e451f6b5e..ad7f7ca0254 100644 --- a/projects/app/src/pages/dataset/detail/index.tsx +++ b/projects/app/src/pages/dataset/detail/index.tsx @@ -7,7 +7,7 @@ import { getErrText } from '@fastgpt/global/common/error/utils'; import { useSystemStore } from '@/web/common/system/useSystemStore'; import Tabs from '@/components/Tabs'; import dynamic from 'next/dynamic'; -import MyIcon from '@/components/Icon'; +import MyIcon from '@fastgpt/web/components/common/Icon'; import SideTabs from '@/components/SideTabs'; import PageContainer from '@/components/PageContainer'; import Avatar from '@/components/Avatar'; @@ -54,10 +54,10 @@ const Detail = ({ datasetId, currentTab }: { datasetId: string; currentTab: `${T const { userInfo } = useUserStore(); 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' }, ...(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 > } + icon={} bg={'white'} boxShadow={'1px 1px 9px rgba(0,0,0,0.15)'} size={'smSquare'} diff --git a/projects/app/src/pages/dataset/list/component/MoveModal.tsx b/projects/app/src/pages/dataset/list/component/MoveModal.tsx index 381e11112e3..e96a19702ca 100644 --- a/projects/app/src/pages/dataset/list/component/MoveModal.tsx +++ b/projects/app/src/pages/dataset/list/component/MoveModal.tsx @@ -13,7 +13,7 @@ import { import Avatar from '@/components/Avatar'; import MyTooltip from '@/components/MyTooltip'; 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 { useTranslation } from 'next-i18next'; import { useQuery } from '@tanstack/react-query'; diff --git a/projects/app/src/pages/dataset/list/index.tsx b/projects/app/src/pages/dataset/list/index.tsx index b76c497695f..9482534dc27 100644 --- a/projects/app/src/pages/dataset/list/index.tsx +++ b/projects/app/src/pages/dataset/list/index.tsx @@ -25,7 +25,7 @@ import { } from '@/web/core/dataset/api'; import { useTranslation } from 'next-i18next'; 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 dynamic from 'next/dynamic'; import { diff --git a/projects/app/src/pages/login/components/LoginForm.tsx b/projects/app/src/pages/login/components/LoginForm.tsx index 0714d87c95e..79f9dbba043 100644 --- a/projects/app/src/pages/login/components/LoginForm.tsx +++ b/projects/app/src/pages/login/components/LoginForm.tsx @@ -19,7 +19,7 @@ import type { ResLogin } from '@/global/support/api/userRes'; import { useToast } from '@/web/common/hooks/useToast'; import { feConfigs } from '@/web/common/system/staticData'; 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 { getDocPath } from '@/web/common/system/doc'; import Avatar from '@/components/Avatar'; @@ -86,7 +86,7 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => { { label: t('support.user.login.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` } ] @@ -96,7 +96,7 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => { { label: t('support.user.login.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` } ] diff --git a/projects/app/src/pages/plugin/edit/Header.tsx b/projects/app/src/pages/plugin/edit/Header.tsx index af73a51fac9..0d9b8fb0486 100644 --- a/projects/app/src/pages/plugin/edit/Header.tsx +++ b/projects/app/src/pages/plugin/edit/Header.tsx @@ -5,7 +5,7 @@ import { useRequest } from '@/web/common/hooks/useRequest'; import { useTranslation } from 'next-i18next'; import { useCopyData } from '@/web/common/hooks/useCopyData'; import dynamic from 'next/dynamic'; -import MyIcon from '@/components/Icon'; +import MyIcon from '@fastgpt/web/components/common/Icon'; import MyTooltip from '@/components/MyTooltip'; import { getFlowStore } from '@/components/core/module/Flow/FlowProvider'; import { filterExportModules, flowNode2Modules } from '@/components/core/module/utils'; @@ -123,7 +123,7 @@ const Header = ({ plugin, onClose }: Props) => { } + icon={} variant={'whiteBase'} aria-label={''} onClick={() => { @@ -138,7 +138,7 @@ const Header = ({ plugin, onClose }: Props) => { } + icon={} variant={'whitePrimary'} size={'smSquare'} aria-label={'save'} @@ -163,7 +163,7 @@ const Header = ({ plugin, onClose }: Props) => { } + icon={} size={'smSquare'} aria-label={'save'} variant={'whitePrimary'} diff --git a/projects/app/src/pages/plugin/list/component/EditModal.tsx b/projects/app/src/pages/plugin/list/component/EditModal.tsx index 4c593a537d5..60fc6af5396 100644 --- a/projects/app/src/pages/plugin/list/component/EditModal.tsx +++ b/projects/app/src/pages/plugin/list/component/EditModal.tsx @@ -14,7 +14,7 @@ import MyTooltip from '@/components/MyTooltip'; import MyModal from '@/components/MyModal'; import { useTranslation } from 'next-i18next'; 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 { customAlphabet } from 'nanoid'; const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz1234567890', 12); diff --git a/projects/app/src/pages/plugin/list/index.tsx b/projects/app/src/pages/plugin/list/index.tsx index 12399d1bea8..63d5e2acce8 100644 --- a/projects/app/src/pages/plugin/list/index.tsx +++ b/projects/app/src/pages/plugin/list/index.tsx @@ -6,7 +6,7 @@ import { AddIcon } from '@chakra-ui/icons'; import { serviceSideProps } from '@/web/common/utils/i18n'; import { useTranslation } from 'next-i18next'; -import MyIcon from '@/components/Icon'; +import MyIcon from '@fastgpt/web/components/common/Icon'; import PageContainer from '@/components/PageContainer'; import Avatar from '@/components/Avatar'; import EditModal, { defaultForm, FormType } from './component/EditModal'; diff --git a/projects/app/src/pages/tools/index.tsx b/projects/app/src/pages/tools/index.tsx index f9b552001fc..12288c356bd 100644 --- a/projects/app/src/pages/tools/index.tsx +++ b/projects/app/src/pages/tools/index.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Box, Flex } from '@chakra-ui/react'; 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 { feConfigs } from '@/web/common/system/staticData'; import { serviceSideProps } from '@/web/common/utils/i18n'; @@ -13,19 +13,10 @@ const Tools = () => { const router = useRouter(); const list = [ { - icon: 'dbLight', + icon: 'core/dataset/datasetLight', label: '我的知识库', link: '/dataset/list' }, - ...(feConfigs?.show_appStore - ? [ - { - icon: 'appStoreLight', - label: 'AI应用市场', - link: '/appStore' - } - ] - : []), { icon: 'common/navbar/pluginLight', label: '自定义模块', @@ -34,7 +25,7 @@ const Tools = () => { ...(feConfigs?.show_git ? [ { - icon: 'git', + icon: 'common/gitLight', label: 'GitHub 地址', link: 'https://github.com/labring/FastGPT' } diff --git a/projects/app/src/service/moduleDispatch/tools/cfr.ts b/projects/app/src/service/moduleDispatch/tools/cfr.ts index eecbc6c8a5a..341acf5d266 100644 --- a/projects/app/src/service/moduleDispatch/tools/cfr.ts +++ b/projects/app/src/service/moduleDispatch/tools/cfr.ts @@ -26,7 +26,9 @@ export const dispatchCFR = async ({ 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 { [ModuleOutputKeyEnum.text]: userChatInput }; diff --git a/projects/app/src/web/core/dataset/components/SelectCollections.tsx b/projects/app/src/web/core/dataset/components/SelectCollections.tsx index 0bedf48da98..ca6d89854fa 100644 --- a/projects/app/src/web/core/dataset/components/SelectCollections.tsx +++ b/projects/app/src/web/core/dataset/components/SelectCollections.tsx @@ -1,4 +1,4 @@ -import MyIcon from '@/components/Icon'; +import MyIcon from '@fastgpt/web/components/common/Icon'; import MyModal from '@/components/MyModal'; import ParentPaths from '@/components/common/ParentPaths'; import { useLoading } from '@/web/common/hooks/useLoading'; diff --git a/scripts/icon/index.js b/scripts/icon/index.js new file mode 100644 index 00000000000..5060ca074f3 --- /dev/null +++ b/scripts/icon/index.js @@ -0,0 +1,105 @@ +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 += `
+ +
${name}
+
`; + }); + + const html = ` +SVG Icons + + +
+ ${iconHtml} +
+ + + + `; + + res.send(html); +}); + +const PORT = process.env.PORT || 3005; +app.listen(PORT, () => { + console.log(`Preview icons server running at http://localhost:${PORT}`); +}); diff --git a/scripts/icon/init.js b/scripts/icon/init.js new file mode 100644 index 00000000000..f8ce237c3d9 --- /dev/null +++ b/scripts/icon/init.js @@ -0,0 +1,42 @@ +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} + };` +); diff --git a/scripts/icon/package-lock.json b/scripts/icon/package-lock.json new file mode 100644 index 00000000000..d41326eb239 --- /dev/null +++ b/scripts/icon/package-lock.json @@ -0,0 +1,613 @@ +{ + "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" + } + } + } +} diff --git a/scripts/icon/package.json b/scripts/icon/package.json new file mode 100644 index 00000000000..bc91adf3ecc --- /dev/null +++ b/scripts/icon/package.json @@ -0,0 +1,15 @@ +{ + "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" + } +}