From 80dceeb690aee2698d426c2745d59dc394707735 Mon Sep 17 00:00:00 2001 From: robin <850379744@qq.com> Date: Sun, 30 Jul 2023 16:41:25 +0800 Subject: [PATCH 01/34] login bug fix --- .../server/web/api/controller/ai/AiConfigController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/ai/AiConfigController.java b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/ai/AiConfigController.java index b68da747..c5eccfc6 100644 --- a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/ai/AiConfigController.java +++ b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/ai/AiConfigController.java @@ -2,6 +2,7 @@ package ai.chat2db.server.web.api.controller.ai; import java.util.Objects; +import ai.chat2db.server.domain.api.enums.AiSqlSourceEnum; import ai.chat2db.server.domain.api.model.Config; import ai.chat2db.server.domain.api.param.SystemConfigParam; import ai.chat2db.server.domain.api.service.ConfigService; @@ -9,6 +10,7 @@ import ai.chat2db.server.tools.base.wrapper.result.DataResult; import ai.chat2db.server.tools.common.config.Chat2dbProperties; import ai.chat2db.server.web.api.aspect.ConnectionInfoAspect; import ai.chat2db.server.web.api.controller.ai.chat2db.client.Chat2dbAIClient; +import ai.chat2db.server.web.api.controller.ai.rest.client.RestAIClient; import ai.chat2db.server.web.api.http.GatewayClientService; import ai.chat2db.server.web.api.http.response.ApiKeyResponse; import ai.chat2db.server.web.api.http.response.InviteQrCodeResponse; @@ -64,6 +66,9 @@ public class AiConfigController { QrCodeResponse qrCodeResponse = dataResult.getData(); // Representative successfully logged in if (StringUtils.isNotBlank(qrCodeResponse.getApiKey())) { + SystemConfigParam sqlSourceParam = SystemConfigParam.builder().code(RestAIClient.AI_SQL_SOURCE) + .content(AiSqlSourceEnum.CHAT2DBAI.getCode()).build(); + configService.createOrUpdate(sqlSourceParam); SystemConfigParam param = SystemConfigParam.builder() .code(Chat2dbAIClient.CHAT2DB_OPENAI_KEY).content(qrCodeResponse.getApiKey()) .build(); From 937d8c31672ebf366c3afb4b7f30a4dc67daa034 Mon Sep 17 00:00:00 2001 From: Jerry Fan Date: Sun, 30 Jul 2023 17:05:35 +0800 Subject: [PATCH 02/34] feat: Optimize i18n --- .../src/components/SearchResult/TableBox/index.tsx | 8 ++++---- chat2db-client/src/i18n/en-us/workspace.ts | 4 ++++ chat2db-client/src/i18n/zh-cn/workspace.ts | 4 ++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/chat2db-client/src/components/SearchResult/TableBox/index.tsx b/chat2db-client/src/components/SearchResult/TableBox/index.tsx index 4ed7c415..5d41a678 100644 --- a/chat2db-client/src/components/SearchResult/TableBox/index.tsx +++ b/chat2db-client/src/components/SearchResult/TableBox/index.tsx @@ -61,7 +61,7 @@ export default function TableBox(props: ITableProps) { const items: MenuProps['items'] = useMemo( () => [ { - label: '导出全部数据为csv', + label: i18n('workspace.table.export.all.csv'), key: '1', // icon: , onClick: () => { @@ -69,7 +69,7 @@ export default function TableBox(props: ITableProps) { }, }, { - label: '导出全部数据为插入语句', + label: i18n('workspace.table.export.all.insert'), key: '2', // icon: , onClick: () => { @@ -77,7 +77,7 @@ export default function TableBox(props: ITableProps) { }, }, { - label: '导出当前页数据为csv', + label: i18n('workspace.table.export.cur.csv'), key: '3', // icon: , onClick: () => { @@ -85,7 +85,7 @@ export default function TableBox(props: ITableProps) { }, }, { - label: '导出当前页数据为插入语句', + label: i18n('workspace.table.export.cur.insert'), key: '4', // icon: , onClick: () => { diff --git a/chat2db-client/src/i18n/en-us/workspace.ts b/chat2db-client/src/i18n/en-us/workspace.ts index 0c1e86d9..4fea0400 100644 --- a/chat2db-client/src/i18n/en-us/workspace.ts +++ b/chat2db-client/src/i18n/en-us/workspace.ts @@ -11,4 +11,8 @@ export default { 'The table name you entered is not the same as the table name you want to delete, please confirm again', 'workspace.table.total': 'Total', 'workspace.table.total.tip': 'Load total number of rows', + 'workspace.table.export.all.csv': 'Export result set csv', + 'workspace.table.export.cur.csv': 'Export result of current page set csv', + 'workspace.table.export.all.insert': 'Export result set insert sql', + 'workspace.table.export.cur.insert': 'Export result of current page set insert sql', }; diff --git a/chat2db-client/src/i18n/zh-cn/workspace.ts b/chat2db-client/src/i18n/zh-cn/workspace.ts index 33182677..4025b522 100644 --- a/chat2db-client/src/i18n/zh-cn/workspace.ts +++ b/chat2db-client/src/i18n/zh-cn/workspace.ts @@ -10,4 +10,8 @@ export default { 'workspace.tips.affirmDeleteTable': '输入的表名与要删除的表名不一致,请再次确认', 'workspace.table.total': '总数', 'workspace.table.total.tip': '加载总行数', + 'workspace.table.export.all.csv': '导出结果集 csv', + 'workspace.table.export.cur.csv': '导出当前页结果集 csv', + 'workspace.table.export.all.insert': '导出结果集 insert sql', + 'workspace.table.export.cur.insert': '导出当前页结果集 insert sql', }; From 3d371a43403de255bcb00458708cf5e117b9c71c Mon Sep 17 00:00:00 2001 From: Jerry Fan Date: Sun, 30 Jul 2023 17:10:59 +0800 Subject: [PATCH 03/34] feat: Optimize code --- chat2db-client/src/components/Console/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chat2db-client/src/components/Console/index.tsx b/chat2db-client/src/components/Console/index.tsx index 5d2bf248..e47a84e3 100644 --- a/chat2db-client/src/components/Console/index.tsx +++ b/chat2db-client/src/components/Console/index.tsx @@ -382,11 +382,12 @@ function Console(props: IProps) { */ const handlePopUp = () => { setModalProps({ - imageUrl: 'http://oss.sqlgpt.cn/static/chat2db-wechat.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_256/quality,Q_80/format,webp', + imageUrl: + 'http://oss.sqlgpt.cn/static/chat2db-wechat.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_256/quality,Q_80/format,webp', tip: ( <> {aiModel.remainingUse?.remainingUses === 0 &&

Key次数用完或者过期

} -

微信扫描二维码并关注公众号“每天”可以获得 25 次 AI 使用机会。

+

