Skip to content

Commit 4ef1a8f

Browse files
committed
refactor-workspace
1 parent f6a96b8 commit 4ef1a8f

58 files changed

Lines changed: 738 additions & 467 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"alicdn",
66
"aliyuncs",
77
"altool",
8+
"andale",
89
"antd",
910
"asar",
1011
"AZUREAI",
@@ -14,6 +15,7 @@
1415
"charsets",
1516
"chmod",
1617
"CLOB",
18+
"Consolas",
1719
"Datas",
1820
"datasource",
1921
"Datetime",
@@ -36,8 +38,10 @@
3638
"indexs",
3739
"jdbc",
3840
"kingbase",
41+
"lucida",
3942
"macos",
4043
"Mddhhmmss",
44+
"Menlo",
4145
"mkdir",
4246
"monaco",
4347
"msgtype",
@@ -48,6 +52,7 @@
4852
"ossutil",
4953
"partialize",
5054
"pgsql",
55+
"plsql",
5156
"pnpm",
5257
"Popconfirm",
5358
"Prec",
@@ -58,12 +63,15 @@
5863
"samuelmeuli",
5964
"scroller",
6065
"Sercurity",
66+
"singlestoredb",
6167
"sortablejs",
6268
"SQLSERVER",
6369
"temurin",
6470
"thymeleaf",
6571
"Tigger",
6672
"togglefullscreen",
73+
"transactsql",
74+
"trino",
6775
"umijs",
6876
"umirc",
6977
"USERANDPASSWORD",

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
**更新日志**
66

77
- 🐞【Fixed】Copy as insert first row lost problem
8+
- 🐞【Fixed】DM database index bug
9+
- 🐞【Fixed】Point Garbled code problem
10+
- 🐞【Fixed】MariaDB connec database bug
11+
- 🐞【Fixed】Issues 792 NullPointerException
12+
- 🐞【Fixed】Kingbase8r6 error
813

914

1015
## 3.0.11

CHANGELOG_CN.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
**更新日志**
66

77
- 🐞【修复】复制为insert第一行丢失问题
8+
- 🐞【修复】达梦数据库index问题
9+
- 🐞【修复】Point 乱码问题
10+
- 🐞【修复】MariaDB连接数据库错误
11+
- 🐞【修复】#792 NullPointerException
12+
- 🐞【修复】Kingbase8r6 错误
813

914

1015
## 3.0.11

chat2db-client/src/blocks/SQLExecute/index.tsx

Lines changed: 34 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,71 @@
1-
import React, { memo, useRef, createContext } from 'react';
1+
import React, { memo, useRef, useState } from 'react';
22
import styles from './index.less';
33
import classnames from 'classnames';
44
import DraggableContainer from '@/components/DraggableContainer';
55
import ConsoleEditor, { IConsoleRef } from '@/components/ConsoleEditor';
66
import SearchResult, { ISearchResultRef } from '@/components/SearchResult';
7-
import { DatabaseTypeCode } from '@/constants';
7+
import { DatabaseTypeCode, ConsoleStatus } from '@/constants';
88
import { useUpdateEffect } from '@/hooks/useUpdateEffect';
99
interface IProps {
1010
boundInfo: {
1111
databaseName: string;
1212
dataSourceId: number;
1313
type: DatabaseTypeCode;
1414
schemaName?: string;
15+
consoleId: number;
16+
status: ConsoleStatus;
1517
};
1618
initDDL: string;
17-
consoleId: number;
1819
}
1920

