Skip to content

Commit

Permalink
feat: edit table
Browse files Browse the repository at this point in the history
  • Loading branch information
shanhexi committed Sep 17, 2023
2 parents 33b176e + 7d69630 commit 0c46af4
Show file tree
Hide file tree
Showing 71 changed files with 3,081 additions and 1,302 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"echart",
"echarts",
"favicons",
"fulltext",
"ghostoy",
"iconfont",
"jdbc",
Expand Down
47 changes: 28 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
function using 'docker'
- Added support for environment selection, better distinguishing between online and daily

# 2.0.14

## 🐞 Bug Fixes

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

# 2.0.13

- 修改分页逻辑,修复部分 SQL 无法查询

# 2.0.13

## ⭐ New Features

## 🐞 Bug Fixes

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

## 🐞 问题修复

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

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

## ⭐ 新特性

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

## 🐞 问题修复

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

# 2.0.11
Expand Down Expand Up @@ -98,11 +107,11 @@

## 🐞 问题修复

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

# 2.0.9

Expand All @@ -112,18 +121,18 @@

## 🐞 问题修复

- 修复windows闪退的问题
- 修复 windows 闪退的问题

# 2.0.8

## 🐞 Bug Fixes

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

## 🐞 问题修复

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

# 2.0.7
Expand All @@ -142,18 +151,18 @@

## 🐞 问题修复

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

# 2.0.6

## 🐞 Bug Fixes

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

## 🐞 问题修复

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

# 2.0.5

Expand Down
2 changes: 2 additions & 0 deletions chat2db-client/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
"echarts",
"favicons",
"findstr",
"fulltext",
"gtag",
"hexi",
"Iconfont",
"indexs",
"JDBC",
Expand Down
2 changes: 1 addition & 1 deletion chat2db-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"start:web": "cross-env UMI_ENV=local cross-env APP_VERSION=${npm_config_app_version} umi dev"
},
"dependencies": {
"@dnd-kit/modifiers": "^6.0.1",
"ahooks": "^3.7.7",
"ali-react-table": "^2.6.1",
"antd": "^5.6.0",
Expand Down Expand Up @@ -55,7 +56,6 @@
"@umijs/plugins": "^4.0.55",
"concurrently": "^8.1.0",
"cross-env": "^7.0.3",
"electron": "^22.3.0",
"electron-builder": "^23.6.0",
"electron-debug": "^3.2.0",
"electron-reload": "^2.0.0-alpha.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import '../../../styles/var.less';

.box {
padding: 10px;
}

.formBox {
width: 50%;
}
54 changes: 54 additions & 0 deletions chat2db-client/src/blocks/DatabaseTableEditor/BaseInfo/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import React, { memo, useState, useContext, useEffect, useImperativeHandle, ForwardedRef, forwardRef } from 'react';
import styles from './index.less';
import classnames from 'classnames';
import { Form, Input } from 'antd';
import { Context } from '../index';
import { IBaseInfo } from '@/typings';
import i18n from '@/i18n';


export interface IBaseInfoRef {
getBaseInfo: () => IBaseInfo;
}

interface IProps {
className?: string;
}

const BaseInfo = forwardRef((props: IProps, ref: ForwardedRef<IBaseInfoRef>) => {
const { className } = props;
const { tableDetails } = useContext(Context);
const [form] = Form.useForm();

useEffect(() => {
form.setFieldsValue({
name: tableDetails.name,
comment: tableDetails.comment,
});
}, [tableDetails]);

function getBaseInfo(): IBaseInfo {
return form.getFieldsValue();
}

useImperativeHandle(ref, () => ({
getBaseInfo,
}));

return (
<div className={classnames(className, styles.box)}>
<div className={styles.formBox}>
<Form form={form} initialValues={{ remember: true }} autoComplete="off" className={styles.form}>
<Form.Item label={i18n('editTable.label.tableName')} name="name">
<Input />
</Form.Item>
<Form.Item label={i18n('editTable.label.comment')} name="comment">
<Input />
</Form.Item>
</Form>
</div>
</div>
);
});

export default BaseInfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@import '../../../styles/var.less';

.box {
height: 100%;
padding: 10px;
box-sizing: border-box;
display: flex;
flex-direction: column;
}

.columnListHeader {
margin: 0px -5px 10px;
button {
margin: 0px 5px;
}
}

.tableBox {
flex: 1;
overflow: auto;
}

.editableCell {
height: 28px;
line-height: 26px;
padding: 0px 7px;
box-sizing: border-box;
border: 1px solid transparent;
border-radius: 4px;
.f-single-line();
width: 100%;
cursor: pointer;
&:hover {
border: 1px solid var(--color-border);
}
}
Loading

0 comments on commit 0c46af4

Please sign in to comment.