Skip to content

Commit 2dc2966

Browse files
committed
Merge branch 'dev' into feat/20231109_Optimize
2 parents 08e4fc2 + fad74a6 commit 2dc2966

29 files changed

Lines changed: 1191 additions & 301 deletions

File tree

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"hljs",
3535
"iconfont",
3636
"jdbc",
37+
"kingbase",
3738
"macos",
3839
"Mddhhmmss",
3940
"mkdir",

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
`2023-11-08`
44

55
**Changelog**
6-
- ⭐【New Features】
6+
7+
- ⭐【New Features】Oracle connections support the Service name mode
8+
- ⭐【New Features】[New function] Edit table data to support batch copy, clone, delete (click 1X1 cell to select/cancel, hold down shift/ctrl/cmd to select multiple)
79
- ⚡️【Optimize】After the update is completed, click restart to close the problem that cannot be automatically opened (hot update cannot fix this problem, you need to download a new version to cover the client)
810
- 🐞【Fixed】database and schema searches support case ambiguity matching
911
- 🐞【Fixed】Where database was not displayed after being added
12+
- 🐞【Fixed】sql formatting to ·now()· format error
1013

1114

1215
## 3.0.10

CHANGELOG_CN.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
`2023-11-08`
44

55
**更新日志**
6-
- ⭐【新功能】
7-
- ⚡️【优化】
8-
- 🐞【修复】更新完成后点击重启关闭后无法自动打开问题(热更新无法修复该问题,需要下载新版版本覆盖客户端)
6+
7+
- ⭐【新功能】Oracle 连接支持 Service name 方式
8+
- ⭐【新功能】编辑表数据支持批量复制、克隆、删除(点击1X1单元格全选/取消,按住shift/ctrl/cmd多选)
9+
- ⚡️【优化】更新完成后点击重启关闭后无法自动打开问题(热更新无法修复该问题,需要下载新版版本覆盖客户端)
910
- 🐞【修复】database和schema搜索支持大小写模糊匹配
10-
- 🐞【修复】修复添加database后不显示问题
11+
- 🐞【修复】添加database后不显示问题
12+
- 🐞【修复】sql格式化对·now()·格式错误问题
13+
1114

1215
## 3.0.10
1316

Lines changed: 100 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import React, { memo, useState, useEffect } from 'react';
22
import styles from './index.less';
33
import classnames from 'classnames';
4-
import { i18n, isEn } from '@/i18n';
4+
import { i18n } from '@/i18n';
55
import { Form, Modal, Input, Select } from 'antd';
66
import connectionService, { IDriverResponse } from '@/service/connection';
7-
import { DatabaseTypeCode, ConnectionEnvType, databaseMap } from '@/constants';
87
import UploadDriver from '@/components/UploadDriver';
98
import LoadingGracile from '@/components/Loading/LoadingGracile';
109
const { Option } = Select;
@@ -19,10 +18,10 @@ enum DownloadStatus {
1918
Default,
2019
Loading,
2120
Error,
22-
Success
21+
Success,
2322
}
2423

25-
export default memo<IProps>(function Driver(props) {
24+
export default memo<IProps>((props) => {
2625
const { className, backfillData, onChange } = props;
2726
const [downloadStatus, setDownloadStatus] = useState<DownloadStatus>(DownloadStatus.Default);
2827
const [driverForm] = Form.useForm();
@@ -34,135 +33,146 @@ export default memo<IProps>(function Driver(props) {
3433
if (backfillData) {
3534
getDriverList();
3635
}
37-
}, [backfillData?.type])
36+
}, [backfillData?.type]);
3837

3938
useEffect(() => {
4039
if (backfillData) {
4140
const data = {
4241
jdbcDriverClass: backfillData?.driverConfig?.jdbcDriverClass,
43-
jdbcDriver: backfillData?.driverConfig?.jdbcDriver
44-
}
45-
driverForm.setFieldsValue(data)
42+
jdbcDriver: backfillData?.driverConfig?.jdbcDriver,
43+
};
44+
driverForm.setFieldsValue(data);
4645
onChange(data);
4746
}
48-
49-
}, [backfillData?.driverConfig, backfillData?.id])
47+
}, [backfillData?.driverConfig, backfillData?.id]);
5048