2021
interface IContext {
21-
boundInfo: {
22+
boundInfoContext: {
2223
databaseName: string;
2324
dataSourceId: number;
2425
type: DatabaseTypeCode;
2526
schemaName?: string;
27+
consoleId: number;
28+
status: ConsoleStatus;
2629
};
27-
consoleId: number;
30+
setBoundInfoContext: (boundInfo: IContext['boundInfoContext']) => void;
2831
}
2932

30-
export const SQLExecuteContext = createContext<IContext>({} as any);
31-
3233
const SQLExecute = memo<IProps>((props) => {
33-
const { boundInfo, initDDL } = props;
34+
const { boundInfo: _boundInfo, initDDL } = props;
3435
const draggableRef = useRef<any>();
3536
const searchResultRef = useRef<ISearchResultRef>(null);
3637
const consoleRef = useRef<IConsoleRef>(null);
38+
const [boundInfo, setBoundInfo] = useState(_boundInfo)
3739

3840
useUpdateEffect(() => {
3941
consoleRef.current?.editorRef?.setValue(initDDL, 'cover');
4042
}, [initDDL]);
4143

4244
return (
43-
<SQLExecuteContext.Provider
44-
value={{
45-
boundInfo,
46-
consoleId: props.consoleId,
47-
}}
48-
>
49-
<div className={classnames(styles.sqlExecute)}>
50-
<DraggableContainer layout="column" className={styles.boxRightCenter}>
51-
<div ref={draggableRef} className={styles.boxRightConsole}>
52-
<ConsoleEditor
53-
ref={consoleRef}
54-
source="workspace"
55-
defaultValue={initDDL}
56-
executeParams={boundInfo}
57-
hasAiChat={true}
58-
hasAi2Lang={true}
59-
onExecuteSQL={(sql) => {
60-
searchResultRef.current?.handleExecuteSQL(sql);
61-
}}
62-
// isActive={isActive}
63-
// onConsoleSave={() => {
64-
// dispatch({
65-
// type: 'workspace/fetchGetSavedConsole',
66-
// payload: {
67-
// status: ConsoleStatus.RELEASE,
68-
// orderByDesc: true,
69-
// ...curWorkspaceParams,
70-
// },
71-
// callback: (res: any) => {
72-
// dispatch({
73-
// type: 'workspace/setConsoleList',
74-
// payload: res.data,
75-
// });
76-
// },
77-
// });
78-
// }}
79-
// tables={curTableList || []}
80-
// remainingUse={aiModel.remainingUse}
81-
/>
82-
</div>
83-
<div className={styles.boxRightResult}>
84-
<SearchResult ref={searchResultRef} executeSqlParams={boundInfo} />
85-
</div>
86-
</DraggableContainer>
87-
</div>
88-
</SQLExecuteContext.Provider>
45+
<div className={classnames(styles.sqlExecute)}>
46+
<DraggableContainer layout="column" className={styles.boxRightCenter}>
47+
<div ref={draggableRef} className={styles.boxRightConsole}>
48+
<ConsoleEditor
49+
ref={consoleRef}
50+
source="workspace"
51+
defaultValue={initDDL}
52+
boundInfo={boundInfo}
53+
setBoundInfo={setBoundInfo}
54+
hasAiChat={true}
55+
hasAi2Lang={true}
56+
onExecuteSQL={(sql) => {
57+
searchResultRef.current?.handleExecuteSQL(sql);
58+
}}
59+
// isActive={isActive}
60+
// tables={curTableList || []}
61+
// remainingUse={aiModel.remainingUse}
62+
/>
63+
</div>
64+
<div className={styles.boxRightResult}>
65+
<SearchResult ref={searchResultRef} executeSqlParams={boundInfo} />
66+
</div>
67+
</DraggableContainer>
68+
</div>
8969
);
9070
});
9171

chat2db-client/src/blocks/Setting/About/index.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
}
99
.brandLogo {
1010
margin-right: 15px;
11+
flex-shrink: 0;
1112
}
1213
.currentVersion {
1314
font-size: 20px;

chat2db-client/src/blocks/Tree/TreeNodeRightClick/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import styles from './index.less';
77
// ----- components -----
88
import { dataSourceFormConfigs } from '@/components/ConnectionEdit/config/dataSource';
99
import { IConnectionConfig } from '@/components/ConnectionEdit/config/types';
10-
import MonacoEditor, { IExportRefFunction } from '@/components/ConsoleEditor/MonacoEditor';
10+
import MonacoEditor, { IExportRefFunction } from '@/components/MonacoEditor';
1111
import MenuLabel from '@/components/MenuLabel';
1212

1313
// ----- constants -----

chat2db-client/src/components/CascaderDB/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import cs from 'classnames';
55
import styles from './index.less';
66
import Iconfont from '../Iconfont';
77
import { databaseMap } from '@/constants/database';
8-
import { registerIntelliSenseDatabase } from '@/utils/IntelliSense';
98

109
interface IProps {
1110
className?: string;

chat2db-client/src/components/ConsoleEditor/ChatInput/index.less renamed to chat2db-client/src/components/ConsoleEditor/components/ChatInput/index.less

File renamed without changes.

chat2db-client/src/components/ConsoleEditor/ChatInput/index.tsx renamed to chat2db-client/src/components/ConsoleEditor/components/ChatInput/index.tsx

File renamed without changes.

chat2db-client/src/components/ConsoleEditor/NewMonacoEditor/index.less renamed to chat2db-client/src/components/ConsoleEditor/components/NewMonacoEditor/index.less

File renamed without changes.

0 commit comments

Comments
 (0)