diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 71c096913..552cd732d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -140,7 +140,7 @@ jobs: yarn install yarn run build:web:prod --app_version=${{ steps.chat2db_version.outputs.substring }} 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 + cp -r dist/index.html ../chat2db-server/chat2db-server-start/src/main/resources/thymeleaf/ # 编译服务端java版本 - name: Build Java diff --git a/.github/workflows/release_test.yml b/.github/workflows/release_test.yml index 2f0d40be9..8d6d78f39 100644 --- a/.github/workflows/release_test.yml +++ b/.github/workflows/release_test.yml @@ -134,7 +134,7 @@ jobs: yarn install yarn run build:web:prod --app_version=99.0.${{ github.run_id }} --app_port=10822 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 + cp -r dist/index.html ../chat2db-server/chat2db-server-start/src/main/resources/thymeleaf/ # 编译服务端java版本 - name: Build Java diff --git a/.gitignore b/.gitignore index 9109cb447..12d2ab65f 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ package-lock.json ### Mac .DS_Store /chat2db-server/ali-dbhub-server-start/src/main/resources/static/front/* +/chat2db-server/ali-dbhub-server-start/src/main/resources/thymeleaf ### docker 数据不用上传 /docker/redis/data/* diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b1573ff2..04b350c6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,18 @@ +# 3.0.1 +`2023-10-19` + +**Changelog** +- ⚡️【Optimize】Search result scroll bar +- ⚡️【Fixed】Oracle update result data bug + +**更新日志** +- ⚡️【优化】查询结果滚动条 +- 🐞【修复】Oracle更新结果数据错误 + # 3.0.0 `2023-10-17` -## Changelog +**Changelog** - 🔥【New Features】Support for team collaboration mode - 🔥【New Features】Support for visual table structure creation, editing, and deletion - 🔥【New Features】Support for editing, adding, and deleting query data results @@ -18,7 +29,8 @@ - ⚡️【Optimize】`Cmd/Ctrl + R` Run SQL, `Cmd/Ctrl + Shift + R` Refresh Page - 🐞【Fixed】Table operation columns are overridden by table comments - 🐞【Fixed】The last Tab in the query result cannot be closed -## 更新日志 + +**更新日志** - 🔥【新功能】支持团队协作模式 - 🔥【新功能】支持可视化表结构新增、编辑、删除 - 🔥【新功能】支持查询数据结果编辑、新增、删除 diff --git a/README.md b/README.md index d1dcf1327..705e16965 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,12 @@ An intelligent and versatile general-purpose SQL client and reporting tool for d Languages: English | [中文](README_CN.md) +Official website:[Chat2DB](https://sqlgpt.cn/en) + +
+ If you find Chat2DB helpful, please helpgithub starClick ⭐ Star and Fork in the top right corner, and your support is the biggest motivation for Chat2DB to get bette +
+ ## DEMO @@ -49,7 +55,7 @@ https://github.com/chat2db/Chat2DB/assets/22975773/79e9dded-375b-44cf-9979-bb757 [Downloading installation package from GitHub](https://github.com/chat2db/Chat2DB/releases) -[Downloading installation package from official website](https://sqlgpt.cn/docs/guides/download) +[Downloading installation package from official website](https://sqlgpt.cn) @@ -61,7 +67,7 @@ Chat2DB supports connecting to the following databases: - H2 - Oracle - SQLServer -- SQLLite +- SQLite - MariaDB - ClickHouseare - DM @@ -94,25 +100,7 @@ Redis and MongoDB are partially supported , Hbase、Elasticsearch、openGauss、 ## 🔥 AI Configuration -### CONFIGURE OPENAI - -Option 1 (recommended): To use the ChatSql function of OPENAI, two conditions must be met: - -- You need an OPENAI_API_KEY. -- The client's network can connect to the OPENAI website, and for users in China, a VPN is required. Note: If the local VPN is not fully effective, the network connectivity can be ensured by setting the network proxy HOST and PORT in the client. - -3 - - -Option 2 (recommended): We provide a unified proxy service. - -- No OPENAI_API_KEY is required. -- No proxy or VPN is required, as long as the network is connected. - -To facilitate users' quick use of AI capabilities, you can scan the QR code below to follow our WeChat public account and apply for our custom API_KEY. - -4 - +### Use Chat2DB AI to get started ### CONFIGURE CUSTOM AI @@ -147,7 +135,7 @@ Note: If local debugging is required - git clone to local ```bash -$ git clone git@github.com:alibaba/Chat2DB.git +$ git clone git@github.com:chat2db/Chat2DB.git ``` - Front-End debug @@ -169,10 +157,17 @@ $ cd chat2db-server/chat2db-server-start/target/ $ java -jar -Dloader.path=./lib -Dchatgpt.apiKey=xxxxx chat2db-server-start.jar #java 17 or later must be installed, To launch the chat application, you need to enter the ChatGPT key for the chatgpt.apiKey. Without entering it, you won't be able to use the AIGC function. ``` +- If you need to deploy independently + +```bash +$ npm run build:web:prod / 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 +# Repackage the back-end services +``` + ## 📑 Documentation -- Official website document -- Issue +- Official website document +- Issue ## Stargazers diff --git a/README_CN.md b/README_CN.md index ef901439f..7502121cd 100644 --- a/README_CN.md +++ b/README_CN.md @@ -16,9 +16,13 @@
Languages: 中文 [English](README.md) - -如果觉得 Chat2DB 对您有帮助的话,请帮忙github star -的右上角点个⭐ Star 和 Fork,您的支持是 Chat2DB 变得更好最大的动力 + + 官网:[Chat2DB](https://sqlgpt.cn/zh) + +
+ 如果觉得 Chat2DB 对您有帮助的话,请帮忙github star + 的右上角点个⭐ Star 和 Fork,您的支持是 Chat2DB 变得更好最大的动力 +
@@ -50,9 +54,7 @@ https://github.com/chat2db/Chat2DB/assets/22975773/b58db908-5768-4a71-aa30-135d2 [GitHub下载安装包](https://github.com/chat2db/Chat2DB/releases) -或 - -[官网下载安装包](https://sqlgpt.cn/docs/guides/download) +[官网下载安装包](https://sqlgpt.cn) ## 🚀 支持的数据库 @@ -62,7 +64,7 @@ Chat2DB 支持的数据库连接有: - H2 - Oracle - SQLServer -- SQLLite +- SQLite - MariaDB - ClickHouseare - DM @@ -72,7 +74,7 @@ Chat2DB 支持的数据库连接有: - Hive - KingBase -Redis and MongoDB are partially supported , Hbase、Elasticsearch、openGauss、TiDB、InfluxDB will support in the future. +Redis和MongoDB得到部分支持,Hbase、Elasticsearch、openGauss、TiDB、InfluxDB将在未来得到支持。 ## 🌰 使用 Demo @@ -85,31 +87,17 @@ Redis and MongoDB are partially supported , Hbase、Elasticsearch、openGauss、 -### SQL 控制台 及 AI 智能助手 - -#### 使用前需要配置 OpenAI 的 Api Key 及本地代理配置 - - - - -## 🔥 AI 配置 +### SQL 控制台 -### 使用 ChatGPT +2 -方式一(推荐):使用 OPENAI 的 ChatSql 功能需要满足两个条件 +### AI 智能助手 -- 1、需要有一个 openAI 的 key:OPENAI_API_KEY -- 2、客户端网络可以连接到 OPENAI 官网,国内需要科学上网。注意:如果本地 VPN 未能全局生效,可以通过在客户端中设置网络代理 HOST 和 PORT 来保证网络连通性 -- +![image](https://github.com/chat2db/Chat2DB/assets/22975773/2dfc4aaa-c5a3-42c3-bc61-28ebc237a27b) -方式二(推荐):使用我们提供了一个统一的代理服务。 +## 🔥 AI -- 1、不需要 openAI 的 key -- 2、不需要代理,不需要 VPN 只要可以联网即可使用。 - -为了方便大家更快速的使用 AI 的能力,可以关注微信公众号,回复"AI" 获得我们的自定义 API_KEY,申请完成之后参考下图进行配置即可进行使用 - - +### 使用Chat2DB AI 上手即用 ### 使用自定义大模型 - [参考这里部署本地ChatGLM-6B模型](https://github.com/chat2db/chat2db-chatglm-6b-deploy/blob/main/README_CN.md) @@ -163,9 +151,15 @@ $ cd chat2db-server/chat2db-server-start/target/ $ java -jar -Dloader.path=./lib -Dchatgpt.apiKey=xxxxx chat2db-server-start.jar # 需要安装java 17以上版本,启动应用 chatgpt.apiKey 需要输入ChatGPT的key,如果不输入无法使用AIGC功能 ``` +- 如果你需要独立部署 +```bash +$ npm run build:web:prod / 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 +# 再打包后端服务 +``` + ## 📑 文档 -- 官方文档 +- 官方文档 - Issue ## 常见问题 diff --git a/chat2db-client/src/components/Console/ChatInput/index.tsx b/chat2db-client/src/components/Console/ChatInput/index.tsx index dbb9d858d..08a846b6b 100644 --- a/chat2db-client/src/components/Console/ChatInput/index.tsx +++ b/chat2db-client/src/components/Console/ChatInput/index.tsx @@ -6,7 +6,6 @@ import i18n from '@/i18n/'; import Iconfont from '@/components/Iconfont'; import { WarningOutlined } from '@ant-design/icons'; import { AiSqlSourceType, IRemainingUse } from '@/typings/ai'; -import { WECHAT_MP_URL } from '@/constants/social'; export const enum SyncModelType { AUTO = 0, diff --git a/chat2db-client/src/components/Console/MonacoEditor/index.tsx b/chat2db-client/src/components/Console/MonacoEditor/index.tsx index 38682808b..296fc3c67 100644 --- a/chat2db-client/src/components/Console/MonacoEditor/index.tsx +++ b/chat2db-client/src/components/Console/MonacoEditor/index.tsx @@ -2,7 +2,9 @@ import React, { ForwardedRef, forwardRef, useEffect, useImperativeHandle, useRef import cs from 'classnames'; import { useTheme } from '@/hooks'; import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'; -import { editorDefaultOptions, EditorThemeType, ThemeType } from '@/constants'; +import { DatabaseTypeCode, editorDefaultOptions, EditorThemeType, ThemeType } from '@/constants'; +import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput'; + import styles from './index.less'; export type IEditorIns = monaco.editor.IStandaloneCodeEditor; @@ -14,6 +16,12 @@ export type IAppendValue = { range?: IRangeType; }; +const databaseTypeList = Object.keys(DatabaseTypeCode).map((d) => ({ + type: d, + id: d, + label: d, +})); + interface IProps { id: string; isActive?: boolean; @@ -21,7 +29,7 @@ interface IProps { className?: string; options?: IEditorOptions; needDestroy?: boolean; - addAction?: Array<{ id: string; label: string; action: (selectedText: string) => void }>; + addAction?: Array<{ id: string; label: string; action: (selectedText: string, ext?: string) => void }>; defaultValue?: string; appendValue?: IAppendValue; // onChange?: (v: string, e?: IEditorContentChangeEvent) => void; @@ -51,6 +59,7 @@ function MonacoEditor(props: IProps, ref: ForwardedRef) { appendValue, } = props; const editorRef = useRef(); + const quickInputCommand = useRef(); const [appTheme] = useTheme(); // init @@ -65,6 +74,13 @@ function MonacoEditor(props: IProps, ref: ForwardedRef) { editorRef.current = editorIns; didMount && didMount(editorIns); + // Add a new command, for getting an accessor. + quickInputCommand.current = editorIns.addCommand(0, (accessor, func) => { + // a hacker way to get the input service + const quickInputService = accessor.get(IQuickInputService); + func(quickInputService); + }); + const { colorPrimary } = window._AppThemePack; const colors = { 'editor.lineHighlightBackground': colorPrimary + '14', // 当前行背景色 @@ -239,9 +255,18 @@ function MonacoEditor(props: IProps, ref: ForwardedRef) { contextMenuGroupId: 'navigation', contextMenuOrder: 1.5, // 点击该菜单键后运行 - run: () => { + run: (ed: IEditorIns) => { const selectedText = editor.getModel()?.getValueInRange(editor.getSelection()!) || ''; - runFn(selectedText); + if (_id === 'changeSQL') { + ed.trigger('', quickInputCommand.current, (quickInput) => { + quickInput.pick(databaseTypeList).then((selected) => { + console.log(selected); + runFn(selectedText, selected?.label); + }); + }); + } else { + runFn(selectedText); + } }, }); }); diff --git a/chat2db-client/src/components/Console/index.tsx b/chat2db-client/src/components/Console/index.tsx index 2eb830ba1..4f17a1480 100644 --- a/chat2db-client/src/components/Console/index.tsx +++ b/chat2db-client/src/components/Console/index.tsx @@ -21,7 +21,6 @@ import configService from '@/service/config'; // import NewEditor from './NewMonacoEditor'; import styles from './index.less'; import indexedDB from '@/indexedDB'; -import { isEmpty } from 'lodash'; enum IPromptType { NL_2_SQL = 'NL_2_SQL', @@ -134,20 +133,7 @@ function Console(props: IProps, ref: ForwardedRef) { editorRef: editorRef?.current, })); - useEffect(() => { - indexedDB - .getDataByCursor('chat2db', 'workspaceConsoleDDL', { - consoleId: executeParams.consoleId!, - userId: getCookie('CHAT2DB.USER_ID'), - }) - .then((res: any) => { - const value = res?.[0]?.ddl || ''; - if (value) { - editorRef?.current?.setValue(value, 'reset'); - initializeSuccessful.current = true; - } - }); - }, []); + useEffect(() => {}, []); useEffect(() => { if (source !== 'workspace') { @@ -166,7 +152,19 @@ function Console(props: IProps, ref: ForwardedRef) { } } else { // 活跃时自动保存 - timingAutoSave(); + indexedDB + .getDataByCursor('chat2db', 'workspaceConsoleDDL', { + consoleId: executeParams.consoleId!, + userId: getCookie('CHAT2DB.USER_ID'), + }) + .then((res: any) => { + const value = res?.[0]?.ddl || ''; + if (value) { + editorRef?.current?.setValue(value, 'reset'); + initializeSuccessful.current = true; + timingAutoSave(); + } + }); } return () => { if (timerRef.current) { @@ -176,10 +174,6 @@ function Console(props: IProps, ref: ForwardedRef) { }, [isActive]); function timingAutoSave() { - // 如果没有初始化那就不自动保存 - if (!initializeSuccessful.current) { - return; - } timerRef.current = setInterval(() => { indexedDB.updateData('chat2db', 'workspaceConsoleDDL', { consoleId: executeParams.consoleId!, @@ -242,12 +236,12 @@ function Console(props: IProps, ref: ForwardedRef) { } }; - const handleAIChatInEditor = async (content: string, promptType: IPromptType) => { + const handleAIChatInEditor = async (content: string, promptType: IPromptType, ext?: string) => { const aiConfig = await configService.getAiSystemConfig({}); - handleAiChat(content, promptType, aiConfig); + handleAiChat(content, promptType, aiConfig, ext); }; - const handleAiChat = async (content: string, promptType: IPromptType, aiConfig?: IAiConfig) => { + const handleAiChat = async (content: string, promptType: IPromptType, aiConfig?: IAiConfig, ext?: string) => { const { apiKey } = aiConfig || props.aiModel?.aiConfig || {}; if (!apiKey && isChat2DBAI) { handleApiKeyEmptyOrGetQrCode(true); @@ -270,6 +264,7 @@ function Console(props: IProps, ref: ForwardedRef) { databaseName, schemaName, tableNames: syncTableModel ? selectedTables : null, + ext, }); const handleMessage = (message: string) => { @@ -402,7 +397,9 @@ function Console(props: IProps, ref: ForwardedRef) { { id: 'changeSQL', label: i18n('common.text.conversionSQL'), - action: (selectedText: string) => handleAIChatInEditor(selectedText, IPromptType.SQL_2_SQL), + action: (selectedText: string, ext?: string) => { + handleAIChatInEditor(selectedText, IPromptType.SQL_2_SQL, ext); + }, }, ]; diff --git a/chat2db-client/src/components/SearchResult/TableBox/index.less b/chat2db-client/src/components/SearchResult/TableBox/index.less index df6101022..98bcda841 100644 --- a/chat2db-client/src/components/SearchResult/TableBox/index.less +++ b/chat2db-client/src/components/SearchResult/TableBox/index.less @@ -61,6 +61,13 @@ .art-table-row{ height: 32px; } + .art-table-header { + background: transparent !important; + overflow: hidden !important; + } + .art-table-body-scroll{ + padding-right: 6px; + } .art-table-header-cell{ padding: 0px 4px; } @@ -148,22 +155,32 @@ } .tableItem { - height: 100%; + height: 30px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; position: relative; padding-left: 4px; - overflow: hidden; user-select: none; background-color: var(--color-bg-base); + + .tableItemContent{ + overflow: hidden; + max-height: 30px; + line-height: 30px; + flex: 1; + &:hover{ + overflow: auto; + line-height: 16px; + } + } + &:hover { .tableHoverBox{ display: flex; } - overflow: auto; } .cellValueNull{ diff --git a/chat2db-client/src/components/SearchResult/TableBox/index.tsx b/chat2db-client/src/components/SearchResult/TableBox/index.tsx index 4b08195be..fee45de1f 100644 --- a/chat2db-client/src/components/SearchResult/TableBox/index.tsx +++ b/chat2db-client/src/components/SearchResult/TableBox/index.tsx @@ -120,6 +120,25 @@ export default function TableBox(props: ITableProps) { }); }, [queryResultData]); + // 判断art-table-body是否出现了滚动条 + // useEffect(() => { + // const tableBody = document.querySelector('.art-table-body'); + // const tableHeader = document.querySelector('.art-table-header'); + // if (!tableBody) { + // return; + // } + // const tableBodyHeight = tableBody.clientHeight; + // const tableBoxHeight = tableBoxRef.current?.clientHeight || 0; + // if(!tableHeader){ + // return; + // } + // if (tableBodyHeight > tableBoxHeight) { + // tableHeader.classList.add('art-table-body-scroll'); + // } else { + // tableHeader.classList.remove('art-table-body-scroll'); + // } + // }, [tableData]); + useEffect(() => { // 每次dataList变化,都需要重新计算tableData if (!columns?.length) { @@ -374,7 +393,9 @@ export default function TableBox(props: ITableProps) { /> ) : ( <> - {renderTableCellValue(value)} +
+ {renderTableCellValue(value)} +
@@ -401,7 +422,11 @@ export default function TableBox(props: ITableProps) { // sorts, // onChangeSorts, }), - ); + ) + .use(features.columnResize({ + fallbackSize: 120, + handleActiveBackground: `var(--color-primary-bg-hover)`, + })); // .use( // features.columnResize({ // fallbackSize: 120, diff --git a/chat2db-client/src/components/ShortcutKey/index.tsx b/chat2db-client/src/components/ShortcutKey/index.tsx index 99442020e..4e18c321f 100644 --- a/chat2db-client/src/components/ShortcutKey/index.tsx +++ b/chat2db-client/src/components/ShortcutKey/index.tsx @@ -31,10 +31,6 @@ const shortcutsList = [ title: i18n('common.text.optimizeSQL'), keys: [i18n('common.text.editorRightClick')], }, - { - title: i18n('common.text.executeSelectedSQL'), - keys: [keyboardKey.command, 'Enter'], - }, { title: i18n('common.text.executeSelectedSQL'), keys: [keyboardKey.command, 'R'], diff --git a/chat2db-client/src/constants/social.ts b/chat2db-client/src/constants/social.ts deleted file mode 100644 index e44168542..000000000 --- a/chat2db-client/src/constants/social.ts +++ /dev/null @@ -1 +0,0 @@ -export const WECHAT_MP_URL = 'https://oss-chat2db.alibaba.com/static/wechat.webp'; diff --git a/chat2db-client/src/i18n/en-us/common.ts b/chat2db-client/src/i18n/en-us/common.ts index 182121d9b..fd1387383 100644 --- a/chat2db-client/src/i18n/en-us/common.ts +++ b/chat2db-client/src/i18n/en-us/common.ts @@ -92,4 +92,6 @@ export default { 'common.button.executionError': 'Execution Error', 'common.text.affectedRows': 'Affected rows: {1}', 'common.text.selectFile' : 'Select File', + 'common.text.noTableFoundUp' : 'No tables in this database', + 'common.text.noTableFoundDown' : 'Switch databases at the top' }; diff --git a/chat2db-client/src/i18n/zh-cn/common.ts b/chat2db-client/src/i18n/zh-cn/common.ts index 971a3aae8..770848652 100644 --- a/chat2db-client/src/i18n/zh-cn/common.ts +++ b/chat2db-client/src/i18n/zh-cn/common.ts @@ -90,4 +90,6 @@ export default { 'common.button.executionError': '执行错误', 'common.text.affectedRows': '受影响行:{1}', 'common.text.selectFile' : '选择文件', + 'common.text.noTableFoundUp' : '当前库没有查询到表', + 'common.text.noTableFoundDown' : '你可以在顶部切换数据库' }; diff --git a/chat2db-client/src/pages/main/workspace/components/TableList/index.less b/chat2db-client/src/pages/main/workspace/components/TableList/index.less index f897ee7b8..fb2b8d336 100644 --- a/chat2db-client/src/pages/main/workspace/components/TableList/index.less +++ b/chat2db-client/src/pages/main/workspace/components/TableList/index.less @@ -10,7 +10,7 @@ .leftModuleTitle { flex-shrink: 0; margin-bottom: 4px; - padding: 0px 10px; + padding: 4px 10px; .leftModuleTitleText { // 下阴影 display: flex; @@ -62,6 +62,22 @@ box-shadow: 0px 1px 2px 0px var(--color-border); } +.emptyBox{ + display: flex; + flex-direction: column; + align-items: center; + height: 100%; + width: 80%; + margin: 0 auto; + padding-top: 40px; + box-sizing: border-box; + color: var(--color-text-quaternary); + >div{ + text-align: center; + line-height: 20px; + } +} + .treeBox { flex: 1; height: 0; diff --git a/chat2db-client/src/pages/main/workspace/components/TableList/index.tsx b/chat2db-client/src/pages/main/workspace/components/TableList/index.tsx index 38605a080..b3e9ed182 100644 --- a/chat2db-client/src/pages/main/workspace/components/TableList/index.tsx +++ b/chat2db-client/src/pages/main/workspace/components/TableList/index.tsx @@ -235,6 +235,7 @@ const TableList = dvaModel((props: any) => { useEffect(() => { setCurList([]); + setPagingData(defaultPaddingData); if (isReady) { setCurType({ ...optionsList[0] }); } @@ -367,6 +368,7 @@ const TableList = dvaModel((props: any) => { const handleChangePageSize = (value: number) => { setPagingData({ ...pagingData, + pageNo: 1, pageSize: value, }); }; @@ -439,7 +441,15 @@ const TableList = dvaModel((props: any) => {
- + { + (curType.value === TreeNodeType.TABLES && !curList.length) ? +
+
{i18n('common.text.noTableFoundUp')}
+
{i18n('common.text.noTableFoundDown')}
+
+ : + + }
diff --git a/chat2db-client/src/pages/main/workspace/components/WorkspaceLeft/index.less b/chat2db-client/src/pages/main/workspace/components/WorkspaceLeft/index.less index f3e578060..5ceea91b3 100644 --- a/chat2db-client/src/pages/main/workspace/components/WorkspaceLeft/index.less +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceLeft/index.less @@ -14,5 +14,5 @@ } .divider { - margin: 0px 0px 10px; + margin: 0px; } 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 a59e47835..8353c8e3c 100644 --- a/chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.tsx +++ b/chat2db-client/src/pages/main/workspace/components/WorkspaceRight/index.tsx @@ -3,7 +3,7 @@ import { connect } from 'umi'; import i18n from '@/i18n'; import styles from './index.less'; import classnames from 'classnames'; -import { ConsoleOpenedStatus, ConsoleStatus, TreeNodeType, WorkspaceTabType, workspaceTabConfig } from '@/constants'; +import { ConsoleOpenedStatus, ConsoleStatus, OSType, TreeNodeType, WorkspaceTabType, workspaceTabConfig } from '@/constants'; import historyService from '@/service/history'; import sqlService from '@/service/sql'; import TabsNew, { ITabItem } from '@/components/TabsNew'; @@ -26,6 +26,7 @@ import { registerIntelliSenseTable, } from '@/utils/IntelliSense'; import indexedDB from '@/indexedDB'; +import { osNow } from '@/utils'; interface IProps { className?: string; @@ -69,8 +70,15 @@ const WorkspaceRight = memo((props: IProps) => { // 注册快捷键command+shift+L新建console useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - if (e.metaKey && e.shiftKey && e.code === 'KeyL') { - addConsole(); + // 如果是mac系统 + if(osNow().isMac){ + if (e.metaKey && e.shiftKey && e.code === 'KeyL') { + addConsole(); + } + }else{ + if (e.ctrlKey && e.shiftKey && e.code === 'KeyL') { + addConsole(); + } } }; window.addEventListener('keydown', handleKeyDown); diff --git a/chat2db-client/src/service/base.ts b/chat2db-client/src/service/base.ts index 4d7d26ae6..c9889b778 100644 --- a/chat2db-client/src/service/base.ts +++ b/chat2db-client/src/service/base.ts @@ -40,7 +40,7 @@ enum ErrorCode { const noNeedToastErrorCode = [ErrorCode.NEED_LOGGED_IN]; // yapi mock地址 -const mockUrl = 'https://yapi.alibaba.com/mock/1000160'; +const mockUrl = 'https://yapi.com/mock/1000160'; // 桌面端的服务器地址 const desktopServiceUrl = `http://127.0.0.1:${__APP_PORT__ || '10824'}`; diff --git a/chat2db-client/src/styles/global.less b/chat2db-client/src/styles/global.less index 1fc431b5c..fee203c5e 100644 --- a/chat2db-client/src/styles/global.less +++ b/chat2db-client/src/styles/global.less @@ -18,8 +18,8 @@ input:-webkit-autofill { } ::-webkit-scrollbar { - width: 4px; - height: 4px; + width: 6px; + height: 6px; } diff --git a/chat2db-server/README.md b/chat2db-server/README.md index 6b892e903..5f51e53ad 100644 --- a/chat2db-server/README.md +++ b/chat2db-server/README.md @@ -1,6 +1,5 @@ # 内部协作规范 ## 接口规范 -统一使用yapi,空间地址: https://yapi.alibaba.com/project/1000160/interface/api 不会使用的参照:https://yuque.antfin-inc.com/docs/share/8a5ff21a-6367-4c77-9e3c-1d5ae9570060?# 《yapi》 ## 国际化处理方案 * 在`messages.properties` 文件下新增code diff --git a/chat2db-server/chat2db-server-start/src/main/resources/thymeleaf/index.html b/chat2db-server/chat2db-server-start/src/main/resources/thymeleaf/index.html deleted file mode 100644 index 9d238cfc2..000000000 --- a/chat2db-server/chat2db-server-start/src/main/resources/thymeleaf/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - -Chat2DB - - - - - -
- - - \ No newline at end of file