Skip to content

Commit 0c46af4

Browse files
committed
feat: edit table
2 parents 33b176e + 7d69630 commit 0c46af4

71 files changed

Lines changed: 3081 additions & 1302 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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"echart",
2424
"echarts",
2525
"favicons",
26+
"fulltext",
2627
"ghostoy",
2728
"iconfont",
2829
"jdbc",

CHANGELOG.md

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
function using 'docker'
88
- Added support for environment selection, better distinguishing between online and daily
99

10+
# 2.0.14
11+
1012
## 🐞 Bug Fixes
1113

1214
- Fix the issue of 'Oracle' query 'Blob' reporting errors
@@ -24,15 +26,22 @@
2426

2527
# 2.0.13
2628

29+
- 修改分页逻辑,修复部分 SQL 无法查询
30+
31+
# 2.0.13
32+
33+
## ⭐ New Features
34+
2735
## 🐞 Bug Fixes
2836

2937
- Fixed a bug where sql formatting was not selected
3038
- Fixed open view lag issue
3139
- Solve the white screen problem of connected non-relational databases (non-relational databases are not supported)
40+
## ⭐ 新特性
3241

3342
## 🐞 问题修复
3443

35-
- 修复不选中sql格式化的bug
44+
- 修复不选中 sql 格式化的 bug
3645
- 修复打开视图卡顿问题
3746
- 解决已连接的非关系型数据库打开白屏问题(暂不支持非关系性数据库)
3847

