Skip to content

Commit f8f3e66

Browse files
committed
merge mongo
2 parents 564d74e + f1176af commit f8f3e66

37 files changed

Lines changed: 740 additions & 463 deletions

File tree

chat2db-client/.umirc.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,25 @@ export default defineConfig({
2525
component: '@/layouts/GlobalLayout',
2626
routes: [
2727
{
28-
path: '/',
28+
path: '/connections',
29+
component: 'main',
30+
},
31+
{
32+
path: '/dashboard',
33+
component: 'main',
34+
},
35+
{
36+
path: '/team',
2937
component: 'main',
3038
},
39+
{
40+
path: '/workspace',
41+
component: 'main',
42+
},
43+
{
44+
path: '/',
45+
redirect: '/connections',
46+
},
3147
],
3248
},
3349
],

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

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ interface IProps {
1010
boundInfo: {
1111
databaseName: string;
1212
dataSourceId: number;
13-
type: DatabaseTypeCode;
13+
dataSourceName: string;
14+
databaseType: DatabaseTypeCode;
1415
schemaName?: string;
1516
consoleId: number;
1617
status: ConsoleStatus;
@@ -20,18 +21,6 @@ interface IProps {
2021
loadSQL: () => Promise<string>;
2122
}
2223

23-
interface IContext {
24-
boundInfoContext: {
25-
databaseName: string;
26-
dataSourceId: number;
27-
type: DatabaseTypeCode;
28-
schemaName?: string;
29-
consoleId: number;
30-
status: ConsoleStatus;
31-
};
32-
setBoundInfoContext: (boundInfo: IContext['boundInfoContext']) => void;
33-
}
34-
3524
const SQLExecute = memo<IProps>((props) => {
3625
const { boundInfo: _boundInfo, initDDL, loadSQL } = props;
3726
const draggableRef = useRef<any>();

chat2db-client/src/blocks/Tree/hooks/useGetRightClickMenu.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ export const useGetRightClickMenu = (props: IProps) => {
124124
createConsole({
125125
name: 'create console',
126126
dataSourceId: treeNodeData.extraParams!.dataSourceId!,
127-
type: treeNodeData.extraParams!.databaseType!,
127+
dataSourceName: treeNodeData.extraParams!.dataSourceName!,
128+
databaseType: treeNodeData.extraParams!.databaseType!,
128129
databaseName: treeNodeData.extraParams?.databaseName,
129130
schemaName: treeNodeData.extraParams?.schemaName,
130131
});

chat2db-client/src/blocks/Tree/treeConfig.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export const treeConfig: { [key in TreeNodeType]: ITreeConfigItem } = {
125125
const _extraParams = params.extraParams;
126126
delete params.extraParams;
127127
connectionService
128-
.getDBList(params)
128+
.getDatabaseList(params)
129129
.then((res) => {
130130
const data: ITreeNode[] = res.map((t: any) => {
131131
return {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function CascaderDB(props: IProps) {
102102
if (curDataSourceId === undefined) {
103103
return;
104104
}
105-
const databaseList = await connection.getDBList({
105+
const databaseList = await connection.getDatabaseList({
106106
dataSourceId: curDataSourceId,
107107
});
108108

chat2db-client/src/components/ConnectionEdit/components/Driver/index.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
}
3131
.downloadTextError{
3232
color: var(--color-error-text);
33+
cursor: pointer;
3334
}
3435
.downloadTextLoading{
3536
display: flex;

chat2db-client/src/components/ConsoleEditor/components/OperationLine/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const OperationLine = (props: IProps) => {
2929
sql = editorRef?.current?.getAllContent() || '';
3030
setValueType = 'cover';
3131
}
32-
formatSql(sql, boundInfo.type!).then((res) => {
32+
formatSql(sql, boundInfo.databaseType!).then((res) => {
3333
editorRef?.current?.setValue(res, setValueType);
3434
});
3535
};
@@ -54,9 +54,7 @@ const OperationLine = (props: IProps) => {
5454
{i18n('common.button.format')}
5555
</Button>
5656
</div>
57-
<div>
58-
<SelectBoundInfo setBoundInfo={setBoundInfo} boundInfo={boundInfo} />
59-
</div>
57+
<SelectBoundInfo setBoundInfo={setBoundInfo} boundInfo={boundInfo} />
6058
</div>
6159
);
6260
};
Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1-
.consoleOptionsRight{
1+
.consoleOptionsRight {
22
display: flex;
3+
}
4+
5+
.boundInfoBox {
6+
display: flex;
7+
align-items: center;
8+
padding: 5px 6px 5px 8px;
9+
border-radius: 4px;
10+
cursor: pointer;
11+
12+
.boundInfoName {
13+
margin: 0px 6px 0px 4px;
14+
}
15+
16+
&:hover {
17+
background-color: var(--color-hover-bg);
18+
}
319
}

0 commit comments

Comments
 (0)