Skip to content

Commit e827bab

Browse files
authored
Merge pull request #862 from chat2db/dev
Dev
2 parents 2db1a2e + c248369 commit e827bab

File tree

36 files changed

+259
-92
lines changed

36 files changed

+259
-92
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## 3.0.14
2+
3+
`2023-11-20`
4+
5+
**Changelog**
6+
7+
- 🐞【Fixed】Team paging problem
8+
- 🐞【Fixed】Oracle service name bug
9+
- 🐞【Fixed】Oracle datatype error
10+
- 🐞【Fixed】Fixed an issue where MySQL changed table structure without displaying comments.
11+
- ⚡️【Optimize】Support database or schema
12+
- 【Developer】Friends don't worry, the company has some things recently, and is preparing 3.1.0, be patient
13+
114
## 3.0.13
215

316
`2023-11-15`

CHANGELOG_CN.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## 3.0.14
2+
3+
`2023-11-20`
4+
5+
**更新日志**
6+
7+
- 🐞【修复】团队分页问题
8+
- 🐞【修复】Oracle服务名称错误
9+
- 🐞【修复】Oracle数据类型错误
10+
- 🐞【修复】修复MySQL修改表结构,不回显注释的问题。
11+
- ⚡️【优化】支持数据库或模式
12+
- 【开发者】友友们不要着急呀,最近公司有些事情,并且在准备3.1.0,耐心等待哦
113
## 3.0.13
214

315
`2023-11-15`

chat2db-client/src/components/ConnectionEdit/config/dataSource.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -450,8 +450,8 @@ export const dataSourceFormConfigs: IConnectionConfig[] = [
450450
},
451451
}],
452452
onChange: (data: IConnectionConfig) => {
453-
data.baseInfo.pattern = /jdbc:oracle:(.*):@\/\/(.*):(\d+):(.*)/;
454-
data.baseInfo.template = 'jdbc:oracle:{driver}:@//{host}:{port}:{serviceName}';
453+
data.baseInfo.pattern = /jdbc:oracle:(.*):@\/\/(.*):(\d+)\/(.*)/;
454+
data.baseInfo.template = 'jdbc:oracle:{driver}:@//{host}:{port}/{serviceName}';
455455
return data
456456
}
457457
},
@@ -470,15 +470,17 @@ export const dataSourceFormConfigs: IConnectionConfig[] = [
470470
labelTextAlign: 'right',
471471
selects: [
472472
{
473-
value: 'thin',
473+
value: 'THIN',
474+
label: 'thin',
474475
},
475476
{
476-
477-
value: 'oci',
477+
value: 'OCI',
478+
label: 'oci',
478479
},
479480
{
480481

481-
value: 'oci8',
482+
value: 'OCI8',
483+
label: 'oci8',
482484
},
483485
],
484486
styles: {

chat2db-client/src/pages/main/team/datasource-management/index.tsx

Lines changed: 43 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useEffect, useMemo, useRef, useState } from 'react';
22
import { Button, Input, Table, Popconfirm, message, Drawer } from 'antd';
33
import { SearchOutlined, PlusOutlined } from '@ant-design/icons';
4-
import ConnectionServer from '@/service/connection'
4+
import ConnectionServer from '@/service/connection';
55
import { createDataSource, deleteDataSource, getDataSourceList, updateDataSource } from '@/service/team';
66
import { IConnectionDetails } from '@/typings';
77
import { AffiliationType, IDataSourceVO } from '@/typings/team';
@@ -23,13 +23,13 @@ function DataSourceManagement() {
2323
showQuickJumper: true,
2424
// pageSizeOptions: ['10', '20', '30', '40'],
2525
});
26-
const [showCreateConnection, setShowCreateConnection] = useState(false)
26+
const [showCreateConnection, setShowCreateConnection] = useState(false);
2727
const connectionInfo = useRef<IConnectionDetails>();
2828

2929
const [drawerInfo, setDrawerInfo] = useState<{ open: boolean; type: AffiliationType; id?: number }>({
3030
open: false,
31-
type: AffiliationType['DATASOURCE_USER/TEAM']
32-
})
31+
type: AffiliationType['DATASOURCE_USER/TEAM'],
32+
});
3333