5149
function getDriverList() {
52-
connectionService.getDriverList({ dbType: backfillData.type }).then(res => {
50+
connectionService.getDriverList({ dbType: backfillData.type }).then((res) => {
5351
if (!res) {
54-
return
52+
return;
5553
}
5654
setDriverObj({
5755
...res,
58-
driverConfigList: res.driverConfigList || []
56+
driverConfigList: res.driverConfigList || [],
5957
});
6058
if (res.driverConfigList?.length && !backfillData?.driverConfig?.jdbcDriver) {
6159
const data = {
6260
jdbcDriverClass: res.driverConfigList[0]?.jdbcDriverClass,
63-
jdbcDriver: res.driverConfigList[0]?.jdbcDriver
64-
}
61+
jdbcDriver: res.driverConfigList[0]?.jdbcDriver,
62+
};
6563
driverForm.setFieldsValue(data);
6664
onChange(data);
6765
}
68-
})
66+
});
6967
}
7068

7169
function formChange(data: any) {
7270
setDriverSaved(data);
7371
}
7472

7573
function saveDriver() {
76-
connectionService.saveDriver(driverSaved).then(res => {
74+
connectionService.saveDriver(driverSaved).then(() => {
7775
setUploadDriverModal(false);
7876
getDriverList();
79-
})
77+
});
8078
}
8179

8280
function downloadDrive() {
8381
setDownloadStatus(DownloadStatus.Loading);
84-
connectionService.downloadDriver({ dbType: backfillData.type }).then(res => {
85-
setDownloadStatus(DownloadStatus.Success);
86-
getDriverList();
87-
}).catch(() => {
88-
setDownloadStatus(DownloadStatus.Error)
89-
})
82+
connectionService
83+
.downloadDriver({ dbType: backfillData.type })
84+
.then(() => {
85+
setDownloadStatus(DownloadStatus.Success);
86+
getDriverList();
87+
})
88+
.catch(() => {
89+
setDownloadStatus(DownloadStatus.Error);
90+
});
9091
}
9192

9293
function onValuesChange(data: any) {
93-
const selected = driverObj?.driverConfigList.find(t => t.jdbcDriver === data.jdbcDriver);
94+
const selected = driverObj?.driverConfigList.find((t) => t.jdbcDriver === data.jdbcDriver);
9495
driverForm.setFieldsValue({
95-
jdbcDriverClass: selected?.jdbcDriverClass
96+
jdbcDriverClass: selected?.jdbcDriverClass,
9697
});
9798
onChange({
9899
jdbcDriverClass: selected?.jdbcDriverClass,
99-
jdbcDriver: data.jdbcDriver
100-
})
100+
jdbcDriver: data.jdbcDriver,
101+
});
101102
}
102103