@@ -50,27 +59,27 @@
5059
- Fixed an issue where locally stored theme colors and background colors are incompatible with the new version, causing
5160
page crashes
5261
- Logs desensitize sensitive data
53-
- Fix the issue of 'CLOB' not displaying specific content [Issue #440](https://github.com/chat2db/Chat2DB/issues/440)
62+
- Fix the issue of 'CLOB' not displaying specific content [Issue #440](https://github.com/chat2db/Chat2DB/issues/440)
5463
- Fix the problem that non-Select does not display query results
5564
- Fix the problem that Oracle cannot query without schema
5665
- Fix the problem of special type of SQL execution error reporting
5766
- Fix the problem that the test link is successful, but the error is reported when saving the link
5867

5968
## ⭐ 新特性
6069

61-
- 🔥支持查看视图、函数、触发器、存储过程
62-
- 支持选中sql格式化
70+
- 🔥 支持查看视图、函数、触发器、存储过程
71+
- 支持选中 sql 格式化
6372
- 增加新的暗色主题
6473

6574
## 🐞 问题修复
6675

67-
- 修复sql格式化会失败问题
76+
- 修复 sql 格式化会失败问题
6877
- 修复本地存储的主题色、背景色与新版本不兼容时会导致页面崩溃问题
6978
- 日志对敏感数据进行脱敏
70-
- 修复 `CLOB` 不展示具体内容的问题 [Issue #440](https://github.com/chat2db/Chat2DB/issues/440)
71-
- 修复非Select不展示查询结果的问题
72-
- 修复Oracle不带schema无法查询的问题
73-
- 修复特殊类型的SQL执行报错的问题
79+
- 修复 `CLOB` 不展示具体内容的问题 [Issue #440](https://github.com/chat2db/Chat2DB/issues/440)
80+
- 修复非 Select 不展示查询结果的问题
81+
- 修复 Oracle 不带 schema 无法查询的问题
82+
- 修复特殊类型的 SQL 执行报错的问题
7483
- 修复测试链接成功,但保存链接报错的问题
7584

7685
# 2.0.11
@@ -98,11 +107,11 @@
98107

99108
## 🐞 问题修复
100109

101-
- 新建、开打console时激活最新操作的console、记录最后一次使用的console
102-
- edge等浏览器复制功能无法正常使用
103-
- table搜索后导出ddl报错
110+
- 新建、开打 console 时激活最新操作的 console、记录最后一次使用的 console
111+
- edge 等浏览器复制功能无法正常使用
112+
- table 搜索后导出 ddl 报错
104113
- 增加表注释以及列字段类型和注释
105-
- 当数据源添加了database默认选择第一个database
114+
- 当数据源添加了 database 默认选择第一个 database
106115

107116
# 2.0.9
108117

@@ -112,18 +121,18 @@
112121

113122
## 🐞 问题修复
114123

115-
- 修复windows闪退的问题
124+
- 修复 windows 闪退的问题
116125

117126
# 2.0.8
118127

119128
## 🐞 Bug Fixes
120129

121-
- Repair the Scientific notation in some databases [Issue #378](https://github.com/chat2db/Chat2DB/issues/378)
130+
- Repair the Scientific notation in some databases [Issue #378](https://github.com/chat2db/Chat2DB/issues/378)
122131
- Fix some cases where data is not displayed
123132

124133
## 🐞 问题修复
125134

126-
- 修复部分数据库出现科学计数法的情况 [Issue #378](https://github.com/chat2db/Chat2DB/issues/378)
135+
- 修复部分数据库出现科学计数法的情况 [Issue #378](https://github.com/chat2db/Chat2DB/issues/378)
127136
- 修复部分情况数据不展示
128137

129138
# 2.0.7
@@ -142,18 +151,18 @@
142151

143152
## 🐞 问题修复
144153

145-
- 修复ai配置 [Issue #346](https://github.com/chat2db/Chat2DB/issues/346)
154+
- 修复 ai 配置 [Issue #346](https://github.com/chat2db/Chat2DB/issues/346)
146155

147156
# 2.0.6
148157

149158
## 🐞 Bug Fixes
150159

151160
- Fixed: When there are too many tables under the selected library, the "New Console" button at the bottom
152-
disappears [Issue #314](https://github.com/chat2db/Chat2DB/issues/314)
161+
disappears [Issue #314](https://github.com/chat2db/Chat2DB/issues/314)
153162

154163
## 🐞 问题修复
155164

156-
- Fixed: 当选择的库下面表过多时最下面的“新建控制台”按钮消失 [Issue #314](https://github.com/chat2db/Chat2DB/issues/314)
165+
- Fixed: 当选择的库下面表过多时最下面的“新建控制台”按钮消失 [Issue #314](https://github.com/chat2db/Chat2DB/issues/314)
157166

158167
# 2.0.5
159168

chat2db-client/.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
"echarts",
3838
"favicons",
3939
"findstr",
40+
"fulltext",
4041
"gtag",
42+
"hexi",
4143
"Iconfont",
4244
"indexs",
4345
"JDBC",

chat2db-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"start:web": "cross-env UMI_ENV=local cross-env APP_VERSION=${npm_config_app_version} umi dev"
2626
},
2727
"dependencies": {
28+
"@dnd-kit/modifiers": "^6.0.1",
2829
"ahooks": "^3.7.7",
2930
"ali-react-table": "^2.6.1",
3031
"antd": "^5.6.0",
@@ -55,7 +56,6 @@
5556
"@umijs/plugins": "^4.0.55",
5657
"concurrently": "^8.1.0",
5758
"cross-env": "^7.0.3",
58-
"electron": "^22.3.0",
5959
"electron-builder": "^23.6.0",
6060
"electron-debug": "^3.2.0",
6161
"electron-reload": "^2.0.0-alpha.1",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@import '../../../styles/var.less';
2+
3+
.box {
4+
padding: 10px;
5+
}
6+
7+
.formBox {
8+
width: 50%;
9+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import React, { memo, useState, useContext, useEffect, useImperativeHandle, ForwardedRef, forwardRef } from 'react';
2+
import styles from './index.less';
3+
import classnames from 'classnames';
4+
import { Form, Input } from 'antd';
5+
import { Context } from '../index';
6+
import { IBaseInfo } from '@/typings';
7+
import i18n from '@/i18n';
8+
9+
10+
export interface IBaseInfoRef {
11+
getBaseInfo: () => IBaseInfo;
12+
}
13+
14+
interface IProps {
15+
className?: string;
16+
}
17+
18+
const BaseInfo = forwardRef((props: IProps, ref: ForwardedRef<IBaseInfoRef>) => {
19+
const { className } = props;
20+
const { tableDetails } = useContext(Context);
21+
const [form] = Form.useForm();
22+
23+
useEffect(() => {
24+
form.setFieldsValue({
25+
name: tableDetails.name,
26+
comment: tableDetails.comment,
27+
});
28+
}, [tableDetails]);
29+
30+
function getBaseInfo(): IBaseInfo {
31+
return form.getFieldsValue();
32+
}
33+
34+
useImperativeHandle(ref, () => ({
35+
getBaseInfo,
36+
}));
37+
38+
return (
39+
<div className={classnames(className, styles.box)}>
40+
<div className={styles.formBox}>
41+
<Form form={form} initialValues={{ remember: true }} autoComplete="off" className={styles.form}>
42+
<Form.Item label={i18n('editTable.label.tableName')} name="name">
43+
<Input />
44+
</Form.Item>
45+
<Form.Item label={i18n('editTable.label.comment')} name="comment">
46+
<Input />
47+
</Form.Item>
48+
</Form>
49+
</div>
50+
</div>
51+
);
52+
});
53+
54+
export default BaseInfo
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@import '../../../styles/var.less';
2+
3+
.box {
4+
height: 100%;
5+
padding: 10px;
6+
box-sizing: border-box;
7+
display: flex;
8+
flex-direction: column;
9+
}
10+
11+
.columnListHeader {
12+
margin: 0px -5px 10px;
13+
button {
14+
margin: 0px 5px;
15+
}
16+
}
17+
18+
.tableBox {
19+
flex: 1;
20+
overflow: auto;
21+
}
22+
23+
.editableCell {
24+
height: 28px;
25+
line-height: 26px;
26+
padding: 0px 7px;
27+
box-sizing: border-box;
28+
border: 1px solid transparent;
29+
border-radius: 4px;
30+
.f-single-line();
31+
width: 100%;
32+
cursor: pointer;
33+
&:hover {
34+
border: 1px solid var(--color-border);
35+
}
36+
}

0 commit comments

Comments
 (0)