3434
const columns = useMemo(
3535
() => [
@@ -49,18 +49,24 @@ function DataSourceManagement() {
4949
width: 300,
5050
render: (_: any, record: IDataSourceVO) => (
5151
<>
52-
<Button type='link' onClick={() => {
53-
handleEdit(record)
54-
}}>
52+
<Button
53+
type="link"
54+
onClick={() => {
55+
handleEdit(record);
56+
}}
57+
>
5558
{i18n('common.button.edit')}
5659
</Button>
57-
<Button type='link' onClick={() => {
58-
setDrawerInfo({
59-
...drawerInfo,
60-
open: true,
61-
id: record.id,
62-
})
63-
}}>
60+
<Button
61+
type="link"
62+
onClick={() => {
63+
setDrawerInfo({
64+
...drawerInfo,
65+
open: true,
66+
id: record.id,
67+
});
68+
}}
69+
>
6470
{i18n('team.action.rightManagement')}
6571
</Button>
6672
<Popconfirm
@@ -89,6 +95,10 @@ function DataSourceManagement() {
8995
let res = await getDataSourceList({ searchKey, pageNo, pageSize });
9096
if (res) {
9197
setDataSource(res?.data ?? []);
98+
setPagination({
99+
...pagination,
100+
total: res?.total ?? 0,
101+
} as any);
92102
}
93103
};
94104

@@ -100,7 +110,6 @@ function DataSourceManagement() {
100110
};
101111

102112
const handleTableChange = (p: any) => {
103-
104113
setPagination({
105114
...pagination,
106115
...p,
@@ -110,22 +119,22 @@ function DataSourceManagement() {
110119
const handleAddDataSource = () => {
111120
connectionInfo.current = undefined;
112121
setShowCreateConnection(true);
113-
}
122+
};
114123

115124
const handleEdit = async (record: IDataSourceVO) => {
116125
const { id } = record;
117126
if (!id) {
118127
return;
119128
}
120129

121-
let detail = await ConnectionServer.getDetails({ id })
130+
let detail = await ConnectionServer.getDetails({ id });
122131
connectionInfo.current = detail;
123-
setShowCreateConnection(true)
124-
}
132+
setShowCreateConnection(true);
133+
};
125134

126135
const handleDelete = async (id?: number) => {
127136
if (isNumber(id)) {
128-
await deleteDataSource({ id })
137+
await deleteDataSource({ id });
129138
message.success(i18n('common.text.successfullyDelete'));
130139
queryDataSourceList();
131140
}
@@ -140,14 +149,12 @@ function DataSourceManagement() {
140149
const isUpdate = isValid(connectionInfo?.current?.id);
141150
const requestApi = isUpdate ? updateDataSource : createDataSource;
142151
try {
143-
await requestApi({ ...connectionInfo.current })
144-
message.success(isUpdate ? i18n('common.tips.updateSuccess') : i18n('common.tips.createSuccess'))
145-
setShowCreateConnection(false)
146-
queryDataSourceList()
147-
} catch {
148-
149-
}
150-
}
152+
await requestApi({ ...connectionInfo.current });
153+
message.success(isUpdate ? i18n('common.tips.updateSuccess') : i18n('common.tips.createSuccess'));
154+
setShowCreateConnection(false);
155+
queryDataSourceList();
156+
} catch {}
157+
};
151158

152159
return (
153160
<div>
@@ -163,6 +170,11 @@ function DataSourceManagement() {
163170
</Button>
164171
</div>
165172
<Table
173+
style={{
174+
maxHeight: '82vh',
175+
overflow: 'auto',
176+
}}
177+
sticky
166178
rowKey={'id'}
167179
dataSource={dataSource}
168180
columns={columns}
@@ -185,11 +197,11 @@ function DataSourceManagement() {
185197
onClose={() => {
186198
setDrawerInfo({
187199
...drawerInfo,
188-
open: false
189-
})
200+
open: false,
201+
});
190202
}}
191203
/>
192-
</div >
204+
</div>
193205
);
194206
}
195207

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
.teamWrapper {
22
height: 100vh;
3-
padding: 24px 36px;
3+
padding: 14px 16px;
4+
box-sizing: border-box;
5+
}
6+
7+
.teamTabsBox{
8+
height: 100%;
49
}

chat2db-client/src/pages/main/team/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const Team = () => {
3333
return (
3434
<div className={styles.teamWrapper}>
3535
<Tabs
36+
className={styles.teamTabsBox}
3637
activeKey={activeKey}
3738
onChange={(activeKey) => setActiveKey(activeKey)}
3839
items={tabList.map((tab, index) => {

chat2db-client/src/pages/main/team/team-management/index.tsx

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const requireRule = { required: true, message: i18n('common.form.error.required'
1717

1818
function TeamManagement() {
1919
const [form] = Form.useForm();
20-
const [loadding, setLoading] = useState(false)
20+
const [loadding, setLoading] = useState(false);
2121
const [dataSource, setDataSource] = useState<ITeamVO[]>([]);
2222
const [pagination, setPagination] = useState({
2323
searchKey: '',
@@ -66,7 +66,7 @@ function TeamManagement() {
6666
...drawerInfo,
6767
open: true,
6868
teamId: record.id,
69-
type: AffiliationType.TEAM_USER
69+
type: AffiliationType.TEAM_USER,
7070
});
7171
}}
7272
>
@@ -79,9 +79,10 @@ function TeamManagement() {
7979
...drawerInfo,
8080
open: true,
8181
teamId: record.id,
82-
type: AffiliationType.TEAM_DATASOURCE
82+
type: AffiliationType.TEAM_DATASOURCE,
8383
});
84-
}}>
84+
}}
85+
>
8586
{i18n('team.action.affiliation.datasource')}
8687
</Button>
8788
<Popconfirm
@@ -112,11 +113,14 @@ function TeamManagement() {
112113
let res = await getTeamManagementList({ searchKey, pageNo, pageSize });
113114
if (res) {
114115
setDataSource(res?.data ?? []);
116+
setPagination({
117+
...pagination,
118+
total: res?.total ?? 0,
119+
} as any);
115120
}
116121
} catch (error) {
117-
118122
} finally {
119-
setLoading(false)
123+
setLoading(false);
120124
}
121125
};
122126

@@ -169,6 +173,11 @@ function TeamManagement() {
169173
</Button>
170174
</div>
171175
<Table
176+
style={{
177+
maxHeight: '82vh',
178+
overflow: 'auto',
179+
}}
180+
sticky
172181
rowKey={'id'}
173182
loading={loadding}
174183
dataSource={dataSource}
@@ -192,7 +201,7 @@ function TeamManagement() {
192201
.catch((errorInfo) => {
193202
form.scrollToField(errorInfo.errorFields[0].name);
194203
form.setFields(errorInfo.errorFields);
195-
})
204+
});
196205
}}
197206
onCancel={() => {
198207
form.resetFields();

chat2db-client/src/pages/main/team/user-management/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ function UserManagement() {
116116
let res = await getUserManagementList({ searchKey, pageNo, pageSize });
117117
if (res) {
118118
setDataSource(res?.data ?? []);
119+
setPagination({
120+
...pagination,
121+
total: res?.total ?? 0,
122+
} as any);
119123
}
120124
};
121125

@@ -178,6 +182,11 @@ function UserManagement() {
178182
</Button>
179183
</div>
180184
<Table
185+
style={{
186+
maxHeight: '82vh',
187+
overflow: 'auto',
188+
}}
189+
sticky
181190
rowKey={'id'}
182191
dataSource={dataSource}
183192
columns={columns}

chat2db-client/src/service/connection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const downloadDriver = createRequest<{ dbType: string }, void>('/api/jdbc/driver
8080
method: 'get',
8181
});
8282

83-
const saveDriver = createRequest<IUploadDriver, void>('/api/jdbc/driver/save', { errorLevel: false, method: 'post' });
83+
const saveDriver = createRequest<IUploadDriver, void>('/api/jdbc/driver/save', { method: 'post' });
8484

8585
const getEnvList = createRequest<void, IConnectionEnv[]>('/api/common/environment/list_all', { errorLevel: false });
8686

chat2db-server/chat2db-plugins/chat2db-clickhouse/src/main/java/ai/chat2db/plugin/clickhouse/clickhouse.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"dbType": "CLICKHOUSE",
3+
"supportDatabase": false,
4+
"supportSchema": false,
35
"driverConfigList": [
46
{
57
"url": "jdbc:clickhouse://localhost:8123/",

0 commit comments

Comments
 (0)