103-
return <div className={classnames(styles.box, className)}>
104-
<Form
105-
form={driverForm}
106-
onValuesChange={onValuesChange}
107-
colon={false}
108-
>
109-
<Form.Item labelAlign="left" name="jdbcDriver" label={i18n('connection.title.driver')}>
110-
<Select>
111-
{driverObj?.driverConfigList?.map((t) => (
112-
<Option key={t.jdbcDriver} value={t.jdbcDriver}>
113-
{t.jdbcDriver}
114-
</Option>
115-
))}
116-
</Select>
117-
</Form.Item>
118-
<Form.Item labelAlign="left" name="jdbcDriverClass" label="Class">
119-
<Input disabled />
120-
</Form.Item>
121-
</Form>
122-
<div className={styles.downloadDriveFooter}>
123-
{
124-
((driverObj?.driverConfigList && !driverObj?.driverConfigList?.length) || downloadStatus === DownloadStatus.Success) ? <div onClick={downloadDrive} className={styles.downloadDrive}>
125-
{
126-
(downloadStatus === DownloadStatus.Default) && <div className={classnames(styles.downloadText, styles.downloadTextDownload)}>{i18n('connection.text.downloadDriver')}</div>
127-
}
128-
{
129-
(downloadStatus === DownloadStatus.Loading) &&
130-
<div className={classnames(styles.downloadText, styles.downloadTextLoading)}>
131-
<LoadingGracile></LoadingGracile>
132-
<div className={styles.text}>
133-
{i18n('connection.text.downloading')}
104+
return (
105+
<div className={classnames(styles.box, className)}>
106+
<Form form={driverForm} onValuesChange={onValuesChange} colon={false}>
107+
<Form.Item labelAlign="left" name="jdbcDriver" label={i18n('connection.title.driver')}>
108+
<Select>
109+
{driverObj?.driverConfigList?.map((t) => (
110+
<Option key={t.jdbcDriver} value={t.jdbcDriver}>
111+
{t.jdbcDriver}
112+
</Option>
113+
))}
114+
</Select>
115+
</Form.Item>
116+
<Form.Item labelAlign="left" name="jdbcDriverClass" label="Class">
117+
<Input disabled />
118+
</Form.Item>
119+
</Form>
120+
<div className={styles.downloadDriveFooter}>
121+
{(driverObj?.driverConfigList && !driverObj?.driverConfigList?.length) ||
122+
downloadStatus === DownloadStatus.Success ? (
123+
<div onClick={downloadDrive} className={styles.downloadDrive}>
124+
{downloadStatus === DownloadStatus.Default && (
125+
<div className={classnames(styles.downloadText, styles.downloadTextDownload)}>
126+
{i18n('connection.text.downloadDriver')}
134127
</div>
135-
</div>
136-
}
137-
{
138-
(downloadStatus === DownloadStatus.Error) && <div className={classnames(styles.downloadText, styles.downloadTextError)}>{i18n('connection.text.tryAgainDownload')}</div>
139-
}
140-
{
141-
(downloadStatus === DownloadStatus.Success) && <div className={classnames(styles.downloadText, styles.downloadTextSuccess)}>{i18n('connection.text.downloadSuccess')}</div>
142-
}
143-
144-
</div> : <div />
145-
}
128+
)}
129+
{downloadStatus === DownloadStatus.Loading && (
130+
<div className={classnames(styles.downloadText, styles.downloadTextLoading)}>
131+
<LoadingGracile />
132+
<div className={styles.text}>{i18n('connection.text.downloading')}</div>
133+
</div>
134+
)}
135+
{downloadStatus === DownloadStatus.Error && (
136+
<div className={classnames(styles.downloadText, styles.downloadTextError)}>
137+
{i18n('connection.text.tryAgainDownload')}
138+
</div>
139+
)}
140+
{downloadStatus === DownloadStatus.Success && (
141+
<div className={classnames(styles.downloadText, styles.downloadTextSuccess)}>
142+
{i18n('connection.text.downloadSuccess')}
143+
</div>
144+
)}
145+
</div>
146+
) : (
147+
<div />
148+
)}
146149

147-
<div
148-
className={styles.uploadCustomDrive}
149-
onClick={() => { setUploadDriverModal(true) }}
150-
>
151-
{i18n('connection.tips.customUpload')}
150+
<div
151+
className={styles.uploadCustomDrive}
152+
onClick={() => {
153+
setUploadDriverModal(true);
154+
}}
155+
>
156+
{i18n('connection.tips.customUpload')}
157+
</div>
152158
</div>
159+
<Modal
160+
destroyOnClose={true}
161+
title={i18n('connection.title.uploadDriver')}
162+
open={uploadDriverModal}
163+
onOk={() => {
164+
saveDriver();
165+
}}
166+
onCancel={() => {
167+
setUploadDriverModal(false);
168+
}}
169+
>
170+
<UploadDriver
171+
jdbcDriverClass={driverObj?.defaultDriverConfig?.jdbcDriverClass}
172+
formChange={formChange}
173+
databaseType={backfillData.type}
174+
/>
175+
</Modal>
153176
</div>
154-
<Modal
155-
destroyOnClose={true}
156-
title={i18n('connection.title.uploadDriver')}
157-
open={uploadDriverModal}
158-
onOk={() => { saveDriver() }}
159-
onCancel={() => { setUploadDriverModal(false) }}
160-
>
161-
<UploadDriver
162-
jdbcDriverClass={driverObj?.defaultDriverConfig?.jdbcDriverClass}
163-
formChange={formChange}
164-
databaseType={backfillData.type}
165-
></UploadDriver>
166-
</Modal>
167-
</div>
168-
})
177+
);
178+
});

0 commit comments

Comments
 (0)