From 867a691ca9ac45395519c339de64854080892f10 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Wed, 13 Dec 2023 20:21:36 +0800 Subject: [PATCH 01/37] optimize --- chat2db-client/src/main/preload.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chat2db-client/src/main/preload.js b/chat2db-client/src/main/preload.js index 769230fcd..fe9abb274 100644 --- a/chat2db-client/src/main/preload.js +++ b/chat2db-client/src/main/preload.js @@ -6,8 +6,9 @@ const { readVersion } = require('./utils'); contextBridge.exposeInMainWorld('electronApi', { startServerForSpawn: async () => { - const javaPath = path.join(__dirname, '../..', `./versions/${readVersion()}`, `./static/${JAVA_APP_NAME}`); - const libPath = path.join(__dirname, '../..', `./versions/${readVersion()}`, './static/lib'); + const appVersion = readVersion(); + const javaPath = path.join(__dirname, '../..', `./versions/${appVersion}`, `./static/${JAVA_APP_NAME}`); + const libPath = path.join(__dirname, '../..', `./versions/${appVersion}`, './static/lib'); const productName = await ipcRenderer.invoke('get-product-name'); @@ -22,7 +23,7 @@ contextBridge.exposeInMainWorld('electronApi', { '-Dchat2db.mode=DESKTOP', `-Dproject.path=${javaPath}`, `-Dloader.path=${libPath}`, - `-Dclient.version=${readVersion()}`, + `-Dclient.version=${appVersion}`, '-Xmx1024M', '-jar', javaPath, From cf84d9138278a40c0899d47d7de2ca9ec8f02f08 Mon Sep 17 00:00:00 2001 From: SwallowGG <1558143046@qq.com> Date: Wed, 13 Dec 2023 20:40:51 +0800 Subject: [PATCH 02/37] Improve startup speed --- .../chat2db/server/domain/api/chart/ChartCreateParam.java | 5 +++++ .../chat2db/server/domain/api/chart/ChartUpdateParam.java | 4 ++++ .../main/java/ai/chat2db/server/domain/api/model/Chart.java | 5 +++++ .../ai/chat2db/server/domain/repository/entity/ChartDO.java | 3 +++ .../src/main/resources/db/migration/V2_1_8__Chart.sql | 1 + .../controller/dashboard/request/ChartCreateRequest.java | 4 ++++ .../controller/dashboard/request/ChartUpdateRequest.java | 5 +++++ .../server/web/api/controller/dashboard/vo/ChartVO.java | 6 ++++++ 8 files changed, 33 insertions(+) create mode 100644 chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_8__Chart.sql diff --git a/chat2db-server/chat2db-server-domain/chat2db-server-domain-api/src/main/java/ai/chat2db/server/domain/api/chart/ChartCreateParam.java b/chat2db-server/chat2db-server-domain/chat2db-server-domain-api/src/main/java/ai/chat2db/server/domain/api/chart/ChartCreateParam.java index a02aba770..8bc453d32 100644 --- a/chat2db-server/chat2db-server-domain/chat2db-server-domain-api/src/main/java/ai/chat2db/server/domain/api/chart/ChartCreateParam.java +++ b/chat2db-server/chat2db-server-domain/chat2db-server-domain-api/src/main/java/ai/chat2db/server/domain/api/chart/ChartCreateParam.java @@ -47,6 +47,11 @@ public class ChartCreateParam { */ private String databaseName; + /** + * + */ + private String schemaName; + /** * ddl内容 */ diff --git a/chat2db-server/chat2db-server-domain/chat2db-server-domain-api/src/main/java/ai/chat2db/server/domain/api/chart/ChartUpdateParam.java b/chat2db-server/chat2db-server-domain/chat2db-server-domain-api/src/main/java/ai/chat2db/server/domain/api/chart/ChartUpdateParam.java index 2bbaad49f..63b5bb538 100644 --- a/chat2db-server/chat2db-server-domain/chat2db-server-domain-api/src/main/java/ai/chat2db/server/domain/api/chart/ChartUpdateParam.java +++ b/chat2db-server/chat2db-server-domain/chat2db-server-domain-api/src/main/java/ai/chat2db/server/domain/api/chart/ChartUpdateParam.java @@ -52,6 +52,10 @@ public class ChartUpdateParam { */ private String databaseName; + /** + * schema名称 + */ + private String schemaName; /** * ddl内容 */ diff --git a/chat2db-server/chat2db-server-domain/chat2db-server-domain-api/src/main/java/ai/chat2db/server/domain/api/model/Chart.java b/chat2db-server/chat2db-server-domain/chat2db-server-domain-api/src/main/java/ai/chat2db/server/domain/api/model/Chart.java index b2c17f5e4..e2705a969 100644 --- a/chat2db-server/chat2db-server-domain/chat2db-server-domain-api/src/main/java/ai/chat2db/server/domain/api/model/Chart.java +++ b/chat2db-server/chat2db-server-domain/chat2db-server-domain-api/src/main/java/ai/chat2db/server/domain/api/model/Chart.java @@ -52,6 +52,11 @@ public class Chart { */ private String dataSourceName; + /** + * schema名称 + */ + private String schemaName; + /** * 数据库类型 */ diff --git a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/ChartDO.java b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/ChartDO.java index 2c233cb66..e1b28625a 100644 --- a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/ChartDO.java +++ b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/java/ai/chat2db/server/domain/repository/entity/ChartDO.java @@ -69,6 +69,9 @@ public class ChartDO implements Serializable { */ private String databaseName; + + private String schemaName; + /** * ddl内容 */ diff --git a/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_8__Chart.sql b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_8__Chart.sql new file mode 100644 index 000000000..08657ff01 --- /dev/null +++ b/chat2db-server/chat2db-server-domain/chat2db-server-domain-repository/src/main/resources/db/migration/V2_1_8__Chart.sql @@ -0,0 +1 @@ +ALTER TABLE `chart` ADD COLUMN `schema_name` varchar(128) NULL COMMENT 'schemaName'; diff --git a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/dashboard/request/ChartCreateRequest.java b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/dashboard/request/ChartCreateRequest.java index ebdc17510..dc5620611 100644 --- a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/dashboard/request/ChartCreateRequest.java +++ b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/dashboard/request/ChartCreateRequest.java @@ -41,6 +41,10 @@ public class ChartCreateRequest { */ private String databaseName; + /** + * schema名称 + */ + private String schemaName; /** * ddl内容 */ diff --git a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/dashboard/request/ChartUpdateRequest.java b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/dashboard/request/ChartUpdateRequest.java index 309ff3447..05ecc3f5b 100644 --- a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/dashboard/request/ChartUpdateRequest.java +++ b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/dashboard/request/ChartUpdateRequest.java @@ -42,6 +42,11 @@ public class ChartUpdateRequest { */ private String databaseName; + /** + * schema名称 + */ + private String schemaName; + /** * ddl内容 */ diff --git a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/dashboard/vo/ChartVO.java b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/dashboard/vo/ChartVO.java index b5560faae..85beee800 100644 --- a/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/dashboard/vo/ChartVO.java +++ b/chat2db-server/chat2db-server-web/chat2db-server-web-api/src/main/java/ai/chat2db/server/web/api/controller/dashboard/vo/ChartVO.java @@ -62,6 +62,12 @@ public class ChartVO { */ private String databaseName; + + /** + * schema名称 + */ + private String schemaName; + /** * ddl内容 */ From 4a1ab78a728ba25fc14da9ca82282a0384dab525 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Wed, 13 Dec 2023 21:03:05 +0800 Subject: [PATCH 03/37] changelog --- CHANGELOG.md | 9 +++++++++ CHANGELOG_CN.md | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90228999a..02ac052eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 3.1.11 + +`2023-12-13` + +**Changelog** + +- 🐞【Fixed】A chart with a Schema cannot be saved and executed +- 🐞【Fixed】Failure to start after the upgrade + ## 3.1.1 `2023-12-13` diff --git a/CHANGELOG_CN.md b/CHANGELOG_CN.md index 64a6719ec..1e4b1e5f7 100644 --- a/CHANGELOG_CN.md +++ b/CHANGELOG_CN.md @@ -1,4 +1,13 @@ -## 3.1.1 +## 3.1.11 + +`2023-12-13` + +**更新日志** + +- 🐞【修复】带Schema的图表无法保存和执行 +- 🐞【修复】升级后无法启动问题 + +## 3.1.10 `2023-12-13` From 0f4863888e6a340be704f2e541a4fc61080d4e0d Mon Sep 17 00:00:00 2001 From: shanhexi Date: Fri, 15 Dec 2023 14:42:18 +0800 Subject: [PATCH 04/37] Optimize:Optimized tree structure search --- CHANGELOG.md | 9 ++++ CHANGELOG_CN.md | 9 ++++ chat2db-client/src/blocks/Tree/index.tsx | 46 +++++++++++++++---- .../components/OperationLine/index.less | 2 +- .../components/OperationLine/index.tsx | 28 +++++------ 5 files changed, 71 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02ac052eb..7acc425b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 3.1.12 + +`2023-12-15` + +**Changelog** + +- ⚡️【Optimize】Optimized tree structure search +- ⚡️【Optimize】Tree structure search box resident + ## 3.1.11 `2023-12-13` diff --git a/CHANGELOG_CN.md b/CHANGELOG_CN.md index 1e4b1e5f7..f70d54c26 100644 --- a/CHANGELOG_CN.md +++ b/CHANGELOG_CN.md @@ -1,3 +1,12 @@ +## 3.1.12 + +`2023-12-15` + +**更新日志** + +- ⚡️【优化】优化树结构搜索 +- ⚡️【优化】树结构搜索框常驻 + ## 3.1.11 `2023-12-13` diff --git a/chat2db-client/src/blocks/Tree/index.tsx b/chat2db-client/src/blocks/Tree/index.tsx index ff76ba24d..349a55a07 100644 --- a/chat2db-client/src/blocks/Tree/index.tsx +++ b/chat2db-client/src/blocks/Tree/index.tsx @@ -1,4 +1,4 @@ -import React, { memo, useEffect, useMemo, useState, createContext, useContext, useRef } from 'react'; +import React, { memo, useEffect, useMemo, useState, createContext, useContext } from 'react'; import styles from './index.less'; import classnames from 'classnames'; import Iconfont from '@/components/Iconfont'; @@ -48,6 +48,40 @@ const smoothTree = (treeData: ITreeNode[], result: ITreeNode[] = [], parentNode? return result; }; +// 判断是否匹配 +const isMatch = (target: string, searchValue: string) => { + const reg = new RegExp(searchValue, 'i'); + return reg.test(target || ''); +}; + +// 树结构搜索 +function searchTree(treeData: ITreeNode[], searchValue: string): ITreeNode[] { + let result: ITreeNode[] = []; + function dfs(node: ITreeNode, path: ITreeNode[] = []) { + if (isMatch(node.name, searchValue)) { + result = [...path, node]; + return true; + } + if (!node.children) return false; + for (const child of node.children) { + if (dfs(child, [...path, node])) return true; + } + return false; + } + + treeData.some((node) => dfs(node)); + + result.forEach((item) => { + if(!isMatch(item.name, searchValue)){ + item.children = null; + } + }); + + const smoothTreeList: ITreeNode[] = [] + smoothTree(result, smoothTreeList); + return smoothTreeList; +} + const itemHeight = 26; // 每个 item 的高度 const paddingCount = 2; @@ -89,17 +123,13 @@ const Tree = (props: IProps) => { }, [smoothTreeData, searchTreeData, startIdx]); useEffect(() => { - if (searchValue) { - const ls = smoothTreeData.filter((item) => { - const reg = new RegExp(searchValue, 'i'); - return reg.test(item.name || ''); - }); - setSearchTreeData(ls); + if (searchValue && treeData) { + setSearchTreeData(searchTree(cloneDeep(treeData), searchValue)); } else { setSearchTreeData(null); } setScrollTop(0); - }, [searchValue]); + }, [searchValue, smoothTreeData]); return ( diff --git a/chat2db-client/src/pages/main/workspace/components/OperationLine/index.less b/chat2db-client/src/pages/main/workspace/components/OperationLine/index.less index 878062ce5..ff14b67fb 100644 --- a/chat2db-client/src/pages/main/workspace/components/OperationLine/index.less +++ b/chat2db-client/src/pages/main/workspace/components/OperationLine/index.less @@ -18,6 +18,6 @@ .searchBox{ flex-shrink: 0; - padding: 2px 4px; + padding: 4px; border-top: 1px solid var(--color-border-secondary); } \ No newline at end of file diff --git a/chat2db-client/src/pages/main/workspace/components/OperationLine/index.tsx b/chat2db-client/src/pages/main/workspace/components/OperationLine/index.tsx index fcf0ae75f..1a8901733 100644 --- a/chat2db-client/src/pages/main/workspace/components/OperationLine/index.tsx +++ b/chat2db-client/src/pages/main/workspace/components/OperationLine/index.tsx @@ -74,7 +74,7 @@ const OperationLine = (props: IProps) => { boxSize={20} size={14} /> - {searchIng ? ( + {/* {searchIng ? ( { setSearchIng(false); @@ -94,22 +94,22 @@ const OperationLine = (props: IProps) => { boxSize={20} size={14} /> - )} + )} */} {/*
1
*/} - {searchIng && ( -
- } - value={searchValue} - onChange={(e) => setSearchValue(e.target.value)} - allowClear - placeholder={i18n('workspace.tree.search.placeholder')} - /> -
- )} + {/* {searchIng && ( */} +
+ } + value={searchValue} + onChange={(e) => setSearchValue(e.target.value)} + allowClear + placeholder={i18n('workspace.tree.search.placeholder')} + /> +
+ {/* )} */} ); }; From 09d45f950b08e43a43f311dd94983a5128181af2 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Fri, 15 Dec 2023 14:52:58 +0800 Subject: [PATCH 05/37] fix:searchTree bug --- chat2db-client/src/blocks/Tree/index.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/chat2db-client/src/blocks/Tree/index.tsx b/chat2db-client/src/blocks/Tree/index.tsx index 349a55a07..c72b06f01 100644 --- a/chat2db-client/src/blocks/Tree/index.tsx +++ b/chat2db-client/src/blocks/Tree/index.tsx @@ -58,8 +58,9 @@ const isMatch = (target: string, searchValue: string) => { function searchTree(treeData: ITreeNode[], searchValue: string): ITreeNode[] { let result: ITreeNode[] = []; function dfs(node: ITreeNode, path: ITreeNode[] = []) { + console.log(node.name, searchValue, isMatch(node.name, searchValue)); if (isMatch(node.name, searchValue)) { - result = [...path, node]; + result = [...result,...path, node]; return true; } if (!node.children) return false; @@ -69,7 +70,9 @@ function searchTree(treeData: ITreeNode[], searchValue: string): ITreeNode[] { return false; } - treeData.some((node) => dfs(node)); + treeData.forEach((node) => dfs(node)); + + console.log(result,'result') result.forEach((item) => { if(!isMatch(item.name, searchValue)){ @@ -124,12 +127,14 @@ const Tree = (props: IProps) => { useEffect(() => { if (searchValue && treeData) { - setSearchTreeData(searchTree(cloneDeep(treeData), searchValue)); + const _searchTreeData = searchTree(cloneDeep(treeData), searchValue) + console.log(_searchTreeData) + setSearchTreeData(_searchTreeData); } else { setSearchTreeData(null); } setScrollTop(0); - }, [searchValue, smoothTreeData]); + }, [searchValue, smoothTreeData,treeData]); return ( From 3aa781a2ac575dc571d6718ef875b542aa8866f3 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Fri, 15 Dec 2023 14:55:39 +0800 Subject: [PATCH 06/37] delete console --- chat2db-client/src/blocks/Tree/index.tsx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/chat2db-client/src/blocks/Tree/index.tsx b/chat2db-client/src/blocks/Tree/index.tsx index c72b06f01..8e322b094 100644 --- a/chat2db-client/src/blocks/Tree/index.tsx +++ b/chat2db-client/src/blocks/Tree/index.tsx @@ -58,7 +58,6 @@ const isMatch = (target: string, searchValue: string) => { function searchTree(treeData: ITreeNode[], searchValue: string): ITreeNode[] { let result: ITreeNode[] = []; function dfs(node: ITreeNode, path: ITreeNode[] = []) { - console.log(node.name, searchValue, isMatch(node.name, searchValue)); if (isMatch(node.name, searchValue)) { result = [...result,...path, node]; return true; @@ -72,8 +71,6 @@ function searchTree(treeData: ITreeNode[], searchValue: string): ITreeNode[] { treeData.forEach((node) => dfs(node)); - console.log(result,'result') - result.forEach((item) => { if(!isMatch(item.name, searchValue)){ item.children = null; @@ -128,7 +125,6 @@ const Tree = (props: IProps) => { useEffect(() => { if (searchValue && treeData) { const _searchTreeData = searchTree(cloneDeep(treeData), searchValue) - console.log(_searchTreeData) setSearchTreeData(_searchTreeData); } else { setSearchTreeData(null); @@ -142,7 +138,6 @@ const Tree = (props: IProps) => {
{ - console.log(e.target.scrollTop); setScrollTop(e.target.scrollTop); }} > From f2a5bc3d6a1d65d08d38f871dcabff66abd3f22f Mon Sep 17 00:00:00 2001 From: shanhexi Date: Fri, 15 Dec 2023 17:05:40 +0800 Subject: [PATCH 07/37] fix:Switching tab causes edit data reset problem --- .../SearchResult/components/TableBox/index.tsx | 9 +++++---- chat2db-client/src/components/SearchResult/index.tsx | 5 +---- chat2db-client/src/components/Tabs/index.tsx | 2 +- .../main/workspace/components/WorkspaceTabs/index.tsx | 11 +++++++++++ 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/chat2db-client/src/components/SearchResult/components/TableBox/index.tsx b/chat2db-client/src/components/SearchResult/components/TableBox/index.tsx index df6482a5f..5f16fbc68 100644 --- a/chat2db-client/src/components/SearchResult/components/TableBox/index.tsx +++ b/chat2db-client/src/components/SearchResult/components/TableBox/index.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useMemo, useState, useContext } from 'react'; +import React, { useEffect, useMemo, useState } from 'react'; import { Dropdown, Input, MenuProps, message, Modal, Space, Popover, Spin, Button } from 'antd'; import { BaseTable, ArtColumn, useTablePipeline, features, SortItem } from 'ali-react-table'; import styled from 'styled-components'; @@ -37,7 +37,6 @@ import MonacoEditor from '../../../MonacoEditor'; import MyPagination from '../Pagination'; import StatusBar from '../StatusBar'; import RightClickMenu, { AllSupportedMenusType } from '../RightClickMenu'; -import { Context } from '../../index'; // 自定义hooks import useCurdTableData from '../../hooks/useCurdTableData'; @@ -49,6 +48,7 @@ interface ITableProps { outerQueryResultData: IManageResultData; executeSqlParams: any; tableBoxId: string; + isActive?: boolean; } interface IViewTableCellData { @@ -102,10 +102,9 @@ const defaultPaginationConfig: IResultConfig = { export const TableContext = React.createContext({} as any); export default function TableBox(props: ITableProps) { - const { className, outerQueryResultData, tableBoxId } = props; + const { className, outerQueryResultData, isActive } = props; const [viewTableCellData, setViewTableCellData] = useState(null); const [, contextHolder] = message.useMessage(); - const { activeTabId } = useContext(Context); const [paginationConfig, setPaginationConfig] = useState(defaultPaginationConfig); // sql查询结果 const [queryResultData, setQueryResultData] = useState(outerQueryResultData); @@ -1096,6 +1095,7 @@ export default function TableBox(props: ITableProps) { }, [queryResultData, viewTableCellData]); return ( + isActive ?
{renderContent()} {contextHolder}
+ : false ); } diff --git a/chat2db-client/src/components/SearchResult/index.tsx b/chat2db-client/src/components/SearchResult/index.tsx index a3cbc00fa..65d882e79 100644 --- a/chat2db-client/src/components/SearchResult/index.tsx +++ b/chat2db-client/src/components/SearchResult/index.tsx @@ -24,7 +24,6 @@ import i18n from '@/i18n'; import sqlServer, { IExecuteSqlParams } from '@/service/sql'; import { v4 as uuidV4 } from 'uuid'; import { Spin } from 'antd'; -import { useWorkspaceStore } from '@/pages/main/workspace/store'; interface IProps { className?: string; @@ -113,11 +112,11 @@ export default forwardRef((props: IProps, ref: ForwardedRef) = function renderSuccessResult() { const needTable = queryResultData?.headerList?.length > 1; return ( - isActive ?
{needTable ? ( ) = )}
- : - false ); } return ( diff --git a/chat2db-client/src/components/Tabs/index.tsx b/chat2db-client/src/components/Tabs/index.tsx index b60956dc9..4517da889 100644 --- a/chat2db-client/src/components/Tabs/index.tsx +++ b/chat2db-client/src/components/Tabs/index.tsx @@ -1,7 +1,7 @@ import React, { memo, useEffect, useState, useRef } from 'react'; import classnames from 'classnames'; import Iconfont from '@/components/Iconfont'; -import { Popover, Dropdown, MenuProps } from 'antd'; +import { Popover, Dropdown } from 'antd'; import i18n from '@/i18n'; import { isValid } from '@/utils/check'; import _ from 'lodash'; diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.tsx b/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.tsx index da01f2cd8..796b20bda 100644 --- a/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.tsx +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.tsx @@ -124,6 +124,17 @@ const WorkspaceTabs = memo(() => { name: t.label, }; historyService.updateSavedConsole(_params); + + const _workspaceTabList:any = workspaceTabList?.map((item) => { + if (item.id === t.key) { + return { + ...item, + title: t.label, + }; + } + return item; + }) || [] + setWorkspaceTabList(_workspaceTabList) }; // 修改tab详情 From 7d90ce4c6bc0d7d4a7edb937551a9e66b8ca8d05 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Fri, 15 Dec 2023 22:55:07 +0800 Subject: [PATCH 08/37] fix:Tree search bug --- CHANGELOG.md | 10 +++++++++ CHANGELOG_CN.md | 10 +++++++++ chat2db-client/src/blocks/Tree/index.tsx | 26 +++++++++++++++++++----- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7acc425b9..4b5a44eb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## 3.1.13 + +`2023-12-15` + +**更新日志** + +- 🐞【Fixed】Switching tab causes edit data reset problem +- 🐞【Fixed】Rename is reset after switching tab + + ## 3.1.12 `2023-12-15` diff --git a/CHANGELOG_CN.md b/CHANGELOG_CN.md index f70d54c26..1967c4669 100644 --- a/CHANGELOG_CN.md +++ b/CHANGELOG_CN.md @@ -1,3 +1,13 @@ +## 3.1.13 + +`2023-12-15` + +**更新日志** + +- 🐞【修复】切换tab导致编辑数据重置问题 +- 🐞【修复】切换tab后重命名被重置 + + ## 3.1.12 `2023-12-15` diff --git a/chat2db-client/src/blocks/Tree/index.tsx b/chat2db-client/src/blocks/Tree/index.tsx index 8e322b094..fe63331ed 100644 --- a/chat2db-client/src/blocks/Tree/index.tsx +++ b/chat2db-client/src/blocks/Tree/index.tsx @@ -57,29 +57,45 @@ const isMatch = (target: string, searchValue: string) => { // 树结构搜索 function searchTree(treeData: ITreeNode[], searchValue: string): ITreeNode[] { let result: ITreeNode[] = []; + + // 深度优先遍历 function dfs(node: ITreeNode, path: ITreeNode[] = []) { if (isMatch(node.name, searchValue)) { + // debugger result = [...result,...path, node]; - return true; + // return true; } if (!node.children) return false; for (const child of node.children) { - if (dfs(child, [...path, node])) return true; + // debugger + if (dfs(child, [...path, node])){ + return true; + } } return false; } + // 遍历树 treeData.forEach((node) => dfs(node)); + // 如果不匹配,说明该节点为path,不需要保留该节点的子元素,就把children置空 result.forEach((item) => { if(!isMatch(item.name, searchValue)){ item.children = null; } }); + // tree转平级 const smoothTreeList: ITreeNode[] = [] smoothTree(result, smoothTreeList); - return smoothTreeList; + + // 对smoothTreeList根据uuid去重 + const deWeightList: ITreeNode[] = []; + smoothTreeList.forEach((item) => { + deWeightList.findIndex((i) => i.uuid === item.uuid) === -1 && deWeightList.push(item); + }); + + return deWeightList; } const itemHeight = 26; // 每个 item 的高度 @@ -126,11 +142,11 @@ const Tree = (props: IProps) => { if (searchValue && treeData) { const _searchTreeData = searchTree(cloneDeep(treeData), searchValue) setSearchTreeData(_searchTreeData); + setScrollTop(0); } else { setSearchTreeData(null); } - setScrollTop(0); - }, [searchValue, smoothTreeData,treeData]); + }, [searchValue, treeData]); return ( From 097c878c620552fd2ec5ce8982be502b0e78cc14 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Fri, 15 Dec 2023 23:31:56 +0800 Subject: [PATCH 09/37] changelog --- CHANGELOG.md | 5 +++-- CHANGELOG_CN.md | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b5a44eb5..d5bef3eff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,9 @@ `2023-12-15` -**更新日志** +**Changelog** +- 🐞【Fixed】Tree structure search for bugs - 🐞【Fixed】Switching tab causes edit data reset problem - 🐞【Fixed】Rename is reset after switching tab @@ -78,7 +79,7 @@ `2023-11-13` -**更新日志** +**Changelog** - 🐞【Fixed】Copy as insert first row lost problem - 🐞【Fixed】DM database index bug diff --git a/CHANGELOG_CN.md b/CHANGELOG_CN.md index 1967c4669..cf141813b 100644 --- a/CHANGELOG_CN.md +++ b/CHANGELOG_CN.md @@ -4,6 +4,7 @@ **更新日志** +- 🐞【修复】树结构搜索bug - 🐞【修复】切换tab导致编辑数据重置问题 - 🐞【修复】切换tab后重命名被重置 From c2346097adbf2f4cdb045dbd49f5a64d1c895cd0 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Sun, 17 Dec 2023 20:36:51 +0800 Subject: [PATCH 10/37] fix:Tree search bugs --- .../src/blocks/Setting/About/index.tsx | 2 - .../src/blocks/Tree/functions/refresh.ts | 1 - chat2db-client/src/blocks/Tree/index.tsx | 132 ++++++++++++------ .../src/components/ConsoleEditor/index.tsx | 2 +- .../src/components/MonacoEditor/index.tsx | 1 - .../components/WorkspaceLeftHeader/index.tsx | 2 - .../components/WorkspaceTabs/index.tsx | 1 - 7 files changed, 90 insertions(+), 51 deletions(-) diff --git a/chat2db-client/src/blocks/Setting/About/index.tsx b/chat2db-client/src/blocks/Setting/About/index.tsx index ad22ea107..5bd9ce050 100644 --- a/chat2db-client/src/blocks/Setting/About/index.tsx +++ b/chat2db-client/src/blocks/Setting/About/index.tsx @@ -29,8 +29,6 @@ export default function AboutUs(props: IProps) { }; }); - console.log('holdingService', holdingService); - const onChangeUpdateRul = (e) => { configService.setAppUpdateType(e.target.value).then(() => { setUpdateRule(e.target.value); diff --git a/chat2db-client/src/blocks/Tree/functions/refresh.ts b/chat2db-client/src/blocks/Tree/functions/refresh.ts index d925800b2..ecfa705a4 100644 --- a/chat2db-client/src/blocks/Tree/functions/refresh.ts +++ b/chat2db-client/src/blocks/Tree/functions/refresh.ts @@ -4,5 +4,4 @@ export const refreshTreeNode = (props:{ treeNodeData: ITreeNode; }) => { const { treeNodeData } = props; - console.log(treeNodeData) } diff --git a/chat2db-client/src/blocks/Tree/index.tsx b/chat2db-client/src/blocks/Tree/index.tsx index fe63331ed..15ccbfb83 100644 --- a/chat2db-client/src/blocks/Tree/index.tsx +++ b/chat2db-client/src/blocks/Tree/index.tsx @@ -29,6 +29,8 @@ interface TreeNodeIProps { interface IContext { treeData: ITreeNode[]; setTreeData: (value: ITreeNode[] | null) => void; + searchTreeData: ITreeNode[] | null; + setSearchTreeData: (value: ITreeNode[] | null) => void; } export const Context = createContext({} as any); @@ -48,6 +50,21 @@ const smoothTree = (treeData: ITreeNode[], result: ITreeNode[] = [], parentNode? return result; }; +// 平级转树 +function tranListToTreeData(list:ITreeNode[], rootValue) { + const arr:ITreeNode[] = [] + list.forEach((item:ITreeNode) => { + if (item.parentNode?.uuid === rootValue) { + arr.push(item) + const children = tranListToTreeData(list, item.uuid) + if (children.length) { + item.children = children + } + } + }) + return arr +} + // 判断是否匹配 const isMatch = (target: string, searchValue: string) => { const reg = new RegExp(searchValue, 'i'); @@ -61,41 +78,29 @@ function searchTree(treeData: ITreeNode[], searchValue: string): ITreeNode[] { // 深度优先遍历 function dfs(node: ITreeNode, path: ITreeNode[] = []) { if (isMatch(node.name, searchValue)) { - // debugger - result = [...result,...path, node]; - // return true; + result = [...result, ...path, node]; + return; } - if (!node.children) return false; - for (const child of node.children) { - // debugger - if (dfs(child, [...path, node])){ - return true; - } - } - return false; + if (!node.children) return; + node.children.forEach((child) => { + dfs(child, [...path, node]); + }); } // 遍历树 treeData.forEach((node) => dfs(node)); - // 如果不匹配,说明该节点为path,不需要保留该节点的子元素,就把children置空 + // 根据uuid去重 + const deWeightList: ITreeNode[] = []; result.forEach((item) => { - if(!isMatch(item.name, searchValue)){ + // 如果不匹配,说明该节点为path,不需要保留该节点的子元素,就把children置空 + if (!isMatch(item.name, searchValue)) { item.children = null; } - }); - - // tree转平级 - const smoothTreeList: ITreeNode[] = [] - smoothTree(result, smoothTreeList); - - // 对smoothTreeList根据uuid去重 - const deWeightList: ITreeNode[] = []; - smoothTreeList.forEach((item) => { deWeightList.findIndex((i) => i.uuid === item.uuid) === -1 && deWeightList.push(item); }); - return deWeightList; + return tranListToTreeData(deWeightList, undefined); } const itemHeight = 26; // 每个 item 的高度 @@ -106,6 +111,8 @@ const Tree = (props: IProps) => { const [treeData, setTreeData] = useState(null); const [smoothTreeData, setSmoothTreeData] = useState([]); const [searchTreeData, setSearchTreeData] = useState(null); // 搜索结果 + const [searchSmoothTreeData, setSearchSmoothTreeData] = useState(null); // 搜索结果 平级 + const [scrollTop, setScrollTop] = useState(0); // 滚动位置 // 继续需要渲染的 item 索引有哪些 const startIdx = useMemo(() => { @@ -131,26 +138,45 @@ const Tree = (props: IProps) => { } }, [treeData]); + // 搜索结果转平级 + useEffect(() => { + if (searchTreeData) { + const result: ITreeNode[] = []; + smoothTree(searchTreeData, result); + setSearchSmoothTreeData(result); + } else { + setSearchSmoothTreeData(null); + } + }, [searchTreeData]); + const treeNodes = useMemo(() => { - const realNodeList = (searchTreeData || smoothTreeData).slice(startIdx, startIdx + 50); + const realNodeList = (searchSmoothTreeData || smoothTreeData).slice(startIdx, startIdx + 50); return realNodeList.map((item) => { - return ; + return ; }); - }, [smoothTreeData, searchTreeData, startIdx]); + }, [smoothTreeData, searchSmoothTreeData, startIdx]); useEffect(() => { if (searchValue && treeData) { - const _searchTreeData = searchTree(cloneDeep(treeData), searchValue) + const _searchTreeData = searchTree(cloneDeep(treeData), searchValue); setSearchTreeData(_searchTreeData); setScrollTop(0); } else { setSearchTreeData(null); } - }, [searchValue, treeData]); + }, [searchValue]); + return ( - +
{ @@ -159,7 +185,7 @@ const Tree = (props: IProps) => { >
{treeNodes} @@ -174,7 +200,7 @@ const TreeNode = memo((props: TreeNodeIProps) => { const { data: treeNodeData, level } = props; const [isLoading, setIsLoading] = useState(false); const indentArr = new Array(level).fill('indent'); - const { treeData, setTreeData } = useContext(Context); + const { treeData, setTreeData, searchTreeData, setSearchTreeData } = useContext(Context); // 加载数据 function loadData(_props?: { refresh: boolean; pageNo: number; treeNodeData?: ITreeNode }) { @@ -182,7 +208,10 @@ const TreeNode = memo((props: TreeNodeIProps) => { const treeNodeConfig: ITreeConfigItem = treeConfig[_treeNodeData.pretendNodeType || _treeNodeData.treeNodeType]; setIsLoading(true); if (_props?.pageNo === 1 || !_props?.pageNo) { - insertData(treeData!, _treeNodeData.uuid!, null); + insertData(treeData!, _treeNodeData.uuid!, null,[treeData, setTreeData]); + if(searchTreeData){ + insertData(searchTreeData!, _treeNodeData.uuid!, null,[searchTreeData, setSearchTreeData]); + } } treeNodeConfig @@ -197,7 +226,10 @@ const TreeNode = memo((props: TreeNodeIProps) => { .then((res: any) => { if (res.length || res.data) { if (res.data) { - insertData(treeData!, _treeNodeData.uuid!, res.data); + insertData(treeData!, _treeNodeData.uuid!, res.data, [treeData, setTreeData]); + if(searchTreeData){ + insertData(searchTreeData!, _treeNodeData.uuid!, res.data,[searchTreeData, setSearchTreeData]); + } // TODO: if (res.hasNextPage) { loadData({ @@ -206,7 +238,10 @@ const TreeNode = memo((props: TreeNodeIProps) => { }); } } else { - insertData(treeData!, _treeNodeData.uuid!, res); + insertData(treeData!, _treeNodeData.uuid!, res,[treeData, setTreeData]); + if(searchTreeData){ + insertData(searchTreeData!, _treeNodeData.uuid!, res,[searchTreeData, setSearchTreeData]); + } } setIsLoading(false); } else { @@ -215,7 +250,10 @@ const TreeNode = memo((props: TreeNodeIProps) => { _treeNodeData.pretendNodeType = treeNodeConfig.next; loadData(); } else { - insertData(treeData!, _treeNodeData.uuid!, []); + insertData(treeData!, _treeNodeData.uuid!, [],[treeData, setTreeData]); + if(searchTreeData){ + insertData(searchTreeData!, _treeNodeData.uuid!, [],[searchTreeData, setSearchTreeData]); + } setIsLoading(false); } } @@ -229,23 +267,28 @@ const TreeNode = memo((props: TreeNodeIProps) => { const isFocus = useTreeStore((state) => state.focusId) === treeNodeData.uuid; // 在treeData中找到对应的节点,插入数据 - const insertData = (_treeData: ITreeNode[], uuid: string, data: any): ITreeNode | null => { + const insertData = (_treeData: ITreeNode[], uuid: string, data: any, originalDataList:any): ITreeNode | null => { + const [originalData,setOriginalData] = originalDataList let result: ITreeNode | null = null; for (let i = 0; i < _treeData?.length; i++) { if (_treeData[i].uuid === uuid) { result = _treeData[i]; if (data) { - result.children = [...(result.children || []), ...(data || [])]; + data.map((item: any) => { + item.parentNode = result; + }); + // result.children = [...(result.children || []), ...(data || [])]; + result.children = [...(data || [])]; } else { result.children = null; } - result.expanded = !!data; + // result.expanded = !!data; // 这里没写错 就是要改变treeData的引用 - setTreeData?.(cloneDeep(treeData || [])); + setOriginalData?.([...(originalData || [])]); break; } else { if (_treeData[i].children) { - result = insertData(_treeData[i].children!, uuid, data); + result = insertData(_treeData[i].children!, uuid, data, originalDataList); if (result) { break; } @@ -257,8 +300,11 @@ const TreeNode = memo((props: TreeNodeIProps) => { //展开-收起 const handleClick = () => { - if (treeNodeData.expanded) { - insertData(treeData!, treeNodeData.uuid!, null); + if (treeNodeData?.children?.length) { + insertData(treeData!, treeNodeData.uuid!, null,[treeData, setTreeData]); + if(searchTreeData){ + insertData(searchTreeData!, treeNodeData.uuid!, null,[searchTreeData, setSearchTreeData]); + } } else { loadData(); } @@ -372,7 +418,7 @@ const TreeNode = memo((props: TreeNodeIProps) => { ); - }, [isFocus, isLoading, rightClickMenu]); + }, [isFocus, isLoading, rightClickMenu, searchTreeData]); return treeNodeDom; }); diff --git a/chat2db-client/src/components/ConsoleEditor/index.tsx b/chat2db-client/src/components/ConsoleEditor/index.tsx index 280cb3996..639043a1d 100644 --- a/chat2db-client/src/components/ConsoleEditor/index.tsx +++ b/chat2db-client/src/components/ConsoleEditor/index.tsx @@ -436,7 +436,7 @@ function ConsoleEditor(props: IProps, ref: ForwardedRef) { setIsStream(false); closeEventSource.current && closeEventSource.current(); } catch (error) { - console.log('close drawer', error); + // console.log('close drawer', error); } }} > diff --git a/chat2db-client/src/components/MonacoEditor/index.tsx b/chat2db-client/src/components/MonacoEditor/index.tsx index 6bf4a61b8..ef37401d0 100644 --- a/chat2db-client/src/components/MonacoEditor/index.tsx +++ b/chat2db-client/src/components/MonacoEditor/index.tsx @@ -201,7 +201,6 @@ function MonacoEditor(props: IProps, ref: ForwardedRef) { if (_id === 'changeSQL') { ed.trigger('', quickInputCommand.current, (quickInput) => { quickInput.pick(databaseTypeList).then((selected) => { - console.log(selected); runFn(selectedText, selected?.label); }); }); diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceLeftHeader/index.tsx b/chat2db-client/src/pages/main/workspace/components/WorkspaceLeftHeader/index.tsx index 7dae67f9c..b678d3b29 100644 --- a/chat2db-client/src/pages/main/workspace/components/WorkspaceLeftHeader/index.tsx +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceLeftHeader/index.tsx @@ -29,8 +29,6 @@ export default memo(() => { }; }); - console.log('currentConnectionDetails', currentConnectionDetails); - const renderConnectionLabel = (item: IConnectionListItem) => { return (
diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.tsx b/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.tsx index 796b20bda..eb5bf793a 100644 --- a/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.tsx +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.tsx @@ -206,7 +206,6 @@ const WorkspaceTabs = memo(() => { // 渲染所有表 const renderViewAllTable = (item: IWorkspaceTab) => { const { uniqueData } = item; - console.log('uniqueData', uniqueData); return ; }; From 183d12dc959022ef3b590d2358463bf39915e1aa Mon Sep 17 00:00:00 2001 From: shanhexi Date: Sun, 17 Dec 2023 20:44:07 +0800 Subject: [PATCH 11/37] changelog --- CHANGELOG.md | 4 ++-- CHANGELOG_CN.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5bef3eff..1f5d41952 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ -## 3.1.13 +## 3.1.14 -`2023-12-15` +`2023-12-17` **Changelog** diff --git a/CHANGELOG_CN.md b/CHANGELOG_CN.md index cf141813b..8851f7d98 100644 --- a/CHANGELOG_CN.md +++ b/CHANGELOG_CN.md @@ -1,6 +1,6 @@ -## 3.1.13 +## 3.1.14 -`2023-12-15` +`2023-12-17` **更新日志** From 999b5cf83162da87208a2be79a9d13f26c64a43e Mon Sep 17 00:00:00 2001 From: shanhexi Date: Mon, 18 Dec 2023 13:13:52 +0800 Subject: [PATCH 12/37] fix: Every time I open the application, I occasionally cannot select the database problem --- CHANGELOG.md | 9 +++++++++ CHANGELOG_CN.md | 10 ++++++++++ .../components/SelectBoundInfo/index.tsx | 12 ++++++------ .../workspace/components/WorkspaceTabs/index.tsx | 4 +++- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f5d41952..afc1bdd02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 3.1.15 + +`2023-12-18` + +**Changelog** + +- 🐞【Fixed】Every time I open the application, I occasionally cannot select the database problem +- 🐞【Fixed】Compatible with old data types can not show deletion problems + ## 3.1.14 `2023-12-17` diff --git a/CHANGELOG_CN.md b/CHANGELOG_CN.md index 8851f7d98..63bd23940 100644 --- a/CHANGELOG_CN.md +++ b/CHANGELOG_CN.md @@ -1,3 +1,13 @@ +## 3.1.15 + +`2023-12-18` + +**更新日志** + +- 🐞【修复】每次打开应用时,偶现无法选择数据库问题 +- 🐞【修复】兼容老数据类型无法显示删除问题 + + ## 3.1.14 `2023-12-17` diff --git a/chat2db-client/src/components/ConsoleEditor/components/SelectBoundInfo/index.tsx b/chat2db-client/src/components/ConsoleEditor/components/SelectBoundInfo/index.tsx index 0e9ddaede..e277204e9 100644 --- a/chat2db-client/src/components/ConsoleEditor/components/SelectBoundInfo/index.tsx +++ b/chat2db-client/src/components/ConsoleEditor/components/SelectBoundInfo/index.tsx @@ -55,11 +55,11 @@ const SelectBoundInfo = memo((props: IProps) => { const supportDatabase = useMemo(() => { return connectionList?.find((item) => item.id === boundInfo.dataSourceId)?.supportDatabase; - }, [boundInfo.dataSourceId]); + }, [boundInfo.dataSourceId,connectionList]); const supportSchema = useMemo(() => { return connectionList?.find((item) => item.id === boundInfo.dataSourceId)?.supportSchema; - }, [boundInfo.dataSourceId]); + }, [boundInfo.dataSourceId,connectionList]); // 编辑器绑定的数据库类型变化时,重新注册智能提示 useEffect(() => { @@ -105,8 +105,8 @@ const SelectBoundInfo = memo((props: IProps) => { // 获取数据库列表 const getDatabaseList = () => { - if(boundInfo.dataSourceId === undefined || boundInfo.dataSourceId === null){ - return + if (boundInfo.dataSourceId === undefined || boundInfo.dataSourceId === null) { + return; } connectionService .getDatabaseList({ @@ -134,8 +134,8 @@ const SelectBoundInfo = memo((props: IProps) => { // 获取schema列表 const getSchemaList = () => { - if(boundInfo.dataSourceId === undefined || boundInfo.dataSourceId === null){ - return + if (boundInfo.dataSourceId === undefined || boundInfo.dataSourceId === null) { + return; } connectionService .getSchemaList({ diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.tsx b/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.tsx index eb5bf793a..8ac4b7258 100644 --- a/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.tsx +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.tsx @@ -102,7 +102,8 @@ const WorkspaceTabs = memo(() => { ); data.forEach((item) => { const editData = workspaceTabList?.find((t) => t.id === item.key); - if (editData?.type === WorkspaceTabType.CONSOLE) { + // table 为了兼容老数据 + if (editData?.type === WorkspaceTabType.CONSOLE || editData?.type === 'table' as any) { closeWindowTab(item.key as number); } }); @@ -212,6 +213,7 @@ const WorkspaceTabs = memo(() => { // 根据不同的tab类型渲染不同的内容 const workspaceTabConnectionMap = (item: IWorkspaceTab) => { switch (item.type) { + case 'table' as any: // 为了兼容老数据 case WorkspaceTabType.CONSOLE: case WorkspaceTabType.FUNCTION: case WorkspaceTabType.PROCEDURE: From 90037b7cbe3f832f138be175ba78ca0b03de38dc Mon Sep 17 00:00:00 2001 From: Samet UCA Date: Mon, 18 Dec 2023 19:32:45 +0300 Subject: [PATCH 13/37] added turkish language --- .vscode/settings.json | 3 +- .../src/blocks/Setting/BaseSetting/index.tsx | 1 + chat2db-client/src/constants/theme.ts | 1 + chat2db-client/src/i18n/index.tsx | 2 + chat2db-client/src/i18n/tr-tr/chat.ts | 10 ++ chat2db-client/src/i18n/tr-tr/common.ts | 122 ++++++++++++++++++ chat2db-client/src/i18n/tr-tr/connection.ts | 37 ++++++ chat2db-client/src/i18n/tr-tr/dashboard.ts | 12 ++ chat2db-client/src/i18n/tr-tr/editTable.ts | 38 ++++++ .../src/i18n/tr-tr/editTableData.ts | 7 + chat2db-client/src/i18n/tr-tr/index.ts | 28 ++++ chat2db-client/src/i18n/tr-tr/login.ts | 13 ++ chat2db-client/src/i18n/tr-tr/menu.ts | 3 + chat2db-client/src/i18n/tr-tr/setting.ts | 59 +++++++++ chat2db-client/src/i18n/tr-tr/sqlEditor.ts | 9 ++ chat2db-client/src/i18n/tr-tr/team.ts | 54 ++++++++ chat2db-client/src/i18n/tr-tr/workspace.ts | 34 +++++ 17 files changed, 432 insertions(+), 1 deletion(-) create mode 100644 chat2db-client/src/i18n/tr-tr/chat.ts create mode 100644 chat2db-client/src/i18n/tr-tr/common.ts create mode 100644 chat2db-client/src/i18n/tr-tr/connection.ts create mode 100644 chat2db-client/src/i18n/tr-tr/dashboard.ts create mode 100644 chat2db-client/src/i18n/tr-tr/editTable.ts create mode 100644 chat2db-client/src/i18n/tr-tr/editTableData.ts create mode 100644 chat2db-client/src/i18n/tr-tr/index.ts create mode 100644 chat2db-client/src/i18n/tr-tr/login.ts create mode 100644 chat2db-client/src/i18n/tr-tr/menu.ts create mode 100644 chat2db-client/src/i18n/tr-tr/setting.ts create mode 100644 chat2db-client/src/i18n/tr-tr/sqlEditor.ts create mode 100644 chat2db-client/src/i18n/tr-tr/team.ts create mode 100644 chat2db-client/src/i18n/tr-tr/workspace.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index 0075f3fc0..b2967e218 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -86,5 +86,6 @@ "yapi", "yizhoumo", "zustand" - ] + ], + "java.compile.nullAnalysis.mode": "automatic" } diff --git a/chat2db-client/src/blocks/Setting/BaseSetting/index.tsx b/chat2db-client/src/blocks/Setting/BaseSetting/index.tsx index 013f37ac8..decc943a2 100644 --- a/chat2db-client/src/blocks/Setting/BaseSetting/index.tsx +++ b/chat2db-client/src/blocks/Setting/BaseSetting/index.tsx @@ -145,6 +145,7 @@ export default function BaseSetting() { 简体中文 English + English
{i18n('setting.title.themeColor')}
diff --git a/chat2db-client/src/constants/theme.ts b/chat2db-client/src/constants/theme.ts index 637df2ba7..0bef9a190 100644 --- a/chat2db-client/src/constants/theme.ts +++ b/chat2db-client/src/constants/theme.ts @@ -24,4 +24,5 @@ export enum PrimaryColorType { export enum LangType { EN_US = 'en-us', ZH_CN = 'zh-cn', + TR_TR = 'tr-tr', } diff --git a/chat2db-client/src/i18n/index.tsx b/chat2db-client/src/i18n/index.tsx index 986cf94f7..009ced3ae 100644 --- a/chat2db-client/src/i18n/index.tsx +++ b/chat2db-client/src/i18n/index.tsx @@ -15,6 +15,8 @@ export const isEn = currentLang === LangType.EN_US; export const isZH = currentLang === LangType.ZH_CN; +export const isTR = currentLang === LangType.TR_TR; + const langSet: Record = locale[currentLang]; function i18n(key: keyof typeof zhCN, ...args: any[]) { diff --git a/chat2db-client/src/i18n/tr-tr/chat.ts b/chat2db-client/src/i18n/tr-tr/chat.ts new file mode 100644 index 000000000..1cda385df --- /dev/null +++ b/chat2db-client/src/i18n/tr-tr/chat.ts @@ -0,0 +1,10 @@ +export default { + 'chat.input.remain': 'Kalan {1}', + 'chat.input.tableSelect.placeholder': 'Lütfen tabloları seçin', + 'chat.input.tableSelect.error.TooManyTable': 'En fazla 8 tablo seçebilirsiniz', + 'chat.input.remain.dialog.tips': + 'Resmi WeChat hesabımıza abone olun, daha fazla deneyim şansı için 推广 gönderin.', + 'chat.input.syncTable.tips': 'Otomatik olarak tüm tablo yapılarını AI bağlamına senkronize eder', + 'chat.input.remain.tooltip': 'Manuel olarak seçilen tablo, AI bağlamına senkronize edilecektir', + 'chat.input.syncTable.tempTips': '🎉Güncelleme: Otomatik olarak tüm tablo yapılarını AI bağlamına senkronize etme', +}; diff --git a/chat2db-client/src/i18n/tr-tr/common.ts b/chat2db-client/src/i18n/tr-tr/common.ts new file mode 100644 index 000000000..db76a918b --- /dev/null +++ b/chat2db-client/src/i18n/tr-tr/common.ts @@ -0,0 +1,122 @@ +export default { + 'common.text.no': 'hayır', + 'common.text.is': 'dir', + 'common.button.affirm': 'Onayla', + 'common.button.edit': 'Düzenle', + 'common.button.modify': 'Değiştir', + 'common.button.confirm': 'Onayla', + 'common.button.cancel': 'İptal', + 'common.data.hour': '{1} {saat|saat}', + 'common.data.minute': '{1} {dakika|dakika}', + 'common.tip.yesterday': '{1} dün', + 'common.tip.tomorrow': '{1} yarın', + 'common.tip.ago': ' önce', + 'common.tip.later': ' sonra', + 'common.tip.now': 'Şimdi', + 'common.tip.justNow': 'Şu an', + 'common.text.search': 'arama', + 'common.placeholder.select': 'Lütfen Seçin {1}', + 'common.text.serviceStarting': 'Hizmet Başlatılıyor ...', + 'common.text.serviceFail': 'Hizmet başlatma başarısız oldu. Lütfen sayfayı yeniden yenilemeyi deneyin...', + 'common.text.column': 'kolon', + 'common.text.row': 'satır', + 'common.text.indexes': 'indeksler', + 'common.button.save': 'Kaydet', + 'common.button.open': 'Aç', + 'common.button.refresh': 'Yenile', + 'common.button.execute': 'Çalıştır', + "common.button.import": 'SQL İçe Aktar', + 'common.button.format': 'Biçimlendir', + 'common.message.successfulConfig': 'Başarılı yapılandırma', + 'common.text.successful': 'başarılı', + 'common.text.failure': 'başarısızlık', + 'common.message.modifySuccessfully': 'başarıyla değiştirildi', + 'common.message.addedSuccessfully': 'başarıyla eklendi', + 'common.text.custom': 'özel', + 'common.button.delete': 'Sil', + 'common.text.executionResult': 'Sonuç {1}', + 'common.tips.deleteTable': 'Bu Tabloyu Silmek İstediğinizden Emin Misiniz?', + 'common.text.tableName': 'Tablo Adı', + 'common.text.submittedSuccessfully': 'Başarıyla Gönderildi', + 'common.text.successfullyDelete': 'Başarıyla Silindi', + 'common.text.explainSQL': 'SQL Açıkla', + 'common.text.optimizeSQL': 'SQL Optimizasyonu', + 'common.text.conversionSQL': 'SQL Dönüşümü', + 'common.text.table': 'Tablo', + 'common.tips.saveSuccessfully': 'Başarıyla Kaydedildi', + 'common.button.copy': 'Kopyala', + 'common.button.copyName': 'Adı Kopyala', + 'common.button.copySuccessfully': 'Başarıyla Kopyalandı', + 'common.button.createConsole': 'Konsol Oluştur', + 'common.button.exportWord': 'Word\'e Aktar', + 'common.button.exportExcel': 'Excel\'e Aktar', + 'common.button.exportHtml': 'Html\'e Aktar', + 'common.button.exportMarkdown': 'Markdown\'a Aktar', + 'common.button.exportPdf': 'Pdf\'e Aktar', + 'common.text.successfulExecution': 'Başarılı İşlem', + 'common.text.result': 'Sonuç', + 'common.text.timeConsuming': 'Zaman Harcama', + 'common.text.searchRow': 'Satır Ara', + 'common.text.noData': 'Veri Yok', + 'common.text.remindMeLater': 'Beni Sonra Hatırlat', + 'common.text.goToUpdate': 'Güncellemeye Git', + 'common.text.updateReminder': 'Güncelleme Hatırlatıcısı', + 'common.text.detectionLatestVersion': 'Son sürüm izleniyor', + 'common.text.setting': 'Ayar', + 'common.text.tryToRestart': 'Yeniden Başlatmayı Deneyin', + 'common.text.contactUs': 'Bize Ulaşın', + 'common.text.wechatPopularizeAi': 'WeChat resmi hesabımızı takip edin, "AI" göndererek ücretsiz deneyimler alın.', + 'common.text.wechatPopularizeAi2': + 'WeChat resmi hesabımızı takip edin, "AI" göndererek ücretsiz ApiKey alın ve deneyim sayısını hediye edin.', + 'common.text.wechatPopularize': 'Daha fazla ücretsiz deneyim almak için "promotion" gönderebilirsiniz.', + 'common.text.export': 'Dışa Aktar', + 'common.notification.detail': 'Daha fazla detay', + 'common.notification.solution': 'Çözüm', + 'common.button.copyError': 'Hata raporunu kopyala', + 'common.button.copyErrorTips': + '(Arayüz bilgileri ve ayrıntılı parametreler buraya kopyalanacaktır. Hassas parametreler varsa önce JSON ayrıştırın ve sonra gönderin)', + 'common.tips.formatError': 'Biçimlendirme başarısız, sql\'in doğru olup olmadığını kontrol edin', + 'common.text.executeSelectedSQL': 'Seçilen SQL\'i Çalıştır', + 'common.text.refreshPage': 'Sayfayı Yenile', + 'common.text.saveConsole': 'Konsolu Kaydet', + 'common.text.textToSQL': 'Düz metinleri SQL\'e', + 'common.text.editorRightClick': 'Düzenleyici sağ tıklama', + 'common.form.error.required': 'Bu alan zorunludur!', + 'common.form.error.email': 'Girdi geçerli bir e-posta değil!', + 'common.tips.delete.confirm': 'Emin misiniz silmek için?', + 'common.tips.updateSuccess': 'Başarıyla Güncellendi', + 'common.tips.createSuccess': 'Başarıyla Oluşturuldu', + 'common.text.action': 'Eylem', + 'common.button.add': 'Ekle', + 'common.text.errorMessage': 'Hata Mesajı', + 'common.button.cancelRequest': 'İsteği İptal Et', + 'common.button.executionError': 'Çalıştırma Hatası', + 'common.text.affectedRows': 'Etkilenen satırlar: {1}', + 'common.text.selectFile' : 'Dosya Seç', + 'common.text.noTableFoundUp' : 'Bu veritabanında tablo bulunmamaktadır', + 'common.text.noTableFoundDown': 'Üstte veritabanını değiştirin', + 'common.title.preview': 'Önizleme', + 'common.title.errorMessage': 'Hata mesajı', + 'common.label.comment': 'Yorum', + 'common.label.name': 'Ad', + 'common.title.create': 'Oluştur', + 'common.title.executiveLogging': 'Yürütme Günlüğü', + 'common.text.executionTime': '{1} ms içinde etkilendi', + 'common.button.copyRowAs': 'Satırı Kopyala', + 'common.button.insertSql': 'SQL Ekle', + 'common.button.updateSql': 'SQL Güncelle', + 'common.button.tabularSeparatedValues': 'TAB sınırlı (veri)', + 'common.button.tabularSeparatedValuesFieldName': 'TAB sınırlı (alan adı)', + 'common.button.tabularSeparatedValuesFieldNameAndData': 'TAB ayrılmış (alan adları ve veri)', + 'common.button.cloneRow': 'Satırı Kopyala', + 'common.button.deleteRow': 'Satırı Sil', + 'common.button.setNull': 'NULL Ayarla', + 'common.button.setDefault': 'DEFAULT Ayarla', + 'common.button.viewData': 'Veriyi Görüntüle/Düzenle', + 'common.button.close': 'Kapat', + 'common.button.closeAll': 'Tümünü Kapat', + 'common.button.closeOthers': 'Diğerlerini Kapat', + 'common.label.tcp': 'TCP', + 'common.label.LocalFile': 'Yerel Dosya', + 'common.text.rename': 'Yeniden Adlandır', +}; diff --git a/chat2db-client/src/i18n/tr-tr/connection.ts b/chat2db-client/src/i18n/tr-tr/connection.ts new file mode 100644 index 000000000..54cc367f3 --- /dev/null +++ b/chat2db-client/src/i18n/tr-tr/connection.ts @@ -0,0 +1,37 @@ +export default { + 'connection.title': 'Bağlantılar', + 'connection.title.connections': 'Bağlantılar', + 'connection.title.createConnection': 'Yeni Bağlantı', + 'connection.title.editConnection': 'Bağlantıyı Düzenle', + 'connection.title.importConnection': 'Bağlantı İçe Aktar', + 'connection.label.name': 'ad', + 'connection.label.host': 'ana bilgisayar', + 'connection.label.authentication': 'doğrulama', + 'connection.label.database': 'veritabanı', + 'connection.label.JDBCDrive': 'JDBC Sürücüsü', + 'connection.label.port': 'port', + 'connection.button.testConnection': 'Test Et', + 'connection.label.advancedConfiguration': 'Gelişmiş Yapılandırma', + 'connection.label.sshConfiguration': 'SSH Yapılandırma', + 'connection.button.addConnection': 'Bağlantı Ekle', + 'connection.button.connect': 'Bağlan', + 'connection.button.remove': 'Kaldır', + 'connection.message.testConnectResult': 'Test bağlantısı {1}', + 'connection.message.testSshConnection': 'SSH bağlantısını test et', + 'connection.tableHeader.name': 'Adı', + 'connection.tableHeader.value': 'Değer', + 'connection.title.uploadDriver': 'Sürücü Yükle', + 'connection.tips.customUpload': "Sürücüyü yükle", + 'connection.title.driver': 'Sürücü', + 'connection.button.clickUpload': 'Yükleme için Tıklayın', + 'connection.text.downloadDriver': 'Sürücü İndir', + 'connection.text.downloadSuccess': 'İndirme Başarılı', + 'connection.text.tryAgainDownload': 'Yeniden İndir', + 'connection.text.downloading': 'İndiriliyor...', + 'connection.label.private': 'Özel', + 'connection.label.shared': 'Paylaşılan', + 'connection.button.createConnection': 'Bağlantı Oluştur', + 'connection.tips.noConnection': 'Henüz hiç bağlantı oluşturmadınız', + 'connection.tips.noConnectionTips': 'Bağlantı ayrıntılarını görüntüleme izniniz yok, ancak bağlantıya doğrudan bağlanabilirsiniz', + 'connection.title.importTitle': 'Dosya İçe Aktar,.ncx(navicat) veya.dbp(dbever)', +}; diff --git a/chat2db-client/src/i18n/tr-tr/dashboard.ts b/chat2db-client/src/i18n/tr-tr/dashboard.ts new file mode 100644 index 000000000..066adc33a --- /dev/null +++ b/chat2db-client/src/i18n/tr-tr/dashboard.ts @@ -0,0 +1,12 @@ +export default { + 'dashboard.title': 'Kontrol Paneli', + 'dashboard.edit': 'Düzenle', + 'dashboard.modal.editTitle': 'Kontrol Panelini Düzenle', + 'dashboard.modal.addTitle': 'Kontrol Paneli Ekle', + 'dashboard.modal.name.placeholder': "Lütfen kontrol paneli adını girin.", + 'dashboard.export2image': 'Resme Aktar', + 'dashboard.delete': 'Sil', + 'dashboard.editor.cascader.placeholder': 'Lütfen bir bağlantı havuzu seçin', + 'dashboard.editor.execute.noDataSource': 'Lütfen önce bir veri kaynağı seçin', + 'dashboard.editor.execute.success': 'Başarılı, Lütfen Grafik Yapılandırmasını Seçin', +}; diff --git a/chat2db-client/src/i18n/tr-tr/editTable.ts b/chat2db-client/src/i18n/tr-tr/editTable.ts new file mode 100644 index 000000000..597b0c0e5 --- /dev/null +++ b/chat2db-client/src/i18n/tr-tr/editTable.ts @@ -0,0 +1,38 @@ +export default { + 'editTable.tab.basicInfo': 'Temel Bilgi', + 'editTable.tab.columnInfo': 'Kolon', + 'editTable.tab.indexInfo': 'İndeks', + 'editTable.label.tableName': 'Tablo adı', + 'editTable.label.comment': 'Yorum', + 'editTable.button.add': 'Ekle', + 'editTable.button.delete': 'Sil', + 'editTable.button.up': 'Yukarı', + 'editTable.button.down': 'Aşağı', + 'editTable.label.indexName': 'Adı', + 'editTable.label.indexType': 'Türü', + 'editTable.label.indexMethod': 'İndeks yöntemi', + 'editTable.label.includeColumn': 'Kolonu içerir', + 'editTable.button.createTable': 'Tablo Oluştur', + 'editTable.button.importTable': 'Tabloyu İçe Aktar', + 'editTable.label.index': 'İndeks', + 'editTable.label.columnName': 'Adı', + 'editTable.label.columnSize': 'Boyutu', + 'editTable.label.columnType': 'Türü', + 'editTable.label.nullable': 'Boş bırakılabilir', + 'editTable.label.prefixLength': 'Önek uzunluğu', + 'editTable.label.defaultValue': 'Varsayılan değer', + 'editTable.label.sparse': 'Düzensiz', + 'editTable.label.characterSet': 'Karakter kümesi', + 'editTable.label.collation': 'Düzenleme', + 'editTable.label.decimalPoint': 'Ondalık nokta', + 'editTable.label.unit': 'Birim', + 'editTable.label.value': 'Değer', + 'editTable.label.autoIncrement': 'Otomatik artır', + 'editTable.label.engine': 'Motor', + 'editTable.label.incrementValue': 'Artış değeri', + 'editTable.label.order': 'Sıra', + 'editTable.label.primaryKey': 'Anahtar', + 'editTable.title.sqlPreview': 'SQL önizleme', + 'editTable.button.addColumn': 'Kolon Ekle', + 'editTable.button.addIndex': 'İndeks Ekle', +}; diff --git a/chat2db-client/src/i18n/tr-tr/editTableData.ts b/chat2db-client/src/i18n/tr-tr/editTableData.ts new file mode 100644 index 000000000..57d0c7d1b --- /dev/null +++ b/chat2db-client/src/i18n/tr-tr/editTableData.ts @@ -0,0 +1,7 @@ +export default { + 'editTableData.tips.addRow': 'Satır Ekle', + 'editTableData.tips.deleteRow': 'Satırı Sil', + 'editTableData.tips.revert': 'Geri Al', + 'editTableData.tips.previewPendingChanges': 'Bekleyen Değişiklikleri Önizle', + 'editTableData.tips.submit': 'Gönder', +}; diff --git a/chat2db-client/src/i18n/tr-tr/index.ts b/chat2db-client/src/i18n/tr-tr/index.ts new file mode 100644 index 000000000..21d0defb6 --- /dev/null +++ b/chat2db-client/src/i18n/tr-tr/index.ts @@ -0,0 +1,28 @@ +import common from './common'; +import connection from './connection'; +import menu from './menu'; +import setting from './setting'; +import workspace from './workspace'; +import dashboard from './dashboard'; +import chat from './chat'; +import team from './team' +import login from './login'; +import editTable from './editTable'; +import editTableData from './editTableData'; +import sqlEditor from './sqlEditor' + +export default { + lang: 'tr', + ...common, + ...setting, + ...connection, + ...workspace, + ...menu, + ...dashboard, + ...chat, + ...team, + ...login, + ...editTable, + ...editTableData, + ...sqlEditor +}; diff --git a/chat2db-client/src/i18n/tr-tr/login.ts b/chat2db-client/src/i18n/tr-tr/login.ts new file mode 100644 index 000000000..231757e0c --- /dev/null +++ b/chat2db-client/src/i18n/tr-tr/login.ts @@ -0,0 +1,13 @@ +export default { + 'login.text.logout': 'Çıkış Yap', + 'login.text.welcome': 'Chat2DB\'ye Hoş Geldiniz', + 'login.text.tips': 'Chat2DB hesabı yalnızca takım işbirliği yönetimi içindir.', + 'login.text.tips.title': 'Neden giriş yapmalı?', + 'login.text.setting': 'Ayarlar', + 'login.form.user': 'Kullanıcı Adı', + 'login.form.user.placeholder': 'Lütfen kullanıcı adınızı girin', + 'login.form.password': 'Şifre', + 'login.form.password.placeholder': 'Lütfen şifrenizi girin', + 'login.button.login': 'Giriş Yap', + 'login.tips.defaultPassword': 'Varsayılan kullanıcı adı ve şifre: chat2db', +}; diff --git a/chat2db-client/src/i18n/tr-tr/menu.ts b/chat2db-client/src/i18n/tr-tr/menu.ts new file mode 100644 index 000000000..ce7054491 --- /dev/null +++ b/chat2db-client/src/i18n/tr-tr/menu.ts @@ -0,0 +1,3 @@ +export default { + 'menu.file' : 'Dosya' +} diff --git a/chat2db-client/src/i18n/tr-tr/setting.ts b/chat2db-client/src/i18n/tr-tr/setting.ts new file mode 100644 index 000000000..80b1ddfe9 --- /dev/null +++ b/chat2db-client/src/i18n/tr-tr/setting.ts @@ -0,0 +1,59 @@ +export default { + 'setting.title.setting': 'Ayarlar', + 'setting.nav.basic': 'Temel', + 'setting.nav.customAi': 'Özel AI', + 'setting.nav.proxy': 'Hizmet Yolu', + 'setting.nav.aboutUs': 'Hakkımızda', + 'setting.title.backgroundColor': 'Arka Plan Rengi', + 'setting.title.themeColor': 'Tema Rengi', + 'setting.title.sqlEditorFontSize': 'SQL Düzenleyici Yazı Tipi Boyutu', + 'setting.label.blue': 'Mavi', + 'setting.label.green': 'Yeşil', + 'setting.label.violet': 'Menekşe', + 'setting.text.dark': 'Karanlık', + 'setting.text.dark2': 'Karanlık-2', + 'setting.text.light': 'Açık', + 'setting.text.followOS': 'İşletim Sistemini Takip Et', + 'setting.title.language': 'Dil', + 'setting.title.aiSource': 'AI Kaynağı', + 'setting.tab.custom': 'Özel', + 'setting.tab.aiType.zhipu': 'ZhiPu AI', + 'setting.tab.aiType.baichuan': 'BaiChuan AI', + 'setting.tab.aiType.wenxin': 'WenXin AI', + 'setting.tab.aiType.tongyiqianwen': 'TongYiQianWen AI', + 'setting.tab.aiType.custom.tips': "API formatı OpenAI API formatıyla uyumludur", + 'setting.label.serviceAddress': 'Hizmet Adresi', + 'setting.button.apply': 'Uygula', + 'setting.text.currentEnv': 'Geçerli Ortam', + 'setting.text.currentVersion': 'Geçerli Sürüm', + 'setting.text.viewingUpdateLogs': 'Güncelleme Günlüklerini Görüntüleme', + 'setting.label.isStreamOutput': 'Arayüzün çıktıyı akıtıp akıtmadığı', + 'setting.label.customAiUrl': 'Kullanıcı tanımlı arayüz URL\'si', + 'setting.placeholder.httpsProxy': 'Gerekli değil. OPENAI arayüzünü istemek için HTTP proxy {1} ayarlayın.', + 'setting.placeholder.apiKey': 'APIKEY\'i görüntülemek için OpenAI resmi web sitesine gidin', + 'setting.placeholder.chat2dbApiKey': 'Chat2DB tarafından sağlanan APIKEY\'i kullanın', + 'setting.placeholder.customUrl': 'AI REST arayüzünün URL\'si', + 'setting.placeholder.apiHost': 'Bu parametre zorunludur. Varsayılan değer https://api.openai.com/', + 'setting.message.urlTestError': 'Arayüz testi başarısız oldu. İşlem', + 'setting.placeholder.azureOpenAIKey': 'Azure Portal\'dan Azure OpenAI anahtar kimlik bilgilerini alın', + 'setting.placeholder.azureEndpoint': 'Azure Portal\'dan Azure OpenAI uç noktasını alın', + 'setting.placeholder.azureDeployment': 'Dağıtılan modelin dağıtım kimliği', + 'setting.ai.tips': 'Lütfen oturum açın ve AI yapılandırmasını seçin', + 'setting.ai.user.hidden': '"Ayarlar -> Özel AI" içinde ApiKey\'i ayarlamak için lütfen yönetici ile iletişime geçin', + 'setting.button.startDownloading': 'İndirmeye Başla', + 'setting.button.beDownloading': 'İndiriliyor', + 'setting.button.redownload': 'Yeniden İndir', + 'setting.button.restart': 'Yeniden Başlat', + 'setting.text.discoverNewVersion': 'Yeni sürümü keşfedin {1}', + 'setting.text.isLatestVersion': 'Bu en son sürüm', + 'setting.button.changeLog': 'Değişiklik Günlüğü', + 'setting.title.updateRule': 'Güncelleme Kuralı', + 'setting.text.autoUpdate': 'Yeni sürüm otomatik olarak indirilir ve yükler', + 'setting.text.manualUpdate': 'Yalnızca yeni bir sürüm yayınlandığında beni uyar', + 'setting.button.iSee': 'Görüyorum', + 'setting.text.newEditionIsReady': 'Yeni sürüm indirme tamamlandı, yazılımı yeniden başlatarak yeni sürümü kurabilirsiniz', + 'setting.button.goToUpdate': 'Güncellemeye Git', + 'setting.text.UpdatedLatestVersion': 'En son sürüme güncellendi {1}', + 'setting.title.holdingService': 'Hizmeti Tutma', + 'setting.text.holdingService': 'Uygulamadan çıkarken hizmeti tutarak başlangıcı hızlandırın', +}; diff --git a/chat2db-client/src/i18n/tr-tr/sqlEditor.ts b/chat2db-client/src/i18n/tr-tr/sqlEditor.ts new file mode 100644 index 000000000..f5c6fd8a1 --- /dev/null +++ b/chat2db-client/src/i18n/tr-tr/sqlEditor.ts @@ -0,0 +1,9 @@ +export default { + 'sqlEditor.text.keyword': 'Anahtar Kelime', + 'sqlEditor.text.function': 'Fonksiyon', + 'sqlEditor.text.tableName': 'Tablo Adı', + 'sqlEditor.text.databaseName': 'Veritabanı Adı', + 'sqlEditor.text.schemaName': 'Şema', + 'sqlEditor.text.viewName': 'Görünüm Adı', + 'sqlEditor.text.fieldName': 'Alan Adı', +}; diff --git a/chat2db-client/src/i18n/tr-tr/team.ts b/chat2db-client/src/i18n/tr-tr/team.ts new file mode 100644 index 000000000..d08e4d13c --- /dev/null +++ b/chat2db-client/src/i18n/tr-tr/team.ts @@ -0,0 +1,54 @@ +export default { + 'team.title': 'Takım Yönetimi', + 'team.tab.datasource': 'Veri Kaynağı Yönetimi', + 'team.tab.user': 'Kullanıcı Yönetimi', + 'team.tab.team': 'Takım Yönetimi', + + 'team.action.rightManagement': 'Yetki Yönetimi', + 'team.action.editDatasource': 'Veri Kaynağını Düzenle', + 'team.action.addDatasource': 'Veri Kaynağı Ekle', + 'team.action.addDatasource.placeholder': 'Veri Kaynağı Ara', + 'team.action.editUser': 'Kullanıcıyı Düzenle', + 'team.action.addUser': 'Kullanıcı Ekle', + 'team.action.addUser.placeholder': 'Kullanıcı Ara', + 'team.action.editTeam': 'Takımı Düzenle', + 'team.action.addTeam': 'Takım Ekle', + 'team.action.addTeam.placeholder': 'Takım Ara', + 'team.action.affiliation.user': 'Kullanıcıya Bağla', + 'team.action.affiliation.team': 'Takıma Bağla', + 'team.action.affiliation.datasource': 'Veri Kaynağına Bağla', + 'team.action.addUserAndTeam': 'Kullanıcı/Takım Ekle', + 'team.action.addUserAndTeam.placeholder': 'Kullanıcı/Takım Ara', + 'team.input.search.placeholder': 'Arama yapmak için anahtar kelimeleri girin', + + 'team.datasource.rightManagement': 'Yetki Yönetimi', + 'team.datasource.alias': 'Veri Kaynağı Adı', + 'team.datasource.url': 'Veri Kaynağı URL\'si', + 'team.datasource.code': 'Kod', + 'team.datasource.name': 'Ad', + 'team.datasource.status': 'Durum', + + 'team.user.name': 'Kullanıcı', + 'team.user.userName': 'Kullanıcı Adı', + 'team.user.nickName': 'Takma Ad', + 'team.user.status': 'Durum', + 'team.user.addForm.userName': 'Kullanıcı Adı', + 'team.user.addForm.nickName': 'Takma Ad', + 'team.user.addForm.email': 'E-posta', + 'team.user.addForm.password': 'Şifre', + 'team.user.addForm.roleCode': 'Rol', + 'team.user.addForm.roleCode.admin': 'Yönetici', + 'team.user.addForm.roleCode.user': 'Kullanıcı', + 'team.user.addForm.status': 'Durum', + 'team.user.addForm.status.valid': 'Geçerli', + 'team.user.addForm.status.invalid': 'Geçersiz', + + 'team.team.name': 'Takım', + 'team.team.addForm.code': 'Takım Kodu', + 'team.team.addForm.name': 'Takım Adı', + 'team.team.addForm.status': 'Durum', + 'team.team.addForm.status.valid': 'Geçerli', + 'team.team.addForm.status.invalid': 'Geçersiz', + 'team.team.addForm.description': 'Açıklama', + }; + \ No newline at end of file diff --git a/chat2db-client/src/i18n/tr-tr/workspace.ts b/chat2db-client/src/i18n/tr-tr/workspace.ts new file mode 100644 index 000000000..f06a7bf56 --- /dev/null +++ b/chat2db-client/src/i18n/tr-tr/workspace.ts @@ -0,0 +1,34 @@ +export default { + 'workspace.title': 'Çalışma Alanı', + 'workspace.cascader.placeholder': 'Buradan Seçin', + 'workspace.ai.input.placeholder': 'Düz metin ifadenizi buraya girin', + 'workspace.title.savedConsole': 'Kaydedilmiş konsol', + 'workspace.menu.ViewDDL': 'DDL Görüntüle', + 'workspace.menu.deleteTable': 'Tabloyu Sil', + 'workspace.menu.openTable': 'Tabloyu Aç', + 'workspace.menu.editTable': 'Tabloyu Düzenle', + 'workspace.menu.view': 'Görüntüle', + 'workspace.menu.pin': 'Sabitle', + 'workspace.menu.unPin': 'Sabitlemeyi Kaldır', + 'workspace.menu.editTableData': 'Tablo Verilerini Düzenle', + 'workspace.menu.queryConsole': 'Sorgu Konsolu', + 'workspace.menu.viewAllTable': 'Tüm Tabloları Görüntüle', + 'workspace.menu.createDatabase': 'Veritabanı Oluştur', + 'workspace.menu.createSchema': 'Şema Oluştur', + 'workspace.menu.deleteTablePlaceHolder': 'Silmek istediğiniz tablonun adını giriniz', + 'workspace.tips.affirmDeleteTable': 'Girdiğiniz tablo adı, silmek istediğiniz tablo adı ile aynı değil, lütfen tekrar doğrulayın', + 'workspace.table.total': 'Toplam', + 'workspace.table.total.tip': 'Toplam satır sayısını yükle', + 'workspace.table.export.all.csv': 'Sonuç kümesini CSV olarak dışa aktar', + 'workspace.table.export.cur.csv': 'Geçerli sayfa sonucunu CSV olarak dışa aktar', + 'workspace.table.export.all.insert': 'Sonuç kümesini INSERT SQL olarak dışa aktar', + 'workspace.table.export.cur.insert': 'Geçerli sayfa sonucunu INSERT SQL olarak dışa aktar', + 'workspace.tree.view': 'Görüntüle', + 'workspace.tree.trigger': 'Tetikleyici', + 'workspace.tree.function': 'Fonksiyon', + 'workspace.tree.procedure': 'Prosedür', + 'workspace.tree.search.placeholder': 'Genişletilmiş düğümde arama yapın', + 'workspace.tree.delete.tip': 'Bu işlemin kalıcı olarak silindiğini anlıyorum', + 'workspace.tree.delete.table.tip': '{1} tablosunu silmek istediğinizden emin misiniz?', + 'workspace.tips.noConnection': 'Henüz bir bağlantı oluşturmadınız', +}; From 8e9d290ee3fae5fdb082d542a8b5971e798a78be Mon Sep 17 00:00:00 2001 From: Samet UCA Date: Mon, 18 Dec 2023 19:38:08 +0300 Subject: [PATCH 14/37] Update index.tsx --- chat2db-client/src/blocks/Setting/BaseSetting/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chat2db-client/src/blocks/Setting/BaseSetting/index.tsx b/chat2db-client/src/blocks/Setting/BaseSetting/index.tsx index decc943a2..de4deda7e 100644 --- a/chat2db-client/src/blocks/Setting/BaseSetting/index.tsx +++ b/chat2db-client/src/blocks/Setting/BaseSetting/index.tsx @@ -145,7 +145,7 @@ export default function BaseSetting() { 简体中文 English - English + Turkish
{i18n('setting.title.themeColor')}
From 61812639cc364f2de964b940ac4cbe8fcf037263 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Tue, 19 Dec 2023 15:25:26 +0800 Subject: [PATCH 15/37] fix: SQLite supportDatabase --- .../src/main/java/ai/chat2db/plugin/sqlite/sqlite.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chat2db-server/chat2db-plugins/chat2db-sqlite/src/main/java/ai/chat2db/plugin/sqlite/sqlite.json b/chat2db-server/chat2db-plugins/chat2db-sqlite/src/main/java/ai/chat2db/plugin/sqlite/sqlite.json index a12e7bd5e..408af9170 100644 --- a/chat2db-server/chat2db-plugins/chat2db-sqlite/src/main/java/ai/chat2db/plugin/sqlite/sqlite.json +++ b/chat2db-server/chat2db-plugins/chat2db-sqlite/src/main/java/ai/chat2db/plugin/sqlite/sqlite.json @@ -1,6 +1,6 @@ { "dbType": "SQLITE", - "supportDatabase": false, + "supportDatabase": true, "supportSchema": false, "driverConfigList": [ { From e1ea4fdfcd2bde9495f313d8a1cbdfb13baec42c Mon Sep 17 00:00:00 2001 From: shanhexi Date: Tue, 19 Dec 2023 23:22:59 +0800 Subject: [PATCH 16/37] fix:tree some bug --- chat2db-client/src/blocks/Tree/index.tsx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/chat2db-client/src/blocks/Tree/index.tsx b/chat2db-client/src/blocks/Tree/index.tsx index 15ccbfb83..b35719a77 100644 --- a/chat2db-client/src/blocks/Tree/index.tsx +++ b/chat2db-client/src/blocks/Tree/index.tsx @@ -152,7 +152,7 @@ const Tree = (props: IProps) => { const treeNodes = useMemo(() => { const realNodeList = (searchSmoothTreeData || smoothTreeData).slice(startIdx, startIdx + 50); return realNodeList.map((item) => { - return ; + return ; }); }, [smoothTreeData, searchSmoothTreeData, startIdx]); @@ -166,7 +166,6 @@ const Tree = (props: IProps) => { } }, [searchValue]); - return ( { if(searchTreeData){ insertData(searchTreeData!, _treeNodeData.uuid!, res.data,[searchTreeData, setSearchTreeData]); } - // TODO: if (res.hasNextPage) { loadData({ refresh: _props?.refresh || false, @@ -277,14 +275,11 @@ const TreeNode = memo((props: TreeNodeIProps) => { data.map((item: any) => { item.parentNode = result; }); - // result.children = [...(result.children || []), ...(data || [])]; - result.children = [...(data || [])]; + result.children = [...(result.children || []), ...(data || [])]; } else { result.children = null; } - // result.expanded = !!data; - // 这里没写错 就是要改变treeData的引用 - setOriginalData?.([...(originalData || [])]); + setOriginalData?.(cloneDeep([...(originalData || [])])); break; } else { if (_treeData[i].children) { @@ -300,7 +295,7 @@ const TreeNode = memo((props: TreeNodeIProps) => { //展开-收起 const handleClick = () => { - if (treeNodeData?.children?.length) { + if (treeNodeData?.children) { insertData(treeData!, treeNodeData.uuid!, null,[treeData, setTreeData]); if(searchTreeData){ insertData(searchTreeData!, treeNodeData.uuid!, null,[searchTreeData, setSearchTreeData]); @@ -359,7 +354,6 @@ const TreeNode = memo((props: TreeNodeIProps) => { label: , }; }); - return ( { ); - }, [isFocus, isLoading, rightClickMenu, searchTreeData]); + }, [isFocus, isLoading, rightClickMenu, treeNodeData.children]); return treeNodeDom; }); From 6ef7236fd0b73bfb517a95818e0ff36bb15153a2 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Wed, 20 Dec 2023 22:59:48 +0800 Subject: [PATCH 17/37] fix: Some database configuration files --- .../main/java/ai/chat2db/plugin/clickhouse/clickhouse.json | 2 +- .../src/main/java/ai/chat2db/plugin/hive/hive.json | 2 +- .../src/main/java/ai/chat2db/plugin/oceanbase/oceanbase.json | 2 +- .../src/main/java/ai/chat2db/plugin/presto/presto.json | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/chat2db-server/chat2db-plugins/chat2db-clickhouse/src/main/java/ai/chat2db/plugin/clickhouse/clickhouse.json b/chat2db-server/chat2db-plugins/chat2db-clickhouse/src/main/java/ai/chat2db/plugin/clickhouse/clickhouse.json index 936c2c001..9d30aabb1 100644 --- a/chat2db-server/chat2db-plugins/chat2db-clickhouse/src/main/java/ai/chat2db/plugin/clickhouse/clickhouse.json +++ b/chat2db-server/chat2db-plugins/chat2db-clickhouse/src/main/java/ai/chat2db/plugin/clickhouse/clickhouse.json @@ -1,6 +1,6 @@ { "dbType": "CLICKHOUSE", - "supportDatabase": false, + "supportDatabase": true, "supportSchema": false, "driverConfigList": [ { diff --git a/chat2db-server/chat2db-plugins/chat2db-hive/src/main/java/ai/chat2db/plugin/hive/hive.json b/chat2db-server/chat2db-plugins/chat2db-hive/src/main/java/ai/chat2db/plugin/hive/hive.json index 119cf9a71..967bdd80c 100644 --- a/chat2db-server/chat2db-plugins/chat2db-hive/src/main/java/ai/chat2db/plugin/hive/hive.json +++ b/chat2db-server/chat2db-plugins/chat2db-hive/src/main/java/ai/chat2db/plugin/hive/hive.json @@ -1,6 +1,6 @@ { "dbType": "HIVE", - "supportDatabase": false, + "supportDatabase": true, "supportSchema": false, "driverConfigList": [ { diff --git a/chat2db-server/chat2db-plugins/chat2db-oceanbase/src/main/java/ai/chat2db/plugin/oceanbase/oceanbase.json b/chat2db-server/chat2db-plugins/chat2db-oceanbase/src/main/java/ai/chat2db/plugin/oceanbase/oceanbase.json index c3e2cff36..103102d6f 100644 --- a/chat2db-server/chat2db-plugins/chat2db-oceanbase/src/main/java/ai/chat2db/plugin/oceanbase/oceanbase.json +++ b/chat2db-server/chat2db-plugins/chat2db-oceanbase/src/main/java/ai/chat2db/plugin/oceanbase/oceanbase.json @@ -1,6 +1,6 @@ { "dbType": "OCEANBASE", - "supportDatabase": false, + "supportDatabase": true, "supportSchema": false, "driverConfigList": [ { diff --git a/chat2db-server/chat2db-plugins/chat2db-presto/src/main/java/ai/chat2db/plugin/presto/presto.json b/chat2db-server/chat2db-plugins/chat2db-presto/src/main/java/ai/chat2db/plugin/presto/presto.json index b382dbf45..df469d82f 100644 --- a/chat2db-server/chat2db-plugins/chat2db-presto/src/main/java/ai/chat2db/plugin/presto/presto.json +++ b/chat2db-server/chat2db-plugins/chat2db-presto/src/main/java/ai/chat2db/plugin/presto/presto.json @@ -1,7 +1,7 @@ { "dbType": "PRESTO", - "supportDatabase": false, - "supportSchema": false, + "supportDatabase": true, + "supportSchema": true, "driverConfigList": [ { "url": "jdbc:presto://localhost:8080/", From da1b43e1a02034ca4eb6307f6a74ae5cb614a8cc Mon Sep 17 00:00:00 2001 From: shanhexi Date: Wed, 20 Dec 2023 23:02:27 +0800 Subject: [PATCH 18/37] changelog --- CHANGELOG.md | 3 ++- CHANGELOG_CN.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index afc1bdd02..b907d172b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,12 @@ ## 3.1.15 -`2023-12-18` +`2023-12-20` **Changelog** - 🐞【Fixed】Every time I open the application, I occasionally cannot select the database problem - 🐞【Fixed】Compatible with old data types can not show deletion problems +- 🐞【Fixed】Some databases cannot display the database /Schema structure ## 3.1.14 diff --git a/CHANGELOG_CN.md b/CHANGELOG_CN.md index 63bd23940..f2f2f12c5 100644 --- a/CHANGELOG_CN.md +++ b/CHANGELOG_CN.md @@ -1,11 +1,12 @@ ## 3.1.15 -`2023-12-18` +`2023-12-20` **更新日志** - 🐞【修复】每次打开应用时,偶现无法选择数据库问题 - 🐞【修复】兼容老数据类型无法显示删除问题 +- 🐞【修复】部分数据库无法显示数据库/Schema结构的问题 ## 3.1.14 From 4d629d7d791c3ecaf7df48de56963945316c4d51 Mon Sep 17 00:00:00 2001 From: Jerry Fan Date: Thu, 21 Dec 2023 10:09:30 +0800 Subject: [PATCH 19/37] fix: change the docker builder github action file --- .github/workflows/pushdocker.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pushdocker.yml b/.github/workflows/pushdocker.yml index dea932014..edac3b8cd 100644 --- a/.github/workflows/pushdocker.yml +++ b/.github/workflows/pushdocker.yml @@ -49,6 +49,8 @@ jobs: cd chat2db-client yarn install yarn run build:web:prod --app_version=${{ steps.chat2db_version.outputs.substring }} + mkdir -p ../chat2db-server/chat2db-server-web-start/src/main/resources/static/ + mkdir -p ../chat2db-server/chat2db-server-web-start/src/main/resources/thymeleaf/ cp -r dist ../chat2db-server/chat2db-server-start/src/main/resources/static/front cp -r dist/index.html ../chat2db-server/chat2db-server-start/src/main/resources/thymeleaf/ From a29d1b46c0b303e928a52ee632e2c5ea59c7d48f Mon Sep 17 00:00:00 2001 From: shanhexi Date: Thu, 21 Dec 2023 12:46:38 +0800 Subject: [PATCH 20/37] CLICKHOUSE supportSchema --- .../ai/chat2db/plugin/clickhouse/clickhouse.json | 4 ++-- .../src/main/resources/static/icon/h2.png | Bin 0 -> 1492 bytes .../src/main/resources/static/icon/mysql.png | Bin 0 -> 1979 bytes .../src/main/resources/static/icon/oceanbase.png | Bin 0 -> 1266 bytes .../src/main/resources/static/icon/oracle.png | Bin 0 -> 878 bytes .../main/resources/static/icon/postgresql.png | Bin 0 -> 3257 bytes .../src/main/resources/static/icon/sqlite.png | Bin 0 -> 1671 bytes .../src/main/resources/static/icon/sqlserver.png | Bin 0 -> 2762 bytes 8 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 chat2db-server/chat2db-server-web-start/src/main/resources/static/icon/h2.png create mode 100644 chat2db-server/chat2db-server-web-start/src/main/resources/static/icon/mysql.png create mode 100644 chat2db-server/chat2db-server-web-start/src/main/resources/static/icon/oceanbase.png create mode 100644 chat2db-server/chat2db-server-web-start/src/main/resources/static/icon/oracle.png create mode 100644 chat2db-server/chat2db-server-web-start/src/main/resources/static/icon/postgresql.png create mode 100644 chat2db-server/chat2db-server-web-start/src/main/resources/static/icon/sqlite.png create mode 100644 chat2db-server/chat2db-server-web-start/src/main/resources/static/icon/sqlserver.png diff --git a/chat2db-server/chat2db-plugins/chat2db-clickhouse/src/main/java/ai/chat2db/plugin/clickhouse/clickhouse.json b/chat2db-server/chat2db-plugins/chat2db-clickhouse/src/main/java/ai/chat2db/plugin/clickhouse/clickhouse.json index 9d30aabb1..c99541f5f 100644 --- a/chat2db-server/chat2db-plugins/chat2db-clickhouse/src/main/java/ai/chat2db/plugin/clickhouse/clickhouse.json +++ b/chat2db-server/chat2db-plugins/chat2db-clickhouse/src/main/java/ai/chat2db/plugin/clickhouse/clickhouse.json @@ -1,7 +1,7 @@ { "dbType": "CLICKHOUSE", - "supportDatabase": true, - "supportSchema": false, + "supportDatabase": false, + "supportSchema": true, "driverConfigList": [ { "url": "jdbc:clickhouse://localhost:8123/", diff --git a/chat2db-server/chat2db-server-web-start/src/main/resources/static/icon/h2.png b/chat2db-server/chat2db-server-web-start/src/main/resources/static/icon/h2.png new file mode 100644 index 0000000000000000000000000000000000000000..218f5646f5e9e231953a69b4ebf0b63c1617b721 GIT binary patch literal 1492 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 literal 0 HcmV?d00001 diff --git a/chat2db-server/chat2db-server-web-start/src/main/resources/static/icon/oceanbase.png b/chat2db-server/chat2db-server-web-start/src/main/resources/static/icon/oceanbase.png new file mode 100644 index 0000000000000000000000000000000000000000..c90e027d20b82c9f425b6f033bb0529d54bbb9de GIT binary patch literal 1266 zcmV+lbYol^bIJ9bKm!&U|8vOpk^O_Y zgME2SPCU-*0{W?`O(APESqU>_LEYNMeg1FunP83-lRF{Af!b`cOPU}Ahu9Rn5!jc< z@K^?OWt$o?kPd2>kxlA>{~09n0gq)426HYmwM=ofK5(8~#HV$8Gay{dEi>Wd1ayYN zS#z28n<*|3PS%i|SYS@QB%DlH3_>)awykY`3nSc(TGLqyIHks5+8AmUOa$o*QFPJf z^xMibOn$dSIRLI%24}7d&EaBv0`UF;3|;}o#>4lc{o+9aLRe#;i1Q97n~WQ(ImO)` zp!QQBvj(tUB`YDT0Jb&(=Px@$e){=WR8`laZr6LtcGd63&YksWXlR1Rb5Z%|AVh;T z(>Va%IvMT;BI5s2+SGkXVow{wo5(g(FmF&>O7@72D}JE$vnKHKB(k9)ufy#uhiDaX z0B!n0O^wXdEcw0uF$p{i-1{cAF9W3wls#VqRn2r=tb-^AhDSr#{&o!sr6MCMAB`V2 zqot)4t5&Z?e!;^kfUd3+idP39%h1LF@FBubQAxghbBxHJ1afPE)GDCoVq|unIZypX zAv{$N_yd1qZDAn^-HPQa9>mntl=3-pKdV9~Qdr>pc%>nR9ruyXRIoYgA{e<-7 zeFNHqos5du-fE+^g$PE5U7?cFas-1xOioT>$2)cE-ufq=SJ#ZFJQ(2s_&8M%@>3M7 zwUO*KU|UPL&s-kH-VPg|cL1IX-AX7UYb6R+6{4cD2J0T(pzhsrXD+ZY zh$V27Py*=sg~*=)3f`jj72sr#_R!#*SW**$Mak(41hJ*8Sc$B;e_g~Awzq%p&cuO( zht$1zN$8egL=sYYEu=)ehf9!xsHD`62hhrfKlH#^78VP$i^3n(ceFS z{(%8>b{@rj%O6lx!F_#w7Zi8AGAz;;5oM^#Y=a}Fs)08m$_cK2tBmX+8;7V=y+i#< zAnWdxu+o-B)(A}OSm}@u@S{=#WE9~K~6Lh+X`pbqaZRUnCd;i>2pq`$B&;- zB8zU%q4o~4Y*;Bvk-4M*kFS3YhYz=7X2#KryA?AK=P)vpl@A_1fQINGy7s5*p?)VO z{=(I(qwxFv@cG1i2m}I{o({iOBs`3C0CA7w*s=}7tcdG@*W3^{`JLk!H+UgoZ$6w@ zP+62HlgpVOZBaGPhOY%>+p1$Eg5w|2*d> cp7-bZ|J0;8v>k*7+5i9m07*qoM6N<$f*E96mjD0& literal 0 HcmV?d00001 diff --git a/chat2db-server/chat2db-server-web-start/src/main/resources/static/icon/oracle.png b/chat2db-server/chat2db-server-web-start/src/main/resources/static/icon/oracle.png new file mode 100644 index 0000000000000000000000000000000000000000..b9d234826988cf7bde5c2eba2ea30d749f1b167b GIT binary patch literal 878 zcmV-!1CjiRP)~QBcq@ie_aIy`aLZklusJs0L|P zgCgHXYFeNuSm@VUd+qCaA5@|y_rS-#cb&by_3gFS+WQ0$D8v6mz;5{0$Oy;?SfGHQ zjH@C*VH8;H2bz;rZun%`xvcOOpd7ts^rJ8_zt0(S2cTbvzv4_#W%0^$j$q#ZfX_c7t>=@p(*&VWOJ&cK?eOyWvbPCbSb z&taiz^g+6d)Jn;>LobGFD7l4fD}lTU72GMHFk%((rCSTA(!m!hAY=%5+aX-zB%o$1 z*_HwM4guOJqC24Ly*N!y0^4_qO?AgYwt&)GoB)b+Hit)qtFK@Fmn3AKTC}|g)jrdt zOP9ropNEgcR#5{~HOL%4aG_S~1L(>%gQxAj*j$S+jp8_sxj?9z_DmPg+?-T1J1+*! z7lB{Dg=2ae*t1{kyq%_)&Vwl335SkQAI}*p82U=*!Bc6c*1IxVpluH*W4(QbA3vwh z3TK?#oVUqKfJ#eHPb7!KN98zO>cee(>Wpxyg@r7^odT2yU65%JDXQEXw}4Ndfsqku zC*B?}jE(}`)V}xHfSr4VgRgSi%Dn~5BYiOC2nnNz&VwWsSd0oS&IM^gtU+$SvRY%l zN;?;wdvJdNDic%_D=OvVqKuE%e1q5%+0<%r=>&DR@HM>H50ZHi>EA*5GU6`b%cR5u z{B9lfdBFzpG4;C_`~^5*KXklc_w&Xg1^j(v1Y`vK0S(-9eGRG~!2kdN07*qoM6N<$ Ef?>{=C;$Ke literal 0 HcmV?d00001 diff --git a/chat2db-server/chat2db-server-web-start/src/main/resources/static/icon/postgresql.png b/chat2db-server/chat2db-server-web-start/src/main/resources/static/icon/postgresql.png new file mode 100644 index 0000000000000000000000000000000000000000..4acdba1c6b686bc7289e2aa679a6afbad13d4ba8 GIT binary patch literal 3257 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 RgPs5Y002ovPDHLkV1kAcA&39~ literal 0 HcmV?d00001 diff --git a/chat2db-server/chat2db-server-web-start/src/main/resources/static/icon/sqlserver.png b/chat2db-server/chat2db-server-web-start/src/main/resources/static/icon/sqlserver.png new file mode 100644 index 0000000000000000000000000000000000000000..e0d94aea8f6c871572faca49f98d51c9fdfd8356 GIT binary patch literal 2762 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 literal 0 HcmV?d00001 From dce350178b1e54f5e7686d87aa476d2ad422fbf6 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Thu, 21 Dec 2023 13:19:08 +0800 Subject: [PATCH 21/37] fix:docker error --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index ed842de78..bf14bcb53 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -5,7 +5,7 @@ WORKDIR /app # 将当前目录下的jar包复制到docker容器的/app 目录下 ADD chat2db-server/chat2db-server-web-start/target/chat2db-server-web-start.jar chat2db-server-web-start.jar # 将当前目录下的lib包复制到docker容器的/app/lib 目录下 -ADD chat2db-server/chat2db-server-web-start/target/lib lib +# ADD chat2db-server/chat2db-server-web-start/target/lib lib # 让当前容器暴露10824 EXPOSE 10824 # 运行jar包 From 761b8c06d42292c3429133bf04aa2b7040905f69 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Thu, 21 Dec 2023 13:41:26 +0800 Subject: [PATCH 22/37] =?UTF-8?q?fix:=20console=20=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E8=80=81=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/main/workspace/components/WorkspaceTabs/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.tsx b/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.tsx index 8ac4b7258..51519a6bf 100644 --- a/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.tsx +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.tsx @@ -102,8 +102,8 @@ const WorkspaceTabs = memo(() => { ); data.forEach((item) => { const editData = workspaceTabList?.find((t) => t.id === item.key); - // table 为了兼容老数据 - if (editData?.type === WorkspaceTabType.CONSOLE || editData?.type === 'table' as any) { + // table 和 !editData?.type 为了兼容老数据 + if (editData?.type === WorkspaceTabType.CONSOLE || editData?.type === 'table' as any || !editData?.type) { closeWindowTab(item.key as number); } }); @@ -214,6 +214,7 @@ const WorkspaceTabs = memo(() => { const workspaceTabConnectionMap = (item: IWorkspaceTab) => { switch (item.type) { case 'table' as any: // 为了兼容老数据 + case null as any: // 为了兼容老数据 case WorkspaceTabType.CONSOLE: case WorkspaceTabType.FUNCTION: case WorkspaceTabType.PROCEDURE: From 44bf16d576f2d43ec8c104353695d395fb4dfe6f Mon Sep 17 00:00:00 2001 From: shanhexi Date: Thu, 21 Dec 2023 13:50:06 +0800 Subject: [PATCH 23/37] fix:docker jar name --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index bf14bcb53..ff6fcddef 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -9,4 +9,4 @@ ADD chat2db-server/chat2db-server-web-start/target/chat2db-server-web-start.jar # 让当前容器暴露10824 EXPOSE 10824 # 运行jar包 -ENTRYPOINT ["java","-Dloader.path=lib","-Dspring.profiles.active=release","-jar","chat2db-server-start.jar"] +ENTRYPOINT ["java","-Dloader.path=lib","-Dspring.profiles.active=release","-jar","chat2db-server-web-start.jar"] From 6fcd19cd793a6b5622a1d7c16f627a21206a1a1f Mon Sep 17 00:00:00 2001 From: shanhexi Date: Thu, 21 Dec 2023 15:38:05 +0800 Subject: [PATCH 24/37] fix: Edit data bug --- .../blocks/Tree/TreeNodeRightClick/index.less | 9 - .../blocks/Tree/TreeNodeRightClick/index.tsx | 336 ------------------ .../src/components/MonacoEditor/index.tsx | 2 +- .../components/TableBox/index.tsx | 11 +- chat2db-client/src/i18n/en-us/workspace.ts | 1 + chat2db-client/src/i18n/zh-cn/workspace.ts | 2 +- .../src/pages/main/workspace/store/console.ts | 5 +- 7 files changed, 12 insertions(+), 354 deletions(-) delete mode 100644 chat2db-client/src/blocks/Tree/TreeNodeRightClick/index.less delete mode 100644 chat2db-client/src/blocks/Tree/TreeNodeRightClick/index.tsx diff --git a/chat2db-client/src/blocks/Tree/TreeNodeRightClick/index.less b/chat2db-client/src/blocks/Tree/TreeNodeRightClick/index.less deleted file mode 100644 index aa09fc090..000000000 --- a/chat2db-client/src/blocks/Tree/TreeNodeRightClick/index.less +++ /dev/null @@ -1,9 +0,0 @@ -@import '../../../styles/var.less'; - -.monacoEditorBox { - margin-top: -15px; - height: 60vh; - border: 1px solid var(--color-border); - border-radius: 4px; - overflow: hidden; -} diff --git a/chat2db-client/src/blocks/Tree/TreeNodeRightClick/index.tsx b/chat2db-client/src/blocks/Tree/TreeNodeRightClick/index.tsx deleted file mode 100644 index 0131b154d..000000000 --- a/chat2db-client/src/blocks/Tree/TreeNodeRightClick/index.tsx +++ /dev/null @@ -1,336 +0,0 @@ -import React, { memo, useMemo, useRef, useState } from 'react'; -import { message, Modal, Input, Dropdown, notification } from 'antd'; -// import classnames from 'classnames'; -import i18n from '@/i18n'; -import styles from './index.less'; - -// ----- components ----- -import { dataSourceFormConfigs } from '@/components/ConnectionEdit/config/dataSource'; -import { IConnectionConfig } from '@/components/ConnectionEdit/config/types'; -import MonacoEditor, { IExportRefFunction } from '@/components/MonacoEditor'; -import MenuLabel from '@/components/MenuLabel'; - -// ----- constants ----- -import { TreeNodeType, OperationColumn } from '@/constants'; -import { ITreeNode } from '@/typings'; - -// ----- service ----- -import connectionServer from '@/service/connection'; -// import mysqlServer from '@/service/sql'; - -// ----- config ----- -import { ITreeConfigItem, treeConfig } from '../treeConfig'; - -export type IProps = { - className?: string; - // setIsLoading: (value: boolean) => void; - data: ITreeNode; - children?: React.ReactNode; -}; - -export interface IOperationColumnConfigItem { - text: string; - icon: string; - handle: () => void; -} - -function TreeNodeRightClick(props: IProps) { - const { data } = props; - const [verifyDialog, setVerifyDialog] = useState(); - const [verifyTableName, setVerifyTableName] = useState(''); - const [, modelDom] = Modal.useModal(); - const [, notificationDom] = notification.useNotification(); - // 拿出当前节点的配置 - const treeNodeConfig: ITreeConfigItem = treeConfig[data.treeNodeType]; - const { getChildren, operationColumn } = treeNodeConfig; - - const [monacoVerifyDialog, setMonacoVerifyDialog] = useState(false); - - const dataSourceFormConfig = dataSourceFormConfigs.find((t: IConnectionConfig) => { - return t.type === data.extraParams?.databaseType; - })!; - const monacoEditorRef = useRef(null); - - const operationColumnConfig: { [key in OperationColumn]: (data: ITreeNode) => IOperationColumnConfigItem } = { - // 刷新 - [OperationColumn.Refresh]: () => { - return { - text: i18n('common.button.refresh'), - icon: '\uec08', - handle: () => { - refresh(); - }, - }; - }, - [OperationColumn.EditTableData]: () => { - return { - text: i18n('workspace.menu.editTableData'), - icon: '\ue7b5', - handle: () => { - openEditTableData(); - }, - }; - }, - [OperationColumn.ViewDDL]: () => { - return { - text: i18n('workspace.menu.ViewDDL'), - icon: '\ue665', - handle: () => { - // mysqlServer - // .exportCreateTableSql({ - // ...curWorkspaceParams, - // tableName: data.key, - // } as any) - // .then((res) => { - // setMonacoVerifyDialog(true); - // setTimeout(() => { - // monacoEditorRef.current?.setValue(res, 'cover'); - // }, 0); - // }); - }, - }; - }, - [OperationColumn.ShiftOut]: (_data) => { - return { - text: '移出', - icon: '\ue62a', - handle: () => { - connectionServer.remove({ id: +_data.key }).then(() => { - treeConfig[TreeNodeType.DATA_SOURCES]?.getChildren!({} as any).then(() => { - // setTreeData(res); - }); - }); - }, - }; - }, - [OperationColumn.CreateTable]: () => { - return { - text: '新建表', - icon: '\ue6b6', - handle: () => { - // const operationData = { - // type: 'new', - // nodeData: _data, - // }; - // setOperationDataDialog(operationData) - }, - }; - }, - [OperationColumn.CreateConsole]: () => { - return { - text: '新建查询', - icon: '\ue619', - handle: () => {}, - }; - }, - [OperationColumn.DeleteTable]: () => { - return { - text: i18n('workspace.menu.deleteTable'), - icon: '\ue6a7', - handle: () => { - setVerifyDialog(true); - }, - }; - }, - [OperationColumn.EditTable]: () => { - return { - text: i18n('workspace.menu.editTable'), - icon: '\ue602', - handle: () => { - // dispatch({ - // type: 'workspace/setCreateTabIntro', - // payload: { - // type: CreateTabIntroType.EditorTable, - // workspaceTabType: WorkspaceTabType.EditTable, - // treeNodeData: { - // ...data, - // name: data.key, - // }, - // }, - // }); - }, - }; - }, - [OperationColumn.EditSource]: () => { - return { - text: '编辑数据源', - icon: '\ue623', - handle: () => { - // setEditDataSourceData({ - // dataType: data.dataType as any, - // id: +data.key - // }) - }, - }; - }, - [OperationColumn.Top]: (_data) => { - return { - text: _data.pinned ? i18n('workspace.menu.unPin') : i18n('workspace.menu.pin'), - icon: _data.pinned ? '\ue61d' : '\ue627', - handle: handleTop, - }; - }, - [OperationColumn.CopyName]: (_data) => { - return { - text: i18n('common.button.copy'), - icon: '\uec7a', - handle: () => { - navigator.clipboard.writeText(_data.key.toString()); - }, - }; - }, - }; - - function handleTop() { - // const api = data.pinned ? 'deleteTablePin' : 'addTablePin'; - // mysqlServer[api]({ - // ...curWorkspaceParams, - // tableName: data.key, - // } as any).then(() => { - // dispatch({ - // type: 'workspace/fetchGetCurTableList', - // payload: { - // ...curWorkspaceParams, - // extraParams: curWorkspaceParams, - // refresh: true, - // }, - // callback: () => { - // message.success(i18n('common.text.submittedSuccessfully')); - // }, - // }); - // }); - } - - function refresh() { - // setIsLoading(true); - const params = { - ...data.extraParams, - extraParams:{ - ...data.extraParams - }, - refresh: true, - } - getChildren?.(params).then((res) => { - data.children = res as any; - }) - .finally(() => { - // setIsLoading(false); - }) - } - - function openEditTableData() { - // const payload = { - // type: CreateTabIntroType.EditTableData, - // workspaceTabType: WorkspaceTabType.EditTableData, - // treeNodeData: { - // ...data, - // name: data.key, - // }, - // }; - // dispatch({ - // type: 'workspace/setCreateTabIntro', - // payload, - // }); - } - - function handleOk() { - if (verifyTableName === data.key) { - // const p: any = { - // ...data.extraParams, - // tableName: data.key, - // }; - // mysqlServer.deleteTable(p).then(() => { - // message.success(i18n('common.text.successfullyDelete')); - // dispatch({ - // type: 'workspace/fetchGetCurTableList', - // payload: { - // ...curWorkspaceParams, - // extraParams: curWorkspaceParams, - // }, - // callback: () => { - // setVerifyDialog(false); - // setVerifyTableName(''); - // }, - // }); - // }); - } else { - message.error(i18n('workspace.tips.affirmDeleteTable')); - } - } - - // 有些数据库不支持的操作,需要排除掉 - function excludeSomeOperation() { - const excludes = dataSourceFormConfig.baseInfo.excludes; - const newOperationColumn: OperationColumn[] = []; - operationColumn?.map((item: OperationColumn) => { - let flag = false; - excludes?.map((t) => { - if (item === t) { - flag = true; - } - }); - if (!flag) { - newOperationColumn.push(item); - } - }); - return newOperationColumn; - } - - const dropdowns = useMemo(() => { - if (dataSourceFormConfig) { - return excludeSomeOperation().map((t, i) => { - const concrete = operationColumnConfig[t](data); - return { - key: i, - label: , - onClick: concrete.handle, - }; - }); - } - return []; - }, [dataSourceFormConfig]); - - return ( - <> - {modelDom} - {notificationDom} - { - setVerifyDialog(false); - }} - > - { - setVerifyTableName(e.target.value); - }} - /> - - {/* 这里后续肯定是要提出去的 */} - {monacoVerifyDialog && ( - { - setMonacoVerifyDialog(false); - }} - footer={false} - > -
- -
-
- )} - - ); -} - -export default memo(TreeNodeRightClick); diff --git a/chat2db-client/src/components/MonacoEditor/index.tsx b/chat2db-client/src/components/MonacoEditor/index.tsx index ef37401d0..830d89b5b 100644 --- a/chat2db-client/src/components/MonacoEditor/index.tsx +++ b/chat2db-client/src/components/MonacoEditor/index.tsx @@ -231,7 +231,7 @@ export const appendMonacoValue = (editor: any, text: any, range: IRangeType = 'e // 创建编辑操作,将当前文档内容替换为新内容 let newRange: IRangeType = range; if (range === 'reset') { - editor.setValue(text); + editor.setValue(text || ''); return; } let newText = text; diff --git a/chat2db-client/src/components/SearchResult/components/TableBox/index.tsx b/chat2db-client/src/components/SearchResult/components/TableBox/index.tsx index 5f16fbc68..6902b1c05 100644 --- a/chat2db-client/src/components/SearchResult/components/TableBox/index.tsx +++ b/chat2db-client/src/components/SearchResult/components/TableBox/index.tsx @@ -245,11 +245,10 @@ export default function TableBox(props: ITableProps) { function monacoEditorEditData() { const editorData = monacoEditorRef?.current?.getAllContent(); - // 获取原始的该单元格的数据 - // let _oldData = ''; const { rowId, colId } = viewTableCellData!; - oldDataList.forEach((item) => { - if (item[0] === rowId) { + console.log('oldTableData', oldTableData); + oldTableData.forEach((item) => { + if (item[colNoCode] === rowId) { if (item[colId] !== editorData) { const newTableData = lodash.cloneDeep(tableData); let newRowDataList: any = []; @@ -260,13 +259,12 @@ export default function TableBox(props: ITableProps) { } }); setTableData(newTableData); - // 添加更新记录 setUpdateData([ ...updateData, { type: CRUD.UPDATE, - oldDataList: item, + oldDataList: Object.keys(item).map((_i) => item[_i]), dataList: newRowDataList, rowId, }, @@ -1085,6 +1083,7 @@ export default function TableBox(props: ITableProps) { text: transformInputValue(viewTableCellData?.value), range: 'reset', }} + language="plaintext" options={{ lineNumbers: 'off', readOnly: !queryResultData.canEdit, diff --git a/chat2db-client/src/i18n/en-us/workspace.ts b/chat2db-client/src/i18n/en-us/workspace.ts index d48293565..fbb512689 100644 --- a/chat2db-client/src/i18n/en-us/workspace.ts +++ b/chat2db-client/src/i18n/en-us/workspace.ts @@ -32,4 +32,5 @@ export default { 'workspace.tree.delete.tip': 'I understand that this operation is permanently deleted', 'workspace.tree.delete.table.tip': 'Are you sure you want to delete the table {1}?', 'workspace.tips.noConnection': 'You have not created a connection yet', + 'workspace.tips.maxConsole': 'You can only open up to 20 consoles', }; diff --git a/chat2db-client/src/i18n/zh-cn/workspace.ts b/chat2db-client/src/i18n/zh-cn/workspace.ts index e57d40d5e..1022ff1d5 100644 --- a/chat2db-client/src/i18n/zh-cn/workspace.ts +++ b/chat2db-client/src/i18n/zh-cn/workspace.ts @@ -31,5 +31,5 @@ export default { 'workspace.tree.delete.tip': '我了解该操作是永久性删除', 'workspace.tree.delete.table.tip': '确定要删除表{1}吗?', 'workspace.tips.noConnection': '你还没有创建连接', - + 'workspace.tips.maxConsole': '最多只能打开20个控制台', }; diff --git a/chat2db-client/src/pages/main/workspace/store/console.ts b/chat2db-client/src/pages/main/workspace/store/console.ts index 0316f7c6b..82fc4b0ec 100644 --- a/chat2db-client/src/pages/main/workspace/store/console.ts +++ b/chat2db-client/src/pages/main/workspace/store/console.ts @@ -3,6 +3,8 @@ import { IConsole, ICreateConsoleParams } from '@/typings'; import { IWorkspaceTab } from '@/typings/workspace'; import historyService from '@/service/history'; import { ConsoleStatus, WorkspaceTabType } from '@/constants'; +import { message } from 'antd'; +import i18n from '@/i18n'; export interface IConsoleStore { consoleList: IConsole[] | null; @@ -67,7 +69,8 @@ export const createConsole = (params: ICreateConsoleParams) => { }; return new Promise((resolve) => { - if ((workspaceTabList?.length || 0) > 20) { + if ((workspaceTabList?.length || 0) >= 20) { + message.warning(i18n('workspace.tips.maxConsole')); return; } useWorkspaceStore.setState({ createConsoleLoading: true }); From 1124eff036f7887d5f0a055160cfb91829baec9b Mon Sep 17 00:00:00 2001 From: shanhexi Date: Fri, 22 Dec 2023 15:05:38 +0800 Subject: [PATCH 25/37] code position --- chat2db-client/src/components/ConsoleEditor/index.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/chat2db-client/src/components/ConsoleEditor/index.tsx b/chat2db-client/src/components/ConsoleEditor/index.tsx index 639043a1d..237e4ef9a 100644 --- a/chat2db-client/src/components/ConsoleEditor/index.tsx +++ b/chat2db-client/src/components/ConsoleEditor/index.tsx @@ -94,6 +94,8 @@ function ConsoleEditor(props: IProps, ref: ForwardedRef) { const uid = useMemo(() => uuidv4(), []); const chatResult = useRef(''); const editorRef = useRef(); + const [selectedTables, setSelectedTables] = useState([]); + const [tableNameList, setTableNameList] = useState([]); const [syncTableModel, setSyncTableModel] = useState(0); const [isLoading, setIsLoading] = useState(false); const [aiContent, setAiContent] = useState(''); @@ -355,9 +357,6 @@ function ConsoleEditor(props: IProps, ref: ForwardedRef) { setSyncTableModel(hasAiAccess ? SyncModelType.AUTO : SyncModelType.MANUAL); }; - const [selectedTables, setSelectedTables] = useState([]); - const [tableNameList, setTableNameList] = useState([]); - // 注册快捷键 const registerShortcutKey = (editor, monaco) => { // 保存 From bafc814644b889928a1e7a822a599d1e8cfcdefe Mon Sep 17 00:00:00 2001 From: shanhexi Date: Fri, 22 Dec 2023 17:33:57 +0800 Subject: [PATCH 26/37] feat:The extension bar can be dragged --- .../components/DraggableContainer/index.tsx | 7 ++- .../WorkspaceExtendBody/index.less | 3 + .../WorkspaceExtendBody/index.tsx | 10 +++ .../WorkspaceExtendNav/index.less | 28 +++++++++ .../WorkspaceExtendNav/index.tsx | 48 +++++++++++++++ .../components/WorkspaceExtend/config.tsx | 32 ++++++++++ .../components/WorkspaceExtend/index.less | 2 + .../components/WorkspaceExtend/index.tsx | 61 +++++++++---------- .../components/WorkspaceRight/index.less | 16 ++++- .../components/WorkspaceRight/index.tsx | 20 ++++-- .../components/WorkspaceTabs/index.less | 2 +- .../src/pages/main/workspace/index.tsx | 4 +- 12 files changed, 187 insertions(+), 46 deletions(-) create mode 100644 chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendBody/index.less create mode 100644 chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendBody/index.tsx create mode 100644 chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendNav/index.less create mode 100644 chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendNav/index.tsx create mode 100644 chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/config.tsx diff --git a/chat2db-client/src/components/DraggableContainer/index.tsx b/chat2db-client/src/components/DraggableContainer/index.tsx index b8889ecee..2ba6bccd9 100644 --- a/chat2db-client/src/components/DraggableContainer/index.tsx +++ b/chat2db-client/src/components/DraggableContainer/index.tsx @@ -4,7 +4,7 @@ import classnames from 'classnames'; interface IProps { className?: string; - children: any; //TODO: TS,约定接受一个数组,第一项child需要携带ref + children: any; //TODO: TS,约定接受一个数组 min?: number; layout?: 'row' | 'column'; callback?: (data: any) => void; @@ -13,7 +13,7 @@ interface IProps { export default memo((props: IProps) => { const { children, showLine = true, callback, min, className, layout = 'row' } = props; - const volatileRef = children[0]?.ref; + const volatileRef = children[0]?.ref || children[1]?.ref; const DividerRef = useRef(null); const DividerLine = useRef(null); @@ -47,7 +47,8 @@ export default memo((props: IProps) => { const computedXY = nowClientXY - clientStart; let finalXY = 0; - finalXY = volatileBoxXY + computedXY; + // children 如果第一个是可变的,那么就是+ 如果第二个是可变的,那么就是- + finalXY = children[0]?.ref ? volatileBoxXY + computedXY : volatileBoxXY - computedXY; if (min && finalXY < min) { return; diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendBody/index.less b/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendBody/index.less new file mode 100644 index 000000000..a4e81baf5 --- /dev/null +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendBody/index.less @@ -0,0 +1,3 @@ +.WorkspaceExtendBody{ + // flex: 1; +} \ No newline at end of file diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendBody/index.tsx b/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendBody/index.tsx new file mode 100644 index 000000000..3290c7900 --- /dev/null +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendBody/index.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import styles from './index.less'; +import {extendConfig} from '../config'; + + +export default () => { + return
+ {extendConfig[0].components} +
+}; diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendNav/index.less b/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendNav/index.less new file mode 100644 index 000000000..a9a6fde80 --- /dev/null +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendNav/index.less @@ -0,0 +1,28 @@ +@import '../../../../../../styles/var.less'; + +// .workspaceExtend { +// display: none; +// background-color: var(--color-bg-subtle); +// .workspaceExtendMain { +// flex: 1; +// width: 0px; +// border-right: 1px solid var(--color-border); +// } +// } + +.workspaceExtendNav { + flex-shrink: 0; + width: 38px; + display: flex; + flex-direction: column; + align-items: center; + padding: 5px 0px; +} + +.rightBarFront { + margin: 2px 0px; +} + +.workspaceExtendActive { + display: flex; +} diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendNav/index.tsx b/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendNav/index.tsx new file mode 100644 index 000000000..9b82d88b3 --- /dev/null +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendNav/index.tsx @@ -0,0 +1,48 @@ +import React, { useState } from 'react'; +import styles from './index.less'; +import classnames from 'classnames'; +// import i18n from '@/i18n'; +import { Popover } from 'antd'; +import Iconfont from '@/components/Iconfont'; +import {extendConfig} from '../config'; + +// import { useWorkspaceStore } from '@/pages/main/workspace/store'; + +interface IToolbar { + code: string; + title: string; + icon: string; + components: any; +} + +interface IProps { + className?: any; +} + +export default (props:IProps) => { + const { className } = props; + const [activeExtend, setActiveExtend] = useState(null); + + const changeExtend = (item: IToolbar) => { + if (activeExtend?.code === item.code) { + setActiveExtend(null); + return; + } + setActiveExtend(item); + }; + + return ( +
+ {extendConfig.map((item, index) => { + return ( + +
+ +
+
+ ); + })} +
+ ); + +}; diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/config.tsx b/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/config.tsx new file mode 100644 index 000000000..c51387b25 --- /dev/null +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/config.tsx @@ -0,0 +1,32 @@ +import React from 'react'; +import i18n from '@/i18n'; +import Output from '@/components/Output'; +import SaveList from '../SaveList'; + +interface IToolbar { + code: string; + title: string; + icon: string; + components: any; +} + +export const extendConfig: IToolbar[] = [ + // { + // code: 'ai', + // title: 'AI', + // icon: '\ue8ad', + // components:
ai
, + // }, + { + code: 'executiveLog', + title: i18n('common.title.executiveLogging'), + icon: '\ue8ad', + components: , + }, + { + code: 'saveList', + title: i18n('workspace.title.savedConsole'), + icon: '\ue619', + components: , + }, +]; diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/index.less b/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/index.less index 36bd76553..8304d61a5 100644 --- a/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/index.less +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/index.less @@ -12,6 +12,8 @@ padding: 5px 0px; } .workspaceExtendMain { + flex: 1; + width: 0px; border-right: 1px solid var(--color-border); } } diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/index.tsx b/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/index.tsx index c51daf445..4824e2ce4 100644 --- a/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/index.tsx +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/index.tsx @@ -1,6 +1,6 @@ -import React, { memo, useState } from 'react'; +import React, { useState } from 'react'; import styles from './index.less'; -import classnames from 'classnames'; +// import classnames from 'classnames'; import { Popover } from 'antd'; import Iconfont from '@/components/Iconfont'; import Output from '@/components/Output'; @@ -8,20 +8,14 @@ import SaveList from '../SaveList'; import { useWorkspaceStore } from '@/pages/main/workspace/store'; import i18n from '@/i18n'; -interface IProps { - className?: string; -} - interface IToolbar { code: string; title: string; icon: string; components: any; - width: number; } -export default memo((props) => { - const { className } = props; +export const useWorkspaceExtend = () => { const [activeExtend, setActiveExtend] = useState(null); const { panelRight } = useWorkspaceStore((state) => state.layout); @@ -37,14 +31,12 @@ export default memo((props) => { title: i18n('common.title.executiveLogging'), icon: '\ue8ad', components: , - width: 400, }, { code: 'saveList', title: i18n('workspace.title.savedConsole'), icon: '\ue619', components: , - width: 200, }, ]; @@ -56,28 +48,31 @@ export default memo((props) => { setActiveExtend(item); }; - return ( -
+ //
+ // ); + + const extendBody = ( + <>{activeExtend &&
{activeExtend?.components}
} + ); + const extendNav = ( +
+ {toolbarConfig.map((item, index) => { + return ( + +
+ +
+
+ ); })} - > - {activeExtend && ( -
- {activeExtend?.components} -
- )} -
- {toolbarConfig.map((item, index) => { - return ( - -
- -
-
- ); - })} -
); -}); + + return [extendBody, extendNav]; +}; diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.less b/chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.less index 3fe2b15d9..0425bb4a7 100644 --- a/chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.less +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.less @@ -2,12 +2,26 @@ .workspaceRight { position: relative; + display: flex; flex: 1; width: 0px; - display: flex; +} + +.workspaceExtendNav{ + border-left: 1px solid var(--color-border); +} + +.draggableContainer{ + flex: 1; +} + +.workspaceExtendBody{ + width: auto; + border-left: 1px solid var(--color-border); } .workspaceExtend { + height: 100%; flex-shrink: 0; border-left: 1px solid var(--color-border); display: flex; diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.tsx b/chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.tsx index 7fb85f246..a9e35069a 100644 --- a/chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.tsx +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.tsx @@ -1,16 +1,24 @@ -import React, { memo } from 'react'; +import React, { memo, useRef } from 'react'; import styles from './index.less'; -import classnames from 'classnames'; -import WorkspaceExtend from '../WorkspaceExtend'; +// import classnames from 'classnames'; +import WorkspaceExtendBody from '../WorkspaceExtend/WorkspaceExtendBody'; +import WorkspaceExtendNav from '../WorkspaceExtend/WorkspaceExtendNav'; // ----- components ----- import WorkspaceTabs from '../WorkspaceTabs'; +import DraggableContainer from '@/components/DraggableContainer'; const WorkspaceRight = memo(() => { + const draggableRef = useRef(); return ( -
- - +
+ + +
+ +
+
+
); }); diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.less b/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.less index f0856b4eb..7a5f8ef54 100644 --- a/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.less +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceTabs/index.less @@ -2,8 +2,8 @@ .tabBox { height: 100%; - width: 0px; flex: 1; + width: 0px; } .ears { diff --git a/chat2db-client/src/pages/main/workspace/index.tsx b/chat2db-client/src/pages/main/workspace/index.tsx index 6e84095ef..03ccfef39 100644 --- a/chat2db-client/src/pages/main/workspace/index.tsx +++ b/chat2db-client/src/pages/main/workspace/index.tsx @@ -5,7 +5,7 @@ import { useWorkspaceStore } from '@/pages/main/workspace/store'; import DraggableContainer from '@/components/DraggableContainer'; import WorkspaceLeft from './components/WorkspaceLeft'; -import NewWorkspaceRight from './components/WorkspaceRight'; +import WorkspaceRight from './components/WorkspaceRight'; import useMonacoTheme from '@/components/MonacoEditor/useMonacoTheme'; import shortcutKeyCreateConsole from './functions/shortcutKeyCreateConsole'; @@ -39,7 +39,7 @@ const workspacePage = memo(() => { >
- +
); From 6746d23937cc80ef0e65fea0530d824f61d3f558 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Sat, 23 Dec 2023 11:05:25 +0800 Subject: [PATCH 27/37] Drag extension bug --- .../components/DraggableContainer/index.tsx | 12 ++++++------ .../WorkspaceExtendBody/index.tsx | 17 ++++++++++++----- .../WorkspaceExtendNav/index.tsx | 19 ++++++++++++------- .../components/WorkspaceRight/index.less | 4 +++- .../components/WorkspaceRight/index.tsx | 11 +++++++++-- .../src/pages/main/workspace/store/common.ts | 6 ++++++ 6 files changed, 48 insertions(+), 21 deletions(-) diff --git a/chat2db-client/src/components/DraggableContainer/index.tsx b/chat2db-client/src/components/DraggableContainer/index.tsx index 2ba6bccd9..a6a0a389e 100644 --- a/chat2db-client/src/components/DraggableContainer/index.tsx +++ b/chat2db-client/src/components/DraggableContainer/index.tsx @@ -15,18 +15,18 @@ export default memo((props: IProps) => { const { children, showLine = true, callback, min, className, layout = 'row' } = props; const volatileRef = children[0]?.ref || children[1]?.ref; - const DividerRef = useRef(null); - const DividerLine = useRef(null); + const dividerRef = useRef(null); + const dividerLine = useRef(null); const [dragging, setDragging] = useState(false); const isRow = layout === 'row'; useEffect(() => { - if (!DividerRef.current) { + if (!dividerRef.current) { return; } - DividerRef.current.onmousedown = (e) => { + dividerRef.current.onmousedown = (e) => { if (!volatileRef?.current) return; e.preventDefault(); setDragging(true); @@ -67,10 +67,10 @@ export default memo((props: IProps) => { {
-
+
} {children[1]} diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendBody/index.tsx b/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendBody/index.tsx index 3290c7900..f1e7a7283 100644 --- a/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendBody/index.tsx +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendBody/index.tsx @@ -1,10 +1,17 @@ -import React from 'react'; -import styles from './index.less'; +import { useMemo } from 'react'; import {extendConfig} from '../config'; +import {useWorkspaceStore} from '@/pages/main/workspace/store'; export default () => { - return
- {extendConfig[0].components} -
+ const {currentWorkspaceExtend} = useWorkspaceStore((state) => { + return { + currentWorkspaceExtend: state.currentWorkspaceExtend, + } + }); + const component = useMemo(() => { + return extendConfig.find((item) => item.code === currentWorkspaceExtend)?.components + }, [currentWorkspaceExtend]); + + return component }; diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendNav/index.tsx b/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendNav/index.tsx index 9b82d88b3..dffbcfa8c 100644 --- a/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendNav/index.tsx +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceExtend/WorkspaceExtendNav/index.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React from 'react'; import styles from './index.less'; import classnames from 'classnames'; // import i18n from '@/i18n'; @@ -6,7 +6,8 @@ import { Popover } from 'antd'; import Iconfont from '@/components/Iconfont'; import {extendConfig} from '../config'; -// import { useWorkspaceStore } from '@/pages/main/workspace/store'; +import { setCurrentWorkspaceExtend } from '@/pages/main/workspace/store/common'; +import { useWorkspaceStore } from '@/pages/main/workspace/store'; interface IToolbar { code: string; @@ -21,14 +22,18 @@ interface IProps { export default (props:IProps) => { const { className } = props; - const [activeExtend, setActiveExtend] = useState(null); + const { currentWorkspaceExtend } = useWorkspaceStore((state) => { + return { + currentWorkspaceExtend: state.currentWorkspaceExtend, + }; + }); const changeExtend = (item: IToolbar) => { - if (activeExtend?.code === item.code) { - setActiveExtend(null); + if (currentWorkspaceExtend === item.code) { + setCurrentWorkspaceExtend(null); return; } - setActiveExtend(item); + setCurrentWorkspaceExtend(item.code); }; return ( @@ -37,7 +42,7 @@ export default (props:IProps) => { return (
- +
); diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.less b/chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.less index 0425bb4a7..b8036fe56 100644 --- a/chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.less +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.less @@ -13,10 +13,12 @@ .draggableContainer{ flex: 1; + width: 0px; + overflow: hidden; } .workspaceExtendBody{ - width: auto; + width: 300px; border-left: 1px solid var(--color-border); } diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.tsx b/chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.tsx index a9e35069a..2bfc16975 100644 --- a/chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.tsx +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.tsx @@ -3,6 +3,7 @@ import styles from './index.less'; // import classnames from 'classnames'; import WorkspaceExtendBody from '../WorkspaceExtend/WorkspaceExtendBody'; import WorkspaceExtendNav from '../WorkspaceExtend/WorkspaceExtendNav'; +import { useWorkspaceStore } from '@/pages/main/workspace/store'; // ----- components ----- import WorkspaceTabs from '../WorkspaceTabs'; @@ -10,14 +11,20 @@ import DraggableContainer from '@/components/DraggableContainer'; const WorkspaceRight = memo(() => { const draggableRef = useRef(); + const { currentWorkspaceExtend } = useWorkspaceStore((state) => { + return { + currentWorkspaceExtend: state.currentWorkspaceExtend, + }; + }); return (
- + -
+
+
); diff --git a/chat2db-client/src/pages/main/workspace/store/common.ts b/chat2db-client/src/pages/main/workspace/store/common.ts index 95b4c3c33..ac9bbac3c 100644 --- a/chat2db-client/src/pages/main/workspace/store/common.ts +++ b/chat2db-client/src/pages/main/workspace/store/common.ts @@ -3,12 +3,18 @@ import { useWorkspaceStore } from './index' export interface ICommonStore { currentConnectionDetails: IConnectionListItem | null; + currentWorkspaceExtend: string | null; } export const initCommonStore: ICommonStore = { currentConnectionDetails: null, + currentWorkspaceExtend: null, } export const setCurrentConnectionDetails = (connectionDetails: ICommonStore['currentConnectionDetails']) => { return useWorkspaceStore.setState({ currentConnectionDetails: connectionDetails }); } + +export const setCurrentWorkspaceExtend = (workspaceExtend: ICommonStore['currentWorkspaceExtend']) => { + return useWorkspaceStore.setState({ currentWorkspaceExtend: workspaceExtend }); +} From 164518d85c9bce8efee3bb8d577ce40c62f96e33 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Mon, 25 Dec 2023 16:19:52 +0800 Subject: [PATCH 28/37] feat:Execute the Record sql Add replication button --- CHANGELOG.md | 17 +++++-- CHANGELOG_CN.md | 13 +++++- .../src/components/Output/index.less | 32 ++++++++++---- .../src/components/Output/index.tsx | 44 ++++++++++++++++--- chat2db-client/src/i18n/en-us/workspace.ts | 1 + chat2db-client/src/i18n/zh-cn/workspace.ts | 1 + chat2db-client/src/service/history.ts | 2 +- 7 files changed, 88 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b907d172b..678a1f811 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## 3.1.16 + +`2023-12-25` + +**Changelog** + +- ⭐【New Features】Execute the Record sql Add replication button +- ⭐【New Features】Run record sql to open the console directly +- ⭐【New Features】The SQL column on the right of execution record and save can be expanded and dragged +- 🐞【Fixed】Some databases could not display the Database/Schema structure + ## 3.1.15 `2023-12-20` @@ -58,9 +69,9 @@ - 🔥🔥【Optimize】Optimized the tab switchover problem - ⚡️ 【Optimize】All nodes are supported. The name of each node can be copied - ⚡️【Optimize】The sql console input box supports switching databases, and will not change when the left database is switched -- ⭐ 【New function】Save records moved to the right toolbar, you can directly modify the name in the list -- ⭐【New feature】Support mongoDB -- ⭐【New function】Support for viewing all tables +- ⭐ 【New Features】Save records moved to the right toolbar, you can directly modify the name in the list +- ⭐【New Features】Support mongoDB +- ⭐【New Features】Support for viewing all tables ## 3.0.14 diff --git a/CHANGELOG_CN.md b/CHANGELOG_CN.md index f2f2f12c5..1c2fca416 100644 --- a/CHANGELOG_CN.md +++ b/CHANGELOG_CN.md @@ -1,3 +1,14 @@ +## 3.1.16 + +`2023-12-25` + +**更新日志** + +- ⭐【新功能】执行记录sql添加复制按钮 +- ⭐【新功能】执行记录sql可直接打开控制台 +- ⭐【新功能】右侧执行记录、保存SQL栏展开大小可拖动 +- 🐞【修复】部分数据库无法显示数据库/Schema结构的问题 + ## 3.1.15 `2023-12-20` @@ -6,8 +17,6 @@ - 🐞【修复】每次打开应用时,偶现无法选择数据库问题 - 🐞【修复】兼容老数据类型无法显示删除问题 -- 🐞【修复】部分数据库无法显示数据库/Schema结构的问题 - ## 3.1.14 diff --git a/chat2db-client/src/components/Output/index.less b/chat2db-client/src/components/Output/index.less index 0b9407585..7785a6f68 100644 --- a/chat2db-client/src/components/Output/index.less +++ b/chat2db-client/src/components/Output/index.less @@ -36,12 +36,16 @@ margin-right: 4px; font-weight: 500; } - .iconBox { + .timeBoxIcon { transform: rotate(90deg); margin-right: 4px; i { color: var(--color-success); } + &:hover { + cursor: default; + background-color: transparent; + } } .failureIconBox { i { @@ -51,16 +55,26 @@ > div { line-height: 22px; } - .sqlPlace { - color: var(--color-warning-text); - } - .sqlPlace, - .sqlBox { - padding-left: 18px; - } padding: 2px 0px; } } - .sqlBox { + + .executedDatabaseBox,.sqlBox{ + display: flex; + .iconBox{ + margin-right: 4px; + flex-shrink: 0; + } + } + + .executedDatabaseBox{ + .executedDatabase { + color: var(--color-warning-text); + white-space: nowrap; + } } + // .sqlBox { + // .sqlContent{ + // } + // } } diff --git a/chat2db-client/src/components/Output/index.tsx b/chat2db-client/src/components/Output/index.tsx index e9cf1396f..0aee9ba5b 100644 --- a/chat2db-client/src/components/Output/index.tsx +++ b/chat2db-client/src/components/Output/index.tsx @@ -6,6 +6,9 @@ import ScrollLoading from '@/components/ScrollLoading'; import historyService, { IHistoryRecord } from '@/service/history'; import * as monaco from 'monaco-editor'; import i18n from '@/i18n'; +import { copy } from '@/utils'; +import { createConsole } from '@/pages/main/workspace/store/console'; +import { Popover } from 'antd'; interface IProps { className?: string; @@ -34,7 +37,8 @@ export default memo((props) => { const promiseList = res.data.map((item) => { return new Promise((resolve) => { // 不换行 - const ddl = (item.ddl || '')?.replace(/\n/g, ' '); + // const ddl = (item.ddl || '')?.replace(/\n/g, ' '); + const ddl = item.ddl || ''; monaco.editor.colorize(ddl, 'sql', {}).then((_res) => { resolve({ ...item, @@ -49,6 +53,22 @@ export default memo((props) => { }); }; + const copySql = (text: IDatasource['ddl']) => { + copy(text || ''); + } + + const openSql = (data: IDatasource) => { + createConsole({ + ddl: data.ddl || '', + dataSourceId: data.dataSourceId!, + dataSourceName: data.dataSourceName!, + databaseType: data.type!, + databaseName: data.databaseName!, + schemaName: data.schemaName!, + // operationType: WorkspaceTabType, + }) + } + return (
@@ -64,19 +84,29 @@ export default memo((props) => { > <> {dataSource.map((item, index) => { - const nameList = [item.databaseName, item.schemaName]; + const nameList = [item.dataSourceName, item.databaseName, item.schemaName]; return (
-
- -
+ [{item.gmtCreate}] {/* {!!item.operationRows && {item.operationRows} rows} */} {!!item.useTime && {i18n('common.text.executionTime', item.useTime)}}
-
{nameList.filter((name) => name).join(' > ')}
-
+
+ + {openSql(item)}} /> + +
+ {nameList.filter((name) => name).join(' > ')} +
+
+
+ + {copySql(item.ddl)}} /> + +
+
); })} diff --git a/chat2db-client/src/i18n/en-us/workspace.ts b/chat2db-client/src/i18n/en-us/workspace.ts index fbb512689..d81ca0556 100644 --- a/chat2db-client/src/i18n/en-us/workspace.ts +++ b/chat2db-client/src/i18n/en-us/workspace.ts @@ -33,4 +33,5 @@ export default { 'workspace.tree.delete.table.tip': 'Are you sure you want to delete the table {1}?', 'workspace.tips.noConnection': 'You have not created a connection yet', 'workspace.tips.maxConsole': 'You can only open up to 20 consoles', + 'workspace.tips.openExecutiveLogging': 'Open this executive logging', }; diff --git a/chat2db-client/src/i18n/zh-cn/workspace.ts b/chat2db-client/src/i18n/zh-cn/workspace.ts index 1022ff1d5..c1873b15c 100644 --- a/chat2db-client/src/i18n/zh-cn/workspace.ts +++ b/chat2db-client/src/i18n/zh-cn/workspace.ts @@ -32,4 +32,5 @@ export default { 'workspace.tree.delete.table.tip': '确定要删除表{1}吗?', 'workspace.tips.noConnection': '你还没有创建连接', 'workspace.tips.maxConsole': '最多只能打开20个控制台', + 'workspace.tips.openExecutiveLogging': '打开执行记录', }; diff --git a/chat2db-client/src/service/history.ts b/chat2db-client/src/service/history.ts index 82a55761e..115850b3d 100644 --- a/chat2db-client/src/service/history.ts +++ b/chat2db-client/src/service/history.ts @@ -71,7 +71,7 @@ export interface IHistoryRecord { /** * ddl语言类型 */ - type?: null | string; + type?: DatabaseTypeCode | null; /** * 使用时长 */ From eb3f0645f2776c58c05ffd59c8db31c05a01bf26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=95=96=E7=99=B8?= Date: Mon, 25 Dec 2023 16:24:09 +0800 Subject: [PATCH 29/37] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dweb=E5=88=B7=E6=96=B040?= =?UTF-8?q?4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/start/controller/thymeleaf/ThymeleafController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chat2db-server/chat2db-server-web-start/src/main/java/ai/chat2db/server/web/start/controller/thymeleaf/ThymeleafController.java b/chat2db-server/chat2db-server-web-start/src/main/java/ai/chat2db/server/web/start/controller/thymeleaf/ThymeleafController.java index 202e4fc49..cf34438cb 100644 --- a/chat2db-server/chat2db-server-web-start/src/main/java/ai/chat2db/server/web/start/controller/thymeleaf/ThymeleafController.java +++ b/chat2db-server/chat2db-server-web-start/src/main/java/ai/chat2db/server/web/start/controller/thymeleaf/ThymeleafController.java @@ -22,7 +22,7 @@ public class ThymeleafController { * * @return */ - @GetMapping(value = {"/", "/web/", "/web/**","/login"}) + @GetMapping(value = {"/", "/web/", "/web/**","/login","/demo","/workspace","/dashboard","/connections","/team"}) public String index() { return "index"; } From a9954e4f41eeea5d20a22a2307ce5b2b246c646f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=95=96=E7=99=B8?= Date: Mon, 25 Dec 2023 16:35:39 +0800 Subject: [PATCH 30/37] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dweb=E5=88=B7=E6=96=B040?= =?UTF-8?q?4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/start/controller/thymeleaf/ThymeleafController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chat2db-server/chat2db-server-start/src/main/java/ai/chat2db/server/start/controller/thymeleaf/ThymeleafController.java b/chat2db-server/chat2db-server-start/src/main/java/ai/chat2db/server/start/controller/thymeleaf/ThymeleafController.java index f4741d5f8..8abe24674 100644 --- a/chat2db-server/chat2db-server-start/src/main/java/ai/chat2db/server/start/controller/thymeleaf/ThymeleafController.java +++ b/chat2db-server/chat2db-server-start/src/main/java/ai/chat2db/server/start/controller/thymeleaf/ThymeleafController.java @@ -22,7 +22,7 @@ public class ThymeleafController { * * @return */ - @GetMapping(value = {"/", "/web/", "/web/**","/login"}) + @GetMapping(value = {"/", "/web/", "/web/**","/login","/demo","/workspace","/dashboard","/connections","/team"}) public String index() { return "index"; } From 6f6cb59cc9b51ce1809ad687f01b1e7fc62f9615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=95=96=E7=99=B8?= Date: Mon, 25 Dec 2023 16:37:38 +0800 Subject: [PATCH 31/37] =?UTF-8?q?=E5=88=A0=E9=99=A4demo=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/start/controller/thymeleaf/ThymeleafController.java | 2 +- .../web/start/controller/thymeleaf/ThymeleafController.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chat2db-server/chat2db-server-start/src/main/java/ai/chat2db/server/start/controller/thymeleaf/ThymeleafController.java b/chat2db-server/chat2db-server-start/src/main/java/ai/chat2db/server/start/controller/thymeleaf/ThymeleafController.java index 8abe24674..fa01f4ac8 100644 --- a/chat2db-server/chat2db-server-start/src/main/java/ai/chat2db/server/start/controller/thymeleaf/ThymeleafController.java +++ b/chat2db-server/chat2db-server-start/src/main/java/ai/chat2db/server/start/controller/thymeleaf/ThymeleafController.java @@ -22,7 +22,7 @@ public class ThymeleafController { * * @return */ - @GetMapping(value = {"/", "/web/", "/web/**","/login","/demo","/workspace","/dashboard","/connections","/team"}) + @GetMapping(value = {"/", "/web/", "/web/**","/login","/workspace","/dashboard","/connections","/team"}) public String index() { return "index"; } diff --git a/chat2db-server/chat2db-server-web-start/src/main/java/ai/chat2db/server/web/start/controller/thymeleaf/ThymeleafController.java b/chat2db-server/chat2db-server-web-start/src/main/java/ai/chat2db/server/web/start/controller/thymeleaf/ThymeleafController.java index cf34438cb..2da27b52d 100644 --- a/chat2db-server/chat2db-server-web-start/src/main/java/ai/chat2db/server/web/start/controller/thymeleaf/ThymeleafController.java +++ b/chat2db-server/chat2db-server-web-start/src/main/java/ai/chat2db/server/web/start/controller/thymeleaf/ThymeleafController.java @@ -22,7 +22,7 @@ public class ThymeleafController { * * @return */ - @GetMapping(value = {"/", "/web/", "/web/**","/login","/demo","/workspace","/dashboard","/connections","/team"}) + @GetMapping(value = {"/", "/web/", "/web/**","/login","/workspace","/dashboard","/connections","/team"}) public String index() { return "index"; } From 3c98b1f3c67f306d7df77cbe2b43c54b15ceacf2 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Mon, 25 Dec 2023 19:14:20 +0800 Subject: [PATCH 32/37] Optimize: The query result cancels in-cell scrolling and instead uses hover to view cell contents --- CHANGELOG.md | 1 + CHANGELOG_CN.md | 1 + .../components/TableBox/index.less | 72 ++++++++++--------- .../components/TableBox/index.tsx | 10 ++- 4 files changed, 50 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 678a1f811..de53de4f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - ⭐【New Features】Run record sql to open the console directly - ⭐【New Features】The SQL column on the right of execution record and save can be expanded and dragged - 🐞【Fixed】Some databases could not display the Database/Schema structure +- ⚡️【Optimize】The query result cancels in-cell scrolling and instead uses hover to view cell contents ## 3.1.15 diff --git a/CHANGELOG_CN.md b/CHANGELOG_CN.md index 1c2fca416..ea79fa7eb 100644 --- a/CHANGELOG_CN.md +++ b/CHANGELOG_CN.md @@ -8,6 +8,7 @@ - ⭐【新功能】执行记录sql可直接打开控制台 - ⭐【新功能】右侧执行记录、保存SQL栏展开大小可拖动 - 🐞【修复】部分数据库无法显示数据库/Schema结构的问题 +- ⚡️【优化】查询结果取消单元格内滚动,改为hover查看单元格内容 ## 3.1.15 diff --git a/chat2db-client/src/components/SearchResult/components/TableBox/index.less b/chat2db-client/src/components/SearchResult/components/TableBox/index.less index 2617f450f..662d878e2 100644 --- a/chat2db-client/src/components/SearchResult/components/TableBox/index.less +++ b/chat2db-client/src/components/SearchResult/components/TableBox/index.less @@ -30,14 +30,17 @@ } } :global { + .table{ + overflow: hidden; + } .art-table { table colgroup col:nth-of-type(1) { min-width: 60px; } - th, - td { - overflow: hidden; - } + // th, + // td { + // overflow: hidden; + // } .fnWppk { // word-break: break-all; // display: -webkit-box; @@ -202,7 +205,6 @@ .tableItem { height: 31px; - cursor: pointer; display: flex; align-items: center; justify-content: space-between; @@ -210,6 +212,7 @@ padding-left: 4px; user-select: none; background-color: var(--color-bg-base); + cursor: pointer; .tableItemContent { max-height: 31px; @@ -218,16 +221,33 @@ width: 100%; overflow: hidden; white-space: nowrap; - &:hover { - overflow-x: auto; - // line-height: 14px; - } + text-overflow: ellipsis; + } + + .previewTableItemContent{ + display: none; + position: absolute; + left: 0px; + top: 0px; + bottom: 0px; + width: fit-content; + min-width: 100%; + padding: 0px 4px; + max-height: 31px; + line-height: 31px; + background-color: var(--color-bg-layout); + z-index: 2; + color: var(--color-text); + white-space: nowrap; } &:hover { - .tableHoverBox { + .previewTableItemContent { display: flex; } + .previewTableItemContent { + display: block; + } } .cellValueNull { @@ -241,20 +261,24 @@ .tableItemEdit { background-color: var(--color-success-bg); - .tableHoverBox { + .previewTableItemContent { background-color: var(--color-success-bg); } + } .tableItemHighlight { background-color: var(--color-bg-subtle); - .tableHoverBox { + .previewTableItemContent { background-color: var(--color-bg-subtle); } } .tableItemFocus { background-color: var(--color-primary-hover); color: var(--color-bg-base); - .tableHoverBox { + .previewTableItemContent { + background-color: var(--color-primary-hover); + } + .previewTableItemContent{ background-color: var(--color-primary-hover); } .cellValueNull { @@ -263,13 +287,13 @@ } .tableItemSuccess { background-color: var(--color-success-bg); - .tableHoverBox { + .previewTableItemContent { background-color: var(--color-success-bg); } } .tableItemError { background-color: var(--color-error-bg); - .tableHoverBox { + .previewTableItemContent { background-color: var(--color-error-bg); } } @@ -279,24 +303,6 @@ text-align: center; } -.tableHoverBox { - position: sticky; - height: 31px; - top: 0px; - bottom: 0px; - right: 0px; - width: 40px; - display: none; - align-items: center; - cursor: pointer; - background-color: var(--color-bg-base); - - i { - font-size: 15px; - margin: 0px 2px; - } -} - .pagination { :global { .ant-pagination-prev, diff --git a/chat2db-client/src/components/SearchResult/components/TableBox/index.tsx b/chat2db-client/src/components/SearchResult/components/TableBox/index.tsx index 6902b1c05..8e7e25952 100644 --- a/chat2db-client/src/components/SearchResult/components/TableBox/index.tsx +++ b/chat2db-client/src/components/SearchResult/components/TableBox/index.tsx @@ -656,6 +656,7 @@ export default function TableBox(props: ITableProps) { // title:
{name}
, render: (value: any, rowData) => { const rowId = rowData[colNoCode]; + const content = renderTableCellValue(value); return (
) : ( -
{renderTableCellValue(value)}
+ <> +
+ {content} +
+
+ {content} +
+ )}
); From d36af1f0500e793e6dee23294eb50ba2937605e2 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Mon, 25 Dec 2023 19:18:07 +0800 Subject: [PATCH 33/37] changelog --- CHANGELOG.md | 1 + CHANGELOG_CN.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index de53de4f6..92151c100 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - ⭐【New Features】Run record sql to open the console directly - ⭐【New Features】The SQL column on the right of execution record and save can be expanded and dragged - 🐞【Fixed】Some databases could not display the Database/Schema structure +- 🐞【Fixed】During web deployment, a page error occurs after the page switching page is refreshed - ⚡️【Optimize】The query result cancels in-cell scrolling and instead uses hover to view cell contents ## 3.1.15 diff --git a/CHANGELOG_CN.md b/CHANGELOG_CN.md index ea79fa7eb..e35698f09 100644 --- a/CHANGELOG_CN.md +++ b/CHANGELOG_CN.md @@ -8,6 +8,7 @@ - ⭐【新功能】执行记录sql可直接打开控制台 - ⭐【新功能】右侧执行记录、保存SQL栏展开大小可拖动 - 🐞【修复】部分数据库无法显示数据库/Schema结构的问题 +- 🐞【修复】网页部署时,切换页面刷新后页面报错问题 - ⚡️【优化】查询结果取消单元格内滚动,改为hover查看单元格内容 ## 3.1.15 From c6fd99a89b268da4e4b96980f11b616506726a26 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Mon, 25 Dec 2023 19:33:23 +0800 Subject: [PATCH 34/37] feat: Osmanli --- CHANGELOG.md | 2 +- CHANGELOG_CN.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92151c100..11589df0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ **Changelog** - ⭐【New Features】Execute the Record sql Add replication button -- ⭐【New Features】Run record sql to open the console directly +- ⭐【New Features】Execution records can be opened directly in the console - ⭐【New Features】The SQL column on the right of execution record and save can be expanded and dragged - 🐞【Fixed】Some databases could not display the Database/Schema structure - 🐞【Fixed】During web deployment, a page error occurs after the page switching page is refreshed diff --git a/CHANGELOG_CN.md b/CHANGELOG_CN.md index e35698f09..2409d1f9b 100644 --- a/CHANGELOG_CN.md +++ b/CHANGELOG_CN.md @@ -4,8 +4,8 @@ **更新日志** -- ⭐【新功能】执行记录sql添加复制按钮 -- ⭐【新功能】执行记录sql可直接打开控制台 +- ⭐【新功能】执行记录添加复制sql按钮 +- ⭐【新功能】执行记录可直接在控制台打开 - ⭐【新功能】右侧执行记录、保存SQL栏展开大小可拖动 - 🐞【修复】部分数据库无法显示数据库/Schema结构的问题 - 🐞【修复】网页部署时,切换页面刷新后页面报错问题 From 6c805f8a4e5897a74fbe049f1c3d42139395a796 Mon Sep 17 00:00:00 2001 From: shanhexi Date: Mon, 25 Dec 2023 20:39:28 +0800 Subject: [PATCH 35/37] feat: Japanese language support --- .../src/blocks/Setting/BaseSetting/index.tsx | 31 +++-- .../components/OperationLine/index.less | 1 - chat2db-client/src/constants/theme.ts | 1 + chat2db-client/src/i18n/index.tsx | 10 +- chat2db-client/src/i18n/ja-jp/chat.ts | 9 ++ chat2db-client/src/i18n/ja-jp/common.ts | 121 ++++++++++++++++++ chat2db-client/src/i18n/ja-jp/connection.ts | 37 ++++++ chat2db-client/src/i18n/ja-jp/dashboard.ts | 12 ++ chat2db-client/src/i18n/ja-jp/editTable.ts | 38 ++++++ .../src/i18n/ja-jp/editTableData.ts | 7 + chat2db-client/src/i18n/ja-jp/index.ts | 30 +++++ chat2db-client/src/i18n/ja-jp/login.ts | 13 ++ chat2db-client/src/i18n/ja-jp/menu.ts | 3 + chat2db-client/src/i18n/ja-jp/setting.ts | 59 +++++++++ chat2db-client/src/i18n/ja-jp/sqlEditor.ts | 9 ++ chat2db-client/src/i18n/ja-jp/team.ts | 54 ++++++++ chat2db-client/src/i18n/ja-jp/workspace.ts | 36 ++++++ 17 files changed, 457 insertions(+), 14 deletions(-) create mode 100644 chat2db-client/src/i18n/ja-jp/chat.ts create mode 100644 chat2db-client/src/i18n/ja-jp/common.ts create mode 100644 chat2db-client/src/i18n/ja-jp/connection.ts create mode 100644 chat2db-client/src/i18n/ja-jp/dashboard.ts create mode 100644 chat2db-client/src/i18n/ja-jp/editTable.ts create mode 100644 chat2db-client/src/i18n/ja-jp/editTableData.ts create mode 100644 chat2db-client/src/i18n/ja-jp/index.ts create mode 100644 chat2db-client/src/i18n/ja-jp/login.ts create mode 100644 chat2db-client/src/i18n/ja-jp/menu.ts create mode 100644 chat2db-client/src/i18n/ja-jp/setting.ts create mode 100644 chat2db-client/src/i18n/ja-jp/sqlEditor.ts create mode 100644 chat2db-client/src/i18n/ja-jp/team.ts create mode 100644 chat2db-client/src/i18n/ja-jp/workspace.ts diff --git a/chat2db-client/src/blocks/Setting/BaseSetting/index.tsx b/chat2db-client/src/blocks/Setting/BaseSetting/index.tsx index de4deda7e..1f6ab7ab6 100644 --- a/chat2db-client/src/blocks/Setting/BaseSetting/index.tsx +++ b/chat2db-client/src/blocks/Setting/BaseSetting/index.tsx @@ -5,15 +5,13 @@ import classnames from 'classnames'; import themeDarkImg from '@/assets/img/theme-dark.png'; import themeLightImg from '@/assets/img/theme-light.png'; import themeAutoImg from '@/assets/img/theme-auto.png'; -import { Radio, Select } from 'antd'; +import { Select } from 'antd'; import Iconfont from '@/components/Iconfont'; import { setLang as setLangLocalStorage } from '@/utils/localStorage'; import { useTheme } from '@/hooks/useTheme'; import styles from './index.less'; -const { Option } = Select; - const themeList = [ { code: ThemeType.Light, @@ -42,6 +40,13 @@ const themeList = [ // }, ]; +const languageOptions = [ + { value: LangType.ZH_CN, label: '简体中文' }, + { value: LangType.EN_US, label: 'English' }, + { value: LangType.TR_TR, label: 'Turkish' }, + { value: LangType.JA_JP, label: '日本語' }, +] + const colorList = [ { code: 'golden-purple', @@ -103,10 +108,10 @@ export default function BaseSetting() { }; function changeLang(e: any) { - setLangLocalStorage(e.target.value); + setLangLocalStorage(e); //切换语言时,需要设置cookie,用来改变后台服务的Locale const date = new Date('2030-12-30 12:30:00').toUTCString(); - document.cookie = `CHAT2DB.LOCALE=${e.target.value};Expires=${date}`; + document.cookie = `CHAT2DB.LOCALE=${e};Expires=${date}`; location.reload(); } @@ -118,10 +123,8 @@ export default function BaseSetting() { setCurrentTheme(backgroundColor); } - - const changeSqlEditorFontSize = (e: any) => { - - } + // const changeSqlEditorFontSize = (e: any) => { + // } return ( <> @@ -142,11 +145,17 @@ export default function BaseSetting() {
{i18n('setting.title.language')}
- + {/* 简体中文 English Turkish - + */} +