微信扫描二维码并关注公众号获得 AI 使用机会。

), }); @@ -432,7 +433,7 @@ function Console(props: IProps) { onExecute={executeSQL} options={props.editorOptions} tables={props.tables} - // onChange={} + // onChange={} /> {/* {modelConfig.content} */} setIsAiDrawerOpen(false)}> From 213fd6f3147d31a3e7f5e04bb4478df4d209cc6a Mon Sep 17 00:00:00 2001 From: JiaJu Zhuang <5152853@qq.com> Date: Sun, 30 Jul 2023 18:27:23 +0800 Subject: [PATCH 04/34] Modify packaging script --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 21c7981e..9ab87a2a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -285,7 +285,7 @@ jobs: content: | { "title": "Windows-release-打包完成通知", - "text": "# Windows-release-打包完成通知 \n ![bang]http://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Windows下载地址:[https://oss-chat2db.alibaba.com/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB%20Setup%20${{ steps.chat2db_version.outputs.substring }}.exe]http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB%20Setup%20${{ steps.chat2db_version.outputs.substring }}.exe) " + "text": "# Windows-release-打包完成通知 \n ![bang](http://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Windows下载地址:[http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB%20Setup%20${{ steps.chat2db_version.outputs.substring }}.exe](http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB%20Setup%20${{ steps.chat2db_version.outputs.substring }}.exe) " } # 构建完成通知 @@ -298,7 +298,7 @@ jobs: content: | { "title": "MacOS-amd64-release-构建完成通知", - "text": "# MacOS-amd64-release-打包完成通知 \n ![bang]http://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Intel芯片下载地址:[https://oss-chat2db.alibaba.com/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.dmg]http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.dmg) \n ### jar包下载地址:[https://oss-chat2db.alibaba.com/release/${{ steps.chat2db_version.outputs.substring }}/chat2db-server-start.zip]http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/chat2db-server-start.zip) " + "text": "# MacOS-amd64-release-打包完成通知 \n ![bang](http://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Intel芯片下载地址:[http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.dmg](http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.dmg) \n ### jar包下载地址:[http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/chat2db-server-start.zip](http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/chat2db-server-start.zip) " } # 构建完成通知 @@ -311,7 +311,7 @@ jobs: content: | { "title": "MacOS-arm64-release-构建完成通知", - "text": "# MacOS-arm64-release-打包完成通知 \n ![bang]http://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Apple芯片下载地址:[https://oss-chat2db.alibaba.com/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}-arm64.dmg]http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}-arm64.dmg) " + "text": "# MacOS-arm64-release-打包完成通知 \n ![bang](http://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Apple芯片下载地址:[http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}-arm64.dmg](http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}-arm64.dmg) " } # 构建完成通知 @@ -324,5 +324,5 @@ jobs: content: | { "title": "Linux-test-打包完成通知", - "text": "# Linux-test-打包完成通知 \n ![bang]http://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Linux下载地址:[https://oss-chat2db.alibaba.com/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.AppImage]http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.AppImage)" + "text": "# Linux-test-打包完成通知 \n ![bang](http://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Linux下载地址:[http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.AppImage](http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.AppImage)" } From 1dff77cc10917d571670eb4531b70d343341c590 Mon Sep 17 00:00:00 2001 From: JiaJu Zhuang <5152853@qq.com> Date: Sun, 30 Jul 2023 18:39:59 +0800 Subject: [PATCH 05/34] Modify encoding --- .../server/web/api/controller/rdb/RdbDmlExportController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/rdb/RdbDmlExportController.java b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/rdb/RdbDmlExportController.java index b9f3f500..1a8ffc20 100644 --- a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/rdb/RdbDmlExportController.java +++ b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/rdb/RdbDmlExportController.java @@ -118,6 +118,7 @@ public class RdbDmlExportController { ExcelWrapper excelWrapper = new ExcelWrapper(); try { ExcelWriterBuilder excelWriterBuilder = EasyExcel.write(response.getOutputStream()) + .charset(StandardCharsets.UTF_8) .excelType(ExcelTypeEnum.CSV); excelWrapper.setExcelWriterBuilder(excelWriterBuilder); SQLExecutor.getInstance().executeSql(Chat2DBContext.getConnection(), sql, headerList -> { From 520f166878454f718b1c80052bd0e511562c5248 Mon Sep 17 00:00:00 2001 From: Jerry Fan Date: Sun, 30 Jul 2023 18:54:10 +0800 Subject: [PATCH 06/34] fix: fix ai bug --- .../src/components/Console/index.tsx | 37 +++++++++---------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/chat2db-client/src/components/Console/index.tsx b/chat2db-client/src/components/Console/index.tsx index e47a84e3..d1073830 100644 --- a/chat2db-client/src/components/Console/index.tsx +++ b/chat2db-client/src/components/Console/index.tsx @@ -345,26 +345,23 @@ function Console(props: IProps) { }); }; - const addAction = useMemo( - () => [ - { - id: 'explainSQL', - label: i18n('common.text.explainSQL'), - action: (selectedText: string) => handleAiChat(selectedText, IPromptType.SQL_EXPLAIN), - }, - { - id: 'optimizeSQL', - label: i18n('common.text.optimizeSQL'), - action: (selectedText: string) => handleAiChat(selectedText, IPromptType.SQL_OPTIMIZER), - }, - { - id: 'changeSQL', - label: i18n('common.text.conversionSQL'), - action: (selectedText: string) => handleAiChat(selectedText, IPromptType.SQL_2_SQL), - }, - ], - [], - ); + const addAction = [ + { + id: 'explainSQL', + label: i18n('common.text.explainSQL'), + action: (selectedText: string) => handleAiChat(selectedText, IPromptType.SQL_EXPLAIN), + }, + { + id: 'optimizeSQL', + label: i18n('common.text.optimizeSQL'), + action: (selectedText: string) => handleAiChat(selectedText, IPromptType.SQL_OPTIMIZER), + }, + { + id: 'changeSQL', + label: i18n('common.text.conversionSQL'), + action: (selectedText: string) => handleAiChat(selectedText, IPromptType.SQL_2_SQL), + }, + ]; const handleClickRemainBtn = async () => { if (!isChat2DBAi) return; From 510cb024038545afdce625a3954e50d62b4ecb55 Mon Sep 17 00:00:00 2001 From: Jerry Fan Date: Sun, 30 Jul 2023 20:05:20 +0800 Subject: [PATCH 07/34] fix: fix ai in editor bug --- .../src/components/Console/index.tsx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/chat2db-client/src/components/Console/index.tsx b/chat2db-client/src/components/Console/index.tsx index d1073830..071ed1d0 100644 --- a/chat2db-client/src/components/Console/index.tsx +++ b/chat2db-client/src/components/Console/index.tsx @@ -11,13 +11,14 @@ import aiServer from '@/service/ai'; import { v4 as uuidv4 } from 'uuid'; import { DatabaseTypeCode, ConsoleStatus } from '@/constants'; import Iconfont from '../Iconfont'; -import { ITreeNode } from '@/typings'; +import { IAiConfig, ITreeNode } from '@/typings'; import { IAIState } from '@/models/ai'; import Popularize from '@/components/Popularize'; import { handleLocalStorageSavedConsole, readLocalStorageSavedConsoleText } from '@/utils'; import { chatErrorForKey, chatErrorToLogin } from '@/constants/chat'; import { AiSqlSourceType } from '@/typings/ai'; import i18n from '@/i18n'; +import configService from '@/service/config'; import styles from './index.less'; enum IPromptType { @@ -213,8 +214,14 @@ function Console(props: IProps) { } }; - const handleAiChat = async (content: string, promptType: IPromptType) => { - const { apiKey } = aiModel?.aiConfig || {}; + const handleAIChatInEditor = async (content: string, promptType: IPromptType) => { + const aiConfig = await configService.getAiSystemConfig({}); + handleAiChat(content, promptType, aiConfig); + }; + + const handleAiChat = async (content: string, promptType: IPromptType, aiConfig?: IAiConfig) => { + const { apiKey, aiSqlSource } = aiConfig || props.aiModel?.aiConfig || {}; + const isChat2DBAi = aiSqlSource === AiSqlSourceType.CHAT2DBAI; if (!apiKey && isChat2DBAi) { handleApiKeyEmptyOrGetQrCode(true); return; @@ -349,17 +356,17 @@ function Console(props: IProps) { { id: 'explainSQL', label: i18n('common.text.explainSQL'), - action: (selectedText: string) => handleAiChat(selectedText, IPromptType.SQL_EXPLAIN), + action: (selectedText: string) => handleAIChatInEditor(selectedText, IPromptType.SQL_EXPLAIN), }, { id: 'optimizeSQL', label: i18n('common.text.optimizeSQL'), - action: (selectedText: string) => handleAiChat(selectedText, IPromptType.SQL_OPTIMIZER), + action: (selectedText: string) => handleAIChatInEditor(selectedText, IPromptType.SQL_OPTIMIZER), }, { id: 'changeSQL', label: i18n('common.text.conversionSQL'), - action: (selectedText: string) => handleAiChat(selectedText, IPromptType.SQL_2_SQL), + action: (selectedText: string) => handleAIChatInEditor(selectedText, IPromptType.SQL_2_SQL), }, ]; From 11e50635697f6528c9381e9b1cad08ca8312157f Mon Sep 17 00:00:00 2001 From: jipengfei-jpf <1558143046@qq.com> Date: Sun, 30 Jul 2023 20:24:51 +0800 Subject: [PATCH 08/34] Auto Upgrade --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d9856c23..ea6cc509 100644 --- a/README.md +++ b/README.md @@ -169,7 +169,7 @@ $ yarn run start:web $ cd ../chat2db-server $ mvn clean install # maven 3.8 or later needs to be installed $ cd chat2db-server/chat2db-server-start/target/ -$ java -jar -Dchatgpt.apiKey=xxxxx chat2db-server-start.jar # To launch the chat application, you need to enter the ChatGPT key for the chatgpt.apiKey. Without entering it, you won't be able to use the AIGC function. +$ java -jar -Dloader.path=/lib -Dchatgpt.apiKey=xxxxx chat2db-server-start.jar # To launch the chat application, you need to enter the ChatGPT key for the chatgpt.apiKey. Without entering it, you won't be able to use the AIGC function. ``` ## 📑 Documentation From 413173b0a83db3ec8dc1702f2b937a3719bf2d9a Mon Sep 17 00:00:00 2001 From: JiaJu Zhuang <5152853@qq.com> Date: Sun, 30 Jul 2023 20:41:53 +0800 Subject: [PATCH 09/34] release --- CHANGELOG.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0326f5ed..1bd4fb26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # 2.0.7 + ## ⭐ New Features - Export query result as file is supported @@ -7,12 +8,20 @@ - Fixed ai config issues [Issue #346](https://github.com/chat2db/Chat2DB/issues/346) +## ⭐ 新特性 + +- 支持导出查询结果 + +## 🐞 问题修复 + +- 修复ai配置 [Issue #346](https://github.com/chat2db/Chat2DB/issues/346) # 2.0.6 ## 🐞 Bug Fixes -- Fixed: When there are too many tables under the selected library, the "New Console" button at the bottom disappears [Issue #314](https://github.com/chat2db/Chat2DB/issues/314) +- Fixed: When there are too many tables under the selected library, the "New Console" button at the bottom + disappears [Issue #314](https://github.com/chat2db/Chat2DB/issues/314) ## 🐞 问题修复 From 4cc8f152770706149405fce4d087bb000903c2ac Mon Sep 17 00:00:00 2001 From: JiaJu Zhuang <5152853@qq.com> Date: Wed, 2 Aug 2023 19:12:52 +0800 Subject: [PATCH 10/34] Return update duration --- .../server/web/api/controller/rdb/vo/ExecuteResultVO.java | 5 +++++ .../src/main/java/ai/chat2db/spi/sql/SQLExecutor.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/rdb/vo/ExecuteResultVO.java b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/rdb/vo/ExecuteResultVO.java index 912b9b3d..6ca3ad25 100644 --- a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/rdb/vo/ExecuteResultVO.java +++ b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/rdb/vo/ExecuteResultVO.java @@ -38,6 +38,11 @@ public class ExecuteResultVO { */ private Boolean success; + /** + * 修改行数 查询sql不会返回 + */ + private Integer updateCount; + /** * 展示头的列表 */ diff --git a/chat2db-server/chat2db-spi/src/main/java/ai/chat2db/spi/sql/SQLExecutor.java b/chat2db-server/chat2db-spi/src/main/java/ai/chat2db/spi/sql/SQLExecutor.java index 6c892825..8b38199d 100644 --- a/chat2db-server/chat2db-spi/src/main/java/ai/chat2db/spi/sql/SQLExecutor.java +++ b/chat2db-server/chat2db-spi/src/main/java/ai/chat2db/spi/sql/SQLExecutor.java @@ -184,11 +184,11 @@ public class SQLExecutor { } } executeResult.setDuration(timeInterval.interval()); - return executeResult; } finally { JdbcUtils.closeResultSet(rs); } } else { + executeResult.setDuration(timeInterval.interval()); // 修改或者其他 executeResult.setUpdateCount(stmt.getUpdateCount()); } From c415244f4d036d9477738c4fe10036115a3824e7 Mon Sep 17 00:00:00 2001 From: JiaJu Zhuang <5152853@qq.com> Date: Wed, 2 Aug 2023 19:36:43 +0800 Subject: [PATCH 11/34] Repair the Scientific notation in some databases --- CHANGELOG.md | 10 +++++++++ .../java/ai/chat2db/spi/util/JdbcUtils.java | 22 ++++++++++++++----- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bd4fb26..388921e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# 2.0.8 + +## 🐞 Bug Fixes + +- Repair the Scientific notation in some databases [Issue #378](https://github.com/chat2db/Chat2DB/issues/378) + +## 🐞 问题修复 + +- 修复部分数据库出现科学计数法的情况 [Issue #378](https://github.com/chat2db/Chat2DB/issues/378) + # 2.0.7 ## ⭐ New Features diff --git a/chat2db-server/chat2db-spi/src/main/java/ai/chat2db/spi/util/JdbcUtils.java b/chat2db-server/chat2db-spi/src/main/java/ai/chat2db/spi/util/JdbcUtils.java index c14d0429..e157eb1b 100644 --- a/chat2db-server/chat2db-spi/src/main/java/ai/chat2db/spi/util/JdbcUtils.java +++ b/chat2db-server/chat2db-spi/src/main/java/ai/chat2db/spi/util/JdbcUtils.java @@ -1,5 +1,6 @@ package ai.chat2db.spi.util; +import java.math.BigDecimal; import java.sql.Blob; import java.sql.Clob; import java.sql.Connection; @@ -180,6 +181,15 @@ public class JdbcUtils { if (obj instanceof LocalDate localDate) { return Objects.toString(localDate); } + if (obj instanceof BigDecimal bigDecimal) { + return bigDecimal.toPlainString(); + } + if (obj instanceof Double d) { + return BigDecimal.valueOf(d).toPlainString(); + } + if (obj instanceof Float f) { + return BigDecimal.valueOf(f).toPlainString(); + } if (obj instanceof Number num) { return Objects.toString(num); } @@ -196,11 +206,11 @@ public class JdbcUtils { * @return */ public static DataSourceConnect testConnect(String url, String host, String port, - String userName, String password, String dbType, - DriverConfig driverConfig, SSHInfo ssh, Map properties) { + String userName, String password, String dbType, + DriverConfig driverConfig, SSHInfo ssh, Map properties) { DataSourceConnect dataSourceConnect = DataSourceConnect.builder() - .success(Boolean.TRUE) - .build(); + .success(Boolean.TRUE) + .build(); Session session = null; Connection connection = null; // 加载驱动 @@ -213,7 +223,7 @@ public class JdbcUtils { } // 创建连接 connection = IDriverManager.getConnection(url, userName, password, - driverConfig, properties); + driverConfig, properties); } catch (Exception e) { log.error("connection fail:", e); dataSourceConnect.setSuccess(Boolean.FALSE); @@ -235,7 +245,7 @@ public class JdbcUtils { } if (session != null) { try { - if(StringUtils.isNotBlank(ssh.getLocalPort())) { + if (StringUtils.isNotBlank(ssh.getLocalPort())) { session.delPortForwardingL(Integer.parseInt(ssh.getLocalPort())); } session.disconnect(); From 48e3650eb19c3dc3ee1a5b164a223fb72336ccd2 Mon Sep 17 00:00:00 2001 From: JiaJu Zhuang <5152853@qq.com> Date: Wed, 2 Aug 2023 19:43:17 +0800 Subject: [PATCH 12/34] Fix some cases where data is not displayed --- CHANGELOG.md | 2 ++ chat2db-client/src/components/SearchResult/TableBox/index.tsx | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 388921e4..c5e666e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,12 @@ ## 🐞 Bug Fixes - Repair the Scientific notation in some databases [Issue #378](https://github.com/chat2db/Chat2DB/issues/378) +- Fix some cases where data is not displayed ## 🐞 问题修复 - 修复部分数据库出现科学计数法的情况 [Issue #378](https://github.com/chat2db/Chat2DB/issues/378) +- 修复部分情况数据不展示 # 2.0.7 diff --git a/chat2db-client/src/components/SearchResult/TableBox/index.tsx b/chat2db-client/src/components/SearchResult/TableBox/index.tsx index 5d41a678..59ec8467 100644 --- a/chat2db-client/src/components/SearchResult/TableBox/index.tsx +++ b/chat2db-client/src/components/SearchResult/TableBox/index.tsx @@ -180,7 +180,6 @@ export default function TableBox(props: ITableProps) { rowData[columns[index].name] = i; } }); - rowData.key = rowIndex; return rowData; }); } From 6d8cd2bcc014f20d22f9c595c251cef337ecbcd8 Mon Sep 17 00:00:00 2001 From: JiaJu Zhuang <5152853@qq.com> Date: Wed, 2 Aug 2023 19:47:09 +0800 Subject: [PATCH 13/34] Upgrade OSS to HTTPS --- .github/workflows/release.yml | 8 ++++---- .github/workflows/release_test.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ab87a2a..7310d000 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -285,7 +285,7 @@ jobs: content: | { "title": "Windows-release-打包完成通知", - "text": "# Windows-release-打包完成通知 \n ![bang](http://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Windows下载地址:[http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB%20Setup%20${{ steps.chat2db_version.outputs.substring }}.exe](http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB%20Setup%20${{ steps.chat2db_version.outputs.substring }}.exe) " + "text": "# Windows-release-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Windows下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB%20Setup%20${{ steps.chat2db_version.outputs.substring }}.exe](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB%20Setup%20${{ steps.chat2db_version.outputs.substring }}.exe) " } # 构建完成通知 @@ -298,7 +298,7 @@ jobs: content: | { "title": "MacOS-amd64-release-构建完成通知", - "text": "# MacOS-amd64-release-打包完成通知 \n ![bang](http://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Intel芯片下载地址:[http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.dmg](http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.dmg) \n ### jar包下载地址:[http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/chat2db-server-start.zip](http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/chat2db-server-start.zip) " + "text": "# MacOS-amd64-release-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Intel芯片下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.dmg](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.dmg) \n ### jar包下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/chat2db-server-start.zip](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/chat2db-server-start.zip) " } # 构建完成通知 @@ -311,7 +311,7 @@ jobs: content: | { "title": "MacOS-arm64-release-构建完成通知", - "text": "# MacOS-arm64-release-打包完成通知 \n ![bang](http://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Apple芯片下载地址:[http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}-arm64.dmg](http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}-arm64.dmg) " + "text": "# MacOS-arm64-release-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Apple芯片下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}-arm64.dmg](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}-arm64.dmg) " } # 构建完成通知 @@ -324,5 +324,5 @@ jobs: content: | { "title": "Linux-test-打包完成通知", - "text": "# Linux-test-打包完成通知 \n ![bang](http://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Linux下载地址:[http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.AppImage](http://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.AppImage)" + "text": "# Linux-test-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/happy100.jpg) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Linux下载地址:[https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.AppImage](https://oss.sqlgpt.cn/release/${{ steps.chat2db_version.outputs.substring }}/Chat2DB-${{ steps.chat2db_version.outputs.substring }}.AppImage)" } diff --git a/.github/workflows/release_test.yml b/.github/workflows/release_test.yml index f4fad7d0..9aa98e91 100644 --- a/.github/workflows/release_test.yml +++ b/.github/workflows/release_test.yml @@ -274,7 +274,7 @@ jobs: content: | { "title": "Windows-test-打包完成通知", - "text": "# Windows-test-打包完成通知 \n ![bang](http://oss.sqlgpt.cn/static/bang100.gif) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Windows下载地址:[http://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/Chat2DB-Test%20Setup%2099.0.${{ github.run_id }}-Test.exe](http://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/Chat2DB-Test%20Setup%2099.0.${{ github.run_id }}-Test.exe) " + "text": "# Windows-test-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/bang100.gif) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Windows下载地址:[https://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/Chat2DB-Test%20Setup%2099.0.${{ github.run_id }}-Test.exe](https://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/Chat2DB-Test%20Setup%2099.0.${{ github.run_id }}-Test.exe) " } # 构建完成通知 @@ -287,7 +287,7 @@ jobs: content: | { "title": "MacOS-amd64-test-构建完成通知", - "text": "# MacOS-amd64-test-打包完成通知 \n ![bang](http://oss.sqlgpt.cn/static/bang100.gif) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Intel芯片下载地址:[http://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/Chat2DB-Test-99.0.${{ github.run_id }}-Test.dmg](http://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/Chat2DB-Test-99.0.${{ github.run_id }}-Test.dmg) \n ### jar包下载地址:[http://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/chat2db-server-start.zip](http://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/${{ github.run_id }}/chat2db-server-start.zip) " + "text": "# MacOS-amd64-test-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/bang100.gif) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Intel芯片下载地址:[https://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/Chat2DB-Test-99.0.${{ github.run_id }}-Test.dmg](https://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/Chat2DB-Test-99.0.${{ github.run_id }}-Test.dmg) \n ### jar包下载地址:[https://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/chat2db-server-start.zip](https://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/${{ github.run_id }}/chat2db-server-start.zip) " } # 构建完成通知 @@ -300,7 +300,7 @@ jobs: content: | { "title": "MacOS-arm64-test-构建完成通知", - "text": "# MacOS-arm64-test-打包完成通知 \n ![bang](http://oss.sqlgpt.cn/static/bang100.gif) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Apple芯片下载地址:[http://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/Chat2DB-Test-99.0.${{ github.run_id }}-Test-arm64.dmg](http://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/Chat2DB-Test-99.0.${{ github.run_id }}-Test-arm64.dmg) " + "text": "# MacOS-arm64-test-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/bang100.gif) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Apple芯片下载地址:[https://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/Chat2DB-Test-99.0.${{ github.run_id }}-Test-arm64.dmg](https://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/Chat2DB-Test-99.0.${{ github.run_id }}-Test-arm64.dmg) " } # 构建完成通知 @@ -313,5 +313,5 @@ jobs: content: | { "title": "Linux-test-打包完成通知", - "text": "# Linux-test-打包完成通知 \n ![bang](http://oss.sqlgpt.cn/static/bang100.gif) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Linux下载地址:[http://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/Chat2DB-Test-99.0.${{ github.run_id }}-Test.AppImage](http://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/Chat2DB-Test-99.0.${{ github.run_id }}-Test.AppImage) " + "text": "# Linux-test-打包完成通知 \n ![bang](https://oss.sqlgpt.cn/static/bang100.gif) \n ### 任务id:[${{ github.run_id }}](https://github.com/chat2db/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Linux下载地址:[https://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/Chat2DB-Test-99.0.${{ github.run_id }}-Test.AppImage](https://oss.sqlgpt.cn/test/99.0.${{ github.run_id }}/Chat2DB-Test-99.0.${{ github.run_id }}-Test.AppImage) " } From 0606a464e5faf486856a0412996c303b516af0b5 Mon Sep 17 00:00:00 2001 From: Jerry Fan Date: Wed, 2 Aug 2023 21:33:43 +0800 Subject: [PATCH 14/34] =?UTF-8?q?feat:=20=E5=8D=87=E7=BA=A7electron?= =?UTF-8?q?=E5=88=B022.3.18?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chat2db-client/package.json | 2 +- chat2db-client/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/chat2db-client/package.json b/chat2db-client/package.json index 78c21f78..e84dceaa 100644 --- a/chat2db-client/package.json +++ b/chat2db-client/package.json @@ -52,7 +52,7 @@ "@umijs/plugins": "^4.0.55", "concurrently": "^8.1.0", "cross-env": "^7.0.3", - "electron": "^22.0.0", + "electron": "^22.3.0", "electron-builder": "^23.6.0", "electron-debug": "^3.2.0", "electron-reload": "^2.0.0-alpha.1", diff --git a/chat2db-client/yarn.lock b/chat2db-client/yarn.lock index b7508191..9d89d599 100644 --- a/chat2db-client/yarn.lock +++ b/chat2db-client/yarn.lock @@ -4732,10 +4732,10 @@ electron-to-chromium@^1.4.431: resolved "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.464.tgz#2f94bad78dff34e527aacbfc5d0b1a33cf046507" integrity sha512-guZ84yoou4+ILNdj0XEbmGs6DEWj6zpVOWYpY09GU66yEb0DSYvP/biBPzHn0GuW/3RC/pnaYNUWlQE1fJYtgA== -electron@^22.0.0: - version "22.3.17" - resolved "https://registry.npmmirror.com/electron/-/electron-22.3.17.tgz#90a75f78cc761ed536d8210dd001e142fca78691" - integrity sha512-mo9qD1pOkiibvH+pgETsq9RZF0p3O5ACwxzjk3E2ozMYb9cnJenZyE3jxbs4WqzDCFi+rsm6WWahw3hlPhANXw== +electron@^22.3.0: + version "22.3.18" + resolved "https://registry.npmmirror.com/electron/-/electron-22.3.18.tgz#5ee55633b3912fec9df6d8f039acf2c016274cfc" + integrity sha512-JgjB966ghTBszAX/GgVgDY/2CktWCjTZWGJI0WISRHDudBZ8/WPkI/hIjsMiLQLe0wSTk6S+WHOYbIqyw0I/sg== dependencies: "@electron/get" "^2.0.0" "@types/node" "^16.11.26" From 633a7ff85dc36d70ac49a65cd18494f9a5b1119d Mon Sep 17 00:00:00 2001 From: "fanjin.fjy" Date: Wed, 2 Aug 2023 21:59:20 +0800 Subject: [PATCH 15/34] feat: optimize --- .../SearchResult/TableBox/index.tsx | 41 +++++++++++++------ 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/chat2db-client/src/components/SearchResult/TableBox/index.tsx b/chat2db-client/src/components/SearchResult/TableBox/index.tsx index 59ec8467..841ca854 100644 --- a/chat2db-client/src/components/SearchResult/TableBox/index.tsx +++ b/chat2db-client/src/components/SearchResult/TableBox/index.tsx @@ -49,7 +49,7 @@ const DarkSupportBaseTable: any = styled(BaseTable)` export default function TableBox(props: ITableProps) { const { className, data, config, onConfigChange, onSearchTotal } = props; - const { headerList, dataList, duration, description } = data || {}; + const { headerList, dataList, duration, description, sqlType } = data || {}; const [viewTableCellData, setViewTableCellData] = useState(null); const [appTheme] = useTheme(); const isDarkTheme = useMemo(() => appTheme.backgroundColor === ThemeType.Dark, [appTheme]); @@ -175,7 +175,7 @@ export default function TableBox(props: ITableProps) { if (type === TableDataType.DATETIME && i) { rowData[columns[index].name] = formatDate(i, 'yyyy-MM-dd hh:mm:ss'); } else if (i === null) { - rowData[columns[index].name] = ''; + rowData[columns[index].name] = ''; } else { rowData[columns[index].name] = i; } @@ -219,9 +219,24 @@ export default function TableBox(props: ITableProps) { return await props.onSearchTotal(); } }; - return ( -
- {columns.length ? ( + const renderContent = () => { + const bottomStatus = ( +
+ {`【${i18n('common.text.result')}】${description}.`} + {`【${i18n('common.text.timeConsuming')}】${duration}ms.`} + {`【${i18n('common.text.searchRow')}】${tableData.length} ${i18n('common.text.row')}.`} +
+ ); + + if (!columns.length || sqlType !== 'SELECT') { + return ( + <> + +
{bottomStatus}
+ + ); + } else { + return ( <>
@@ -249,15 +264,15 @@ export default function TableBox(props: ITableProps) { stickyTop={31} {...pipeline.getProps()} /> -
- {`【${i18n('common.text.result')}】${description}.`} - {`【${i18n('common.text.timeConsuming')}】${duration}ms.`} - {`【${i18n('common.text.searchRow')}】${tableData.length} ${i18n('common.text.row')}.`} -
+ {bottomStatus} - ) : ( - - )} + ); + } + }; + return ( +
+ {renderContent()} + Date: Thu, 3 Aug 2023 08:44:25 +0800 Subject: [PATCH 16/34] test electron v25 --- chat2db-client/package.json | 2 +- chat2db-client/yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/chat2db-client/package.json b/chat2db-client/package.json index e84dceaa..d9f7eb2f 100644 --- a/chat2db-client/package.json +++ b/chat2db-client/package.json @@ -52,7 +52,7 @@ "@umijs/plugins": "^4.0.55", "concurrently": "^8.1.0", "cross-env": "^7.0.3", - "electron": "^22.3.0", + "electron": "^25.3.0", "electron-builder": "^23.6.0", "electron-debug": "^3.2.0", "electron-reload": "^2.0.0-alpha.1", diff --git a/chat2db-client/yarn.lock b/chat2db-client/yarn.lock index 9d89d599..753f5146 100644 --- a/chat2db-client/yarn.lock +++ b/chat2db-client/yarn.lock @@ -2421,10 +2421,10 @@ resolved "https://registry.npmmirror.com/@types/node/-/node-20.4.2.tgz#129cc9ae69f93824f92fac653eebfb4812ab4af9" integrity sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw== -"@types/node@^16.11.26": - version "16.18.38" - resolved "https://registry.npmmirror.com/@types/node/-/node-16.18.38.tgz#1dcdb6c54d02b323f621213745f2e44af30c73e6" - integrity sha512-6sfo1qTulpVbkxECP+AVrHV9OoJqhzCsfTNp5NIG+enM4HyM3HvZCO798WShIXBN0+QtDIcutJCjsVYnQP5rIQ== +"@types/node@^18.11.18": + version "18.17.1" + resolved "https://registry.npmmirror.com/@types/node/-/node-18.17.1.tgz#84c32903bf3a09f7878c391d31ff08f6fe7d8335" + integrity sha512-xlR1jahfizdplZYRU59JlUx9uzF1ARa8jbhM11ccpCJya8kvos5jwdm2ZAgxSCwOl0fq21svP18EVwPBXMQudw== "@types/parse-json@^4.0.0": version "4.0.0" @@ -4732,13 +4732,13 @@ electron-to-chromium@^1.4.431: resolved "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.464.tgz#2f94bad78dff34e527aacbfc5d0b1a33cf046507" integrity sha512-guZ84yoou4+ILNdj0XEbmGs6DEWj6zpVOWYpY09GU66yEb0DSYvP/biBPzHn0GuW/3RC/pnaYNUWlQE1fJYtgA== -electron@^22.3.0: - version "22.3.18" - resolved "https://registry.npmmirror.com/electron/-/electron-22.3.18.tgz#5ee55633b3912fec9df6d8f039acf2c016274cfc" - integrity sha512-JgjB966ghTBszAX/GgVgDY/2CktWCjTZWGJI0WISRHDudBZ8/WPkI/hIjsMiLQLe0wSTk6S+WHOYbIqyw0I/sg== +electron@^25.3.0: + version "25.4.0" + resolved "https://registry.npmmirror.com/electron/-/electron-25.4.0.tgz#d45b1cf3e4e96eb5bff5fee704d7aa13b532f3a5" + integrity sha512-VLTRxDhL4UvQbqM7pTNENnJo62cdAPZT92N+B7BZQ5Xfok1wuVPEewIjBot4K7U3EpLUuHn1veeLzho3ihiP+Q== dependencies: "@electron/get" "^2.0.0" - "@types/node" "^16.11.26" + "@types/node" "^18.11.18" extract-zip "^2.0.1" elliptic@^6.5.3: From f80a6b0e307d8fcad64bfb1130b6239a8b8ffc5f Mon Sep 17 00:00:00 2001 From: Jerry Fan Date: Thu, 3 Aug 2023 08:47:17 +0800 Subject: [PATCH 17/34] rollback electron version to 22 --- chat2db-client/package.json | 2 +- chat2db-client/yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/chat2db-client/package.json b/chat2db-client/package.json index d9f7eb2f..e84dceaa 100644 --- a/chat2db-client/package.json +++ b/chat2db-client/package.json @@ -52,7 +52,7 @@ "@umijs/plugins": "^4.0.55", "concurrently": "^8.1.0", "cross-env": "^7.0.3", - "electron": "^25.3.0", + "electron": "^22.3.0", "electron-builder": "^23.6.0", "electron-debug": "^3.2.0", "electron-reload": "^2.0.0-alpha.1", diff --git a/chat2db-client/yarn.lock b/chat2db-client/yarn.lock index 753f5146..4900ae4e 100644 --- a/chat2db-client/yarn.lock +++ b/chat2db-client/yarn.lock @@ -2421,10 +2421,10 @@ resolved "https://registry.npmmirror.com/@types/node/-/node-20.4.2.tgz#129cc9ae69f93824f92fac653eebfb4812ab4af9" integrity sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw== -"@types/node@^18.11.18": - version "18.17.1" - resolved "https://registry.npmmirror.com/@types/node/-/node-18.17.1.tgz#84c32903bf3a09f7878c391d31ff08f6fe7d8335" - integrity sha512-xlR1jahfizdplZYRU59JlUx9uzF1ARa8jbhM11ccpCJya8kvos5jwdm2ZAgxSCwOl0fq21svP18EVwPBXMQudw== +"@types/node@^16.11.26": + version "16.18.39" + resolved "https://registry.npmmirror.com/@types/node/-/node-16.18.39.tgz#aa39a1a87a40ef6098ee69689a1acb0c1b034832" + integrity sha512-8q9ZexmdYYyc5/cfujaXb4YOucpQxAV4RMG0himLyDUOEr8Mr79VrqsFI+cQ2M2h89YIuy95lbxuYjxT4Hk4kQ== "@types/parse-json@^4.0.0": version "4.0.0" @@ -4732,13 +4732,13 @@ electron-to-chromium@^1.4.431: resolved "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.464.tgz#2f94bad78dff34e527aacbfc5d0b1a33cf046507" integrity sha512-guZ84yoou4+ILNdj0XEbmGs6DEWj6zpVOWYpY09GU66yEb0DSYvP/biBPzHn0GuW/3RC/pnaYNUWlQE1fJYtgA== -electron@^25.3.0: - version "25.4.0" - resolved "https://registry.npmmirror.com/electron/-/electron-25.4.0.tgz#d45b1cf3e4e96eb5bff5fee704d7aa13b532f3a5" - integrity sha512-VLTRxDhL4UvQbqM7pTNENnJo62cdAPZT92N+B7BZQ5Xfok1wuVPEewIjBot4K7U3EpLUuHn1veeLzho3ihiP+Q== +electron@^22.3.0: + version "22.3.18" + resolved "https://registry.npmmirror.com/electron/-/electron-22.3.18.tgz#5ee55633b3912fec9df6d8f039acf2c016274cfc" + integrity sha512-JgjB966ghTBszAX/GgVgDY/2CktWCjTZWGJI0WISRHDudBZ8/WPkI/hIjsMiLQLe0wSTk6S+WHOYbIqyw0I/sg== dependencies: "@electron/get" "^2.0.0" - "@types/node" "^18.11.18" + "@types/node" "^16.11.26" extract-zip "^2.0.1" elliptic@^6.5.3: From f7e5851bbcb8302172b639c23bedd161bda6d83a Mon Sep 17 00:00:00 2001 From: Jerry Fan Date: Thu, 3 Aug 2023 09:35:14 +0800 Subject: [PATCH 18/34] feat: add disable-gpu ,try to fix crash on some win11 --- chat2db-client/src/main/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chat2db-client/src/main/index.js b/chat2db-client/src/main/index.js index 4c45f579..1ed9fe5b 100644 --- a/chat2db-client/src/main/index.js +++ b/chat2db-client/src/main/index.js @@ -47,6 +47,8 @@ function createWindow() { // const menu = Menu.buildFromTemplate(menuBar); // Menu.setApplicationMenu(menu); +app.commandLine.appendSwitch('disable-gpu'); + app.on('ready', () => { createWindow(); registerAppMenu(); From 05265434eef7f73e05f7d0dd537e2a4c5cbd41f0 Mon Sep 17 00:00:00 2001 From: Jerry Fan Date: Thu, 3 Aug 2023 09:36:59 +0800 Subject: [PATCH 19/34] rollback electron version to 22 --- chat2db-client/src/main/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chat2db-client/src/main/index.js b/chat2db-client/src/main/index.js index 1ed9fe5b..ff82e78f 100644 --- a/chat2db-client/src/main/index.js +++ b/chat2db-client/src/main/index.js @@ -47,7 +47,7 @@ function createWindow() { // const menu = Menu.buildFromTemplate(menuBar); // Menu.setApplicationMenu(menu); -app.commandLine.appendSwitch('disable-gpu'); +app.commandLine.appendSwitch('--disable-gpu-sandbox'); app.on('ready', () => { createWindow(); From 39c96d91d66d729173f0dc22fce4cfa92877a902 Mon Sep 17 00:00:00 2001 From: Jerry Fan Date: Thu, 3 Aug 2023 09:36:59 +0800 Subject: [PATCH 20/34] feat:add disable-gpu ,try to fix crash on some win11 --- chat2db-client/src/main/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chat2db-client/src/main/index.js b/chat2db-client/src/main/index.js index 1ed9fe5b..ff82e78f 100644 --- a/chat2db-client/src/main/index.js +++ b/chat2db-client/src/main/index.js @@ -47,7 +47,7 @@ function createWindow() { // const menu = Menu.buildFromTemplate(menuBar); // Menu.setApplicationMenu(menu); -app.commandLine.appendSwitch('disable-gpu'); +app.commandLine.appendSwitch('--disable-gpu-sandbox'); app.on('ready', () => { createWindow(); From 4e3491e497d05486413eade21109679d84e53b52 Mon Sep 17 00:00:00 2001 From: jipengfei-jpf <1558143046@qq.com> Date: Thu, 3 Aug 2023 11:51:28 +0800 Subject: [PATCH 21/34] Auto Upgrade --- README_CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_CN.md b/README_CN.md index 4450f6a9..de74739a 100644 --- a/README_CN.md +++ b/README_CN.md @@ -162,7 +162,7 @@ $ yarn run start:web $ cd ../chat2db-server $ mvn clean install # 需要安装maven 3.8以上版本 $ cd chat2db-server/chat2db-server-start/target/ -$ java -jar -Dchatgpt.apiKey=xxxxx chat2db-server-start.jar # 启动应用 chatgpt.apiKey 需要输入ChatGPT的key,如果不输入无法使用AIGC功能 +$ java -jar -Dloader.path=/lib -Dchatgpt.apiKey=xxxxx chat2db-server-start.jar # 启动应用 chatgpt.apiKey 需要输入ChatGPT的key,如果不输入无法使用AIGC功能 ``` ## 📑 文档 From ab7350d3140af2e7cdb1769cdcc56276c370d008 Mon Sep 17 00:00:00 2001 From: jipengfei-jpf <1558143046@qq.com> Date: Thu, 3 Aug 2023 12:24:05 +0800 Subject: [PATCH 22/34] Auto Upgrade --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5e666e5..92fcb974 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ + +# 2.0.9 + +## 🐞 Bug Fixes + +-Fix the issue of Windows flash back + +## 🐞 问题修复 + +- 修复windows闪退的问题 + # 2.0.8 ## 🐞 Bug Fixes From 48ece04aac4de3cc75d7baf5fceabb72d9e10a1d Mon Sep 17 00:00:00 2001 From: shanhexi Date: Sat, 5 Aug 2023 10:28:03 +0800 Subject: [PATCH 23/34] =?UTF-8?q?fix:=E8=A1=A8=E6=A0=BC=E5=A4=8D=E5=88=B6b?= =?UTF-8?q?ug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chat2db-client/.vscode/settings.json | 1 + chat2db-client/package.json | 1 + .../SearchResult/TableBox/index.tsx | 28 ++++++++++--------- chat2db-client/src/utils/index.ts | 3 +- chat2db-client/yarn.lock | 2 +- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/chat2db-client/.vscode/settings.json b/chat2db-client/.vscode/settings.json index 081320b7..221efb36 100644 --- a/chat2db-client/.vscode/settings.json +++ b/chat2db-client/.vscode/settings.json @@ -35,6 +35,7 @@ "USERANDPASSWORD", "ahooks", "antd", + "bgcolor", "chatgpt", "datas", "datasource", diff --git a/chat2db-client/package.json b/chat2db-client/package.json index e84dceaa..b2650383 100644 --- a/chat2db-client/package.json +++ b/chat2db-client/package.json @@ -28,6 +28,7 @@ "ahooks": "^3.7.7", "ali-react-table": "^2.6.1", "antd": "^5.6.0", + "copy-to-clipboard": "^3.3.3", "echarts": "^5.4.2", "echarts-for-react": "^3.0.2", "event-source-polyfill": "^1.0.31", diff --git a/chat2db-client/src/components/SearchResult/TableBox/index.tsx b/chat2db-client/src/components/SearchResult/TableBox/index.tsx index 841ca854..f893eec3 100644 --- a/chat2db-client/src/components/SearchResult/TableBox/index.tsx +++ b/chat2db-client/src/components/SearchResult/TableBox/index.tsx @@ -1,21 +1,22 @@ import React, { useMemo, useState } from 'react'; -import { TableDataType } from '@/constants/table'; -import { IManageResultData, IResultConfig } from '@/typings/database'; -import { formatDate } from '@/utils/date'; import { Button, Dropdown, MenuProps, message, Modal, Space } from 'antd'; import { BaseTable, ArtColumn, useTablePipeline, features, SortItem } from 'ali-react-table'; -import Iconfont from '../../Iconfont'; -import classnames from 'classnames'; -import StateIndicator from '../../StateIndicator'; -import MonacoEditor from '../../Console/MonacoEditor'; -import { useTheme } from '@/hooks/useTheme'; import styled from 'styled-components'; -import { ThemeType } from '@/constants'; +import classnames from 'classnames'; import i18n from '@/i18n'; +import { ThemeType } from '@/constants'; +import { TableDataType } from '@/constants/table'; +import { useTheme } from '@/hooks/useTheme'; +import { IManageResultData, IResultConfig } from '@/typings/database'; import { compareStrings } from '@/utils/sort'; -import MyPagination from '../Pagination'; import { DownOutlined, UserOutlined } from '@ant-design/icons'; import { ExportSizeEnum, ExportTypeEnum } from '@/typings/resultTable'; +import { formatDate } from '@/utils/date'; +import { copy } from '@/utils'; +import Iconfont from '../../Iconfont'; +import StateIndicator from '../../StateIndicator'; +import MonacoEditor from '../../Console/MonacoEditor'; +import MyPagination from '../Pagination'; import styles from './index.less'; interface ITableProps { @@ -53,6 +54,7 @@ export default function TableBox(props: ITableProps) { const [viewTableCellData, setViewTableCellData] = useState(null); const [appTheme] = useTheme(); const isDarkTheme = useMemo(() => appTheme.backgroundColor === ThemeType.Dark, [appTheme]); + const [messageApi, contextHolder] = message.useMessage(); const handleExport = (exportType: ExportTypeEnum, exportSize: ExportSizeEnum) => { props.onExport && props.onExport(data.sql, data.originalSql, exportType, exportSize); @@ -110,8 +112,8 @@ export default function TableBox(props: ITableProps) { } function copyTableCell(data: IViewTableCellData) { - navigator.clipboard.writeText(data?.value || viewTableCellData?.value); - message.success(i18n('common.button.copySuccessfully')); + copy(data?.value || viewTableCellData?.value); + messageApi.success(i18n('common.button.copySuccessfully')); } function handleCancel() { @@ -272,7 +274,6 @@ export default function TableBox(props: ITableProps) { return (
{renderContent()} -
+ {contextHolder}
); } diff --git a/chat2db-client/src/utils/index.ts b/chat2db-client/src/utils/index.ts index 287005ef..5f98b5cc 100644 --- a/chat2db-client/src/utils/index.ts +++ b/chat2db-client/src/utils/index.ts @@ -1,5 +1,6 @@ import { ThemeType } from '@/constants'; import { ITreeNode } from '@/typings'; +import clipboardCopy from 'copy-to-clipboard'; import lodash from 'lodash'; export function getOsTheme() { @@ -198,7 +199,7 @@ export function isVersionHigher(version: string, currentVersion: string): boolea // Copy export function copy(message: string) { - navigator.clipboard.writeText(message); + clipboardCopy(message); } // 获取应用的一些基本信息 diff --git a/chat2db-client/yarn.lock b/chat2db-client/yarn.lock index 4900ae4e..92f77a00 100644 --- a/chat2db-client/yarn.lock +++ b/chat2db-client/yarn.lock @@ -4093,7 +4093,7 @@ copy-anything@^3.0.2: dependencies: is-what "^4.1.8" -copy-to-clipboard@^3.2.0: +copy-to-clipboard@^3.2.0, copy-to-clipboard@^3.3.3: version "3.3.3" resolved "https://registry.npmmirror.com/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz#55ac43a1db8ae639a4bd99511c148cdd1b83a1b0" integrity sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA== From dec420291c55a60b50f026efc4c436f93566ce75 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Sat, 5 Aug 2023 10:35:30 +0800 Subject: [PATCH 24/34] =?UTF-8?q?fix:=E6=90=9C=E7=B4=A2=E8=A1=A8=E5=90=8E?= =?UTF-8?q?=E5=AF=BC=E5=87=BAddl=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workspace/components/Tree/TreeNodeRightClick/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chat2db-client/src/pages/main/workspace/components/Tree/TreeNodeRightClick/index.tsx b/chat2db-client/src/pages/main/workspace/components/Tree/TreeNodeRightClick/index.tsx index 17b2b64e..2b5e30dd 100644 --- a/chat2db-client/src/pages/main/workspace/components/Tree/TreeNodeRightClick/index.tsx +++ b/chat2db-client/src/pages/main/workspace/components/Tree/TreeNodeRightClick/index.tsx @@ -65,7 +65,7 @@ function TreeNodeRightClick(props: IProps) { handle: () => { mysqlServer.exportCreateTableSql({ ...curWorkspaceParams, - tableName: data.name + tableName: data.key } as any).then(res => { setMonacoDefaultValue(res); setMonacoVerifyDialog(true); @@ -272,7 +272,9 @@ function TreeNodeRightClick(props: IProps) { title={`${data.name}-DDL`} open={monacoVerifyDialog} width="600px" - onCancel={(() => { setMonacoVerifyDialog(false) })}> + onCancel={(() => { setMonacoVerifyDialog(false) })} + footer={false} + >
Date: Sat, 5 Aug 2023 10:38:59 +0800 Subject: [PATCH 25/34] =?UTF-8?q?fix:=E6=90=9C=E7=B4=A2=E8=A1=A8=E5=90=8E?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E8=A1=A8=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Tree/TreeNodeRightClick/index.tsx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/chat2db-client/src/pages/main/workspace/components/Tree/TreeNodeRightClick/index.tsx b/chat2db-client/src/pages/main/workspace/components/Tree/TreeNodeRightClick/index.tsx index 2b5e30dd..442d9cb1 100644 --- a/chat2db-client/src/pages/main/workspace/components/Tree/TreeNodeRightClick/index.tsx +++ b/chat2db-client/src/pages/main/workspace/components/Tree/TreeNodeRightClick/index.tsx @@ -91,7 +91,7 @@ function TreeNodeRightClick(props: IProps) { text: '新建表', icon: '\ue6b6', handle: () => { - const operationData: IOperationData = { + const operationData = { type: 'new', nodeData: data } @@ -132,9 +132,7 @@ function TreeNodeRightClick(props: IProps) { return { text: data.pinned ? i18n('workspace.menu.unPin') : i18n('workspace.menu.pin'), icon: data.pinned ? '\ue61d' : '\ue627', - handle: () => { - handelTop(); - } + handle: handelTop } }, } @@ -143,7 +141,7 @@ function TreeNodeRightClick(props: IProps) { const api = data.pinned ? 'deleteTablePin' : 'addTablePin' mysqlServer[api]({ ...curWorkspaceParams, - tableName: data.name + tableName: data.key } as any).then(res => { dispatch({ type: 'workspace/fetchGetCurTableList', @@ -173,10 +171,10 @@ function TreeNodeRightClick(props: IProps) { } function handleOk() { - if (verifyTableName === data.name) { + if (verifyTableName === data.key) { let p: any = { ...data.extraParams, - tableName: data.name, + tableName: data.key, } mysqlServer.deleteTable(p).then(res => { // notificationApi.success( @@ -257,7 +255,7 @@ function TreeNodeRightClick(props: IProps) { } { setMonacoVerifyDialog(false) })} From 90cb6383286da94c53843ebf501f9e35f54f8448 Mon Sep 17 00:00:00 2001 From: robin <850379744@qq.com> Date: Sat, 5 Aug 2023 10:45:59 +0800 Subject: [PATCH 26/34] UI adapter --- chat2db-client/.umirc.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chat2db-client/.umirc.ts b/chat2db-client/.umirc.ts index 5654097a..56c48c9a 100644 --- a/chat2db-client/.umirc.ts +++ b/chat2db-client/.umirc.ts @@ -44,6 +44,9 @@ export default defineConfig({ changeOrigin: true, }, }, + targets:{ + chrome: 80, + }, headScripts: [ `if (localStorage.getItem('app-local-storage-versions') !== 'v2') { localStorage.clear(); From 290e553621008ebef691ad04ad81a0c0ee8a185d Mon Sep 17 00:00:00 2001 From: shanhexi Date: Sat, 5 Aug 2023 10:58:02 +0800 Subject: [PATCH 27/34] =?UTF-8?q?feat:=E6=94=AF=E6=8C=81=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=BC=A0=E5=85=A5public=5Fpath?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chat2db-client/.umirc.prod.ts | 5 ++--- chat2db-client/package.json | 4 ++-- .../workspace/components/Tree/TreeNodeRightClick/index.tsx | 3 ++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/chat2db-client/.umirc.prod.ts b/chat2db-client/.umirc.prod.ts index 4ca9c1f4..bc5b7987 100644 --- a/chat2db-client/.umirc.prod.ts +++ b/chat2db-client/.umirc.prod.ts @@ -1,8 +1,7 @@ import { defineConfig } from 'umi'; import { extractYarnConfig } from './src/utils/webpack'; const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); - -// const UMI_PublicPath = process.env.UMI_PublicPath || './static/front/'; +const UMI_PublicPath = process.env.UMI_PublicPath || './static/front/'; const yarn_config = extractYarnConfig(process.argv); const chainWebpack = (config: any, { webpack }: any) => { @@ -14,7 +13,7 @@ const chainWebpack = (config: any, { webpack }: any) => { }; export default defineConfig({ - publicPath: './static/front/', + publicPath: UMI_PublicPath, chainWebpack, define: { 'process.env.UMI_ENV': process.env.UMI_ENV, diff --git a/chat2db-client/package.json b/chat2db-client/package.json index b2650383..b249ce3c 100644 --- a/chat2db-client/package.json +++ b/chat2db-client/package.json @@ -13,7 +13,7 @@ "build:desktop": "npm run build:web:desktop && npm run build:main:prod", "build:main": "cross-env NODE_ENV=development electron-builder", "build:main:prod": "cross-env NODE_ENV=production electron-builder", - "build:prod": "npm run build:web:prod && npm run build:main:prod", + "build:prod": "npm run build:web:prod && npm run build:main:prod cross-env UMI_PublicPath=${npm_config_public_path}", "build:web": "umi build", "build:web:desktop": "cross-env UMI_ENV=desktop cross-env APP_VERSION=${npm_config_app_version} cross-env APP_PORT=${npm_config_app_port} umi build", "build:web:prod": "cross-env UMI_ENV=prod cross-env APP_VERSION=${npm_config_app_version} cross-env APP_PORT=${npm_config_app_port} umi build", @@ -119,4 +119,4 @@ ] } } -} +} \ No newline at end of file diff --git a/chat2db-client/src/pages/main/workspace/components/Tree/TreeNodeRightClick/index.tsx b/chat2db-client/src/pages/main/workspace/components/Tree/TreeNodeRightClick/index.tsx index 442d9cb1..92436521 100644 --- a/chat2db-client/src/pages/main/workspace/components/Tree/TreeNodeRightClick/index.tsx +++ b/chat2db-client/src/pages/main/workspace/components/Tree/TreeNodeRightClick/index.tsx @@ -259,7 +259,8 @@ function TreeNodeRightClick(props: IProps) { open={verifyDialog} onOk={handleOk} width={400} - onCancel={(() => { setVerifyDialog(false) })}> + onCancel={(() => { setVerifyDialog(false) })} + > { setVerifyTableName(e.target.value) }}> {/* 这里后续肯定是要提出去的 */} From e383421cc1e6625b01e10776517f797e3493a404 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Sat, 5 Aug 2023 11:04:21 +0800 Subject: [PATCH 28/34] =?UTF-8?q?feat:=E6=94=AF=E6=8C=81=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=BC=A0=E5=85=A5public=5Fpath?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chat2db-client/.vscode/settings.json | 1 + chat2db-client/package.json | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/chat2db-client/.vscode/settings.json b/chat2db-client/.vscode/settings.json index 221efb36..ec1df7b9 100644 --- a/chat2db-client/.vscode/settings.json +++ b/chat2db-client/.vscode/settings.json @@ -43,6 +43,7 @@ "echarts", "favicons", "findstr", + "gtag", "lsof", "netstat", "pgsql", diff --git a/chat2db-client/package.json b/chat2db-client/package.json index b249ce3c..57a9f2ce 100644 --- a/chat2db-client/package.json +++ b/chat2db-client/package.json @@ -13,10 +13,10 @@ "build:desktop": "npm run build:web:desktop && npm run build:main:prod", "build:main": "cross-env NODE_ENV=development electron-builder", "build:main:prod": "cross-env NODE_ENV=production electron-builder", - "build:prod": "npm run build:web:prod && npm run build:main:prod cross-env UMI_PublicPath=${npm_config_public_path}", + "build:prod": "npm run build:web:prod && npm run build:main:prod", "build:web": "umi build", "build:web:desktop": "cross-env UMI_ENV=desktop cross-env APP_VERSION=${npm_config_app_version} cross-env APP_PORT=${npm_config_app_port} umi build", - "build:web:prod": "cross-env UMI_ENV=prod cross-env APP_VERSION=${npm_config_app_version} cross-env APP_PORT=${npm_config_app_port} umi build", + "build:web:prod": "cross-env UMI_ENV=prod cross-env APP_VERSION=${npm_config_app_version} cross-env APP_PORT=${npm_config_app_port} cross-env UMI_PublicPath=${npm_config_public_path} umi build", "postinstall": "umi setup", "lint": "umi lint", "start": "concurrently \"npm run start:web\" \"npm run start:main\"", From 0e43b83e2f01c3c0bf44f1c92ef70b79d88fac7a Mon Sep 17 00:00:00 2001 From: robin <850379744@qq.com> Date: Sat, 5 Aug 2023 11:15:20 +0800 Subject: [PATCH 29/34] UI adapter --- chat2db-client/src/components/Console/ChatInput/index.less | 2 +- chat2db-client/src/components/Console/ChatInput/index.tsx | 2 +- chat2db-client/src/components/Console/MonacoEditor/index.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chat2db-client/src/components/Console/ChatInput/index.less b/chat2db-client/src/components/Console/ChatInput/index.less index 1364616d..e104fdec 100644 --- a/chat2db-client/src/components/Console/ChatInput/index.less +++ b/chat2db-client/src/components/Console/ChatInput/index.less @@ -63,7 +63,7 @@ padding: 4px 12px; &:hover { - cursor: pointer; + //cursor: pointer; } } diff --git a/chat2db-client/src/components/Console/ChatInput/index.tsx b/chat2db-client/src/components/Console/ChatInput/index.tsx index 2a2fed00..c18b184e 100644 --- a/chat2db-client/src/components/Console/ChatInput/index.tsx +++ b/chat2db-client/src/components/Console/ChatInput/index.tsx @@ -73,7 +73,7 @@ function ChatInput(props: IProps) {
{ - props.onClickRemainBtn && props.onClickRemainBtn(); + // props.onClickRemainBtn && props.onClickRemainBtn(); }} > {i18n('chat.input.remain', remainCnt)} diff --git a/chat2db-client/src/components/Console/MonacoEditor/index.tsx b/chat2db-client/src/components/Console/MonacoEditor/index.tsx index c53ec705..a412cd07 100644 --- a/chat2db-client/src/components/Console/MonacoEditor/index.tsx +++ b/chat2db-client/src/components/Console/MonacoEditor/index.tsx @@ -206,7 +206,7 @@ function MonacoEditor(props: IProps, ref: ForwardedRef) { return Object.keys(hintData).map((key) => ({ label: key, kind: monaco.languages.CompletionItemKind.Method, - insertText: key, + insertText: `\`${key}\``, detail: '', })); }; From 9d9008b08df0ff776afdedbf3817487e09916afd Mon Sep 17 00:00:00 2001 From: JiaJu Zhuang <5152853@qq.com> Date: Sat, 5 Aug 2023 11:24:39 +0800 Subject: [PATCH 30/34] test release --- .github/workflows/test.yml | 61 +++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e3ccaa0d..eb806278 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,30 +1,31 @@ -#name: Test -# -#on: [ push, pull_request ] -# -#jobs: -# test: -# strategy: -# fail-fast: false -# matrix: -# include: -# - os: ubuntu-latest -# runs-on: ${{ matrix.os }} -# steps: -# - name: Check out Git repository -# uses: actions/checkout@main -# -# # 安装jre Windows -# - name: Install Jre for Windows -# uses: actions/setup-java@main -# with: -# java-version: "17" -# distribution: "temurin" -# java-package: "jre" -# -# # java.security 开放tls1 Linux -# - name: Enable tls1 -# if: ${{ runner.os == 'Linux' }} -# run: | -# sed -i "s/\(^jdk.tls.disabledAlgorithms=\)\(.*\)\( TLSv1, TLSv1.1,\)\(.*\)/\1\2\4/" ${{ env.JAVA_HOME }}/conf/security/java.security -# cat ${{ env.JAVA_HOME }}/conf/security/java.security \ No newline at end of file +name: Test + +on: [ push, pull_request ] + +jobs: + test: + strategy: + fail-fast: false + matrix: + - os: macos-latest + arch: amd64 + - os: ubuntu-latest + runs-on: ${{ matrix.os }} + steps: + - name: Check out Git repository + uses: actions/checkout@main + + # 安装jre Windows + - name: Install Jre for Windows + uses: actions/setup-java@main + with: + java-version: "17" + distribution: "temurin" + java-package: "jre" + + # java.security 开放tls1 Linux + - name: Enable tls1 + run: | + ls ${{ env.JAVA_HOME }} + ls ${{ env.JAVA_HOME }}/legal/jdk.zipfs/ + cat ${{ env.JAVA_HOME }}/legal/jdk.zipfs/ADDITIONAL_LICENSE_INFO \ No newline at end of file From ff870d031a2ad4b282514ff43cc3e7c5c5b4c239 Mon Sep 17 00:00:00 2001 From: JiaJu Zhuang <5152853@qq.com> Date: Sat, 5 Aug 2023 11:25:53 +0800 Subject: [PATCH 31/34] test release --- .github/workflows/test.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eb806278..f46d7d4c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,9 +7,10 @@ jobs: strategy: fail-fast: false matrix: - - os: macos-latest - arch: amd64 - - os: ubuntu-latest + include: + - os: macos-latest + arch: amd64 + - os: ubuntu-latest runs-on: ${{ matrix.os }} steps: - name: Check out Git repository From de68202beb10ae52d11c7b0ac1dc6c67074895f1 Mon Sep 17 00:00:00 2001 From: JiaJu Zhuang <5152853@qq.com> Date: Sat, 5 Aug 2023 11:34:43 +0800 Subject: [PATCH 32/34] test release --- .github/workflows/test.yml | 64 +++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f46d7d4c..dbc7a632 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,32 +1,32 @@ -name: Test - -on: [ push, pull_request ] - -jobs: - test: - strategy: - fail-fast: false - matrix: - include: - - os: macos-latest - arch: amd64 - - os: ubuntu-latest - runs-on: ${{ matrix.os }} - steps: - - name: Check out Git repository - uses: actions/checkout@main - - # 安装jre Windows - - name: Install Jre for Windows - uses: actions/setup-java@main - with: - java-version: "17" - distribution: "temurin" - java-package: "jre" - - # java.security 开放tls1 Linux - - name: Enable tls1 - run: | - ls ${{ env.JAVA_HOME }} - ls ${{ env.JAVA_HOME }}/legal/jdk.zipfs/ - cat ${{ env.JAVA_HOME }}/legal/jdk.zipfs/ADDITIONAL_LICENSE_INFO \ No newline at end of file +#name: Test +# +#on: [ push, pull_request ] +# +#jobs: +# test: +# strategy: +# fail-fast: false +# matrix: +# include: +# - os: macos-latest +# arch: amd64 +# - os: ubuntu-latest +# runs-on: ${{ matrix.os }} +# steps: +# - name: Check out Git repository +# uses: actions/checkout@main +# +# # 安装jre Windows +# - name: Install Jre for Windows +# uses: actions/setup-java@main +# with: +# java-version: "17" +# distribution: "temurin" +# java-package: "jre" +# +# # java.security 开放tls1 Linux +# - name: Enable tls1 +# run: | +# ls ${{ env.JAVA_HOME }} +# ls ${{ env.JAVA_HOME }}/legal/jdk.zipfs/ +# cat ${{ env.JAVA_HOME }}/legal/jdk.zipfs/ADDITIONAL_LICENSE_INFO \ No newline at end of file From df5ab8ca67496a5ed29fd33d043b135e712f2c02 Mon Sep 17 00:00:00 2001 From: JiaJu Zhuang <5152853@qq.com> Date: Sat, 5 Aug 2023 12:39:33 +0800 Subject: [PATCH 33/34] test release --- chat2db-client/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/chat2db-client/package.json b/chat2db-client/package.json index 57a9f2ce..98cd1d3f 100644 --- a/chat2db-client/package.json +++ b/chat2db-client/package.json @@ -80,7 +80,6 @@ "files": [ "dist/**/*", "!node_modules", - "static/", "src/main", "versions/**/*", "package.json" From acca6c576a8a6232bd9a5dabfd049fa32b186724 Mon Sep 17 00:00:00 2001 From: JiaJu Zhuang <5152853@qq.com> Date: Sat, 5 Aug 2023 12:40:21 +0800 Subject: [PATCH 34/34] test release --- chat2db-client/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/chat2db-client/package.json b/chat2db-client/package.json index 98cd1d3f..57a9f2ce 100644 --- a/chat2db-client/package.json +++ b/chat2db-client/package.json @@ -80,6 +80,7 @@ "files": [ "dist/**/*", "!node_modules", + "static/", "src/main", "versions/**/*", "package.json"