Skip to content

Commit

Permalink
Merge pull request #599 from chat2db/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
shanhexi authored Oct 18, 2023
2 parents 959a7c8 + b1e9a95 commit 06d7096
Show file tree
Hide file tree
Showing 32 changed files with 393 additions and 641 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pushdocker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
yarn install
yarn run build:web:prod --app_version=${{ steps.chat2db_version.outputs.substring }}
cp -r dist ../chat2db-server/chat2db-server-start/src/main/resources/static/front
cp -r dist/index.html ../chat2db-server/chat2db-server-start/src/main/resources/thymeleaf
# 安装java
- name: Install Java and Maven
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ jobs:
yarn install
yarn run build:web:prod --app_version=${{ steps.chat2db_version.outputs.substring }}
cp -r dist ../chat2db-server/chat2db-server-start/src/main/resources/static/front
cp -r dist/index.html ../chat2db-server/chat2db-server-start/src/main/resources/thymeleaf
# 编译服务端java版本
- name: Build Java
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ jobs:
yarn install
yarn run build:web:prod --app_version=99.0.${{ github.run_id }} --app_port=10822
cp -r dist ../chat2db-server/chat2db-server-start/src/main/resources/static/front
cp -r dist/index.html ../chat2db-server/chat2db-server-start/src/main/resources/thymeleaf
# 编译服务端java版本
- name: Build Java
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"mkdir",
"monaco",
"msgtype",
"Navciat",
"Navicat",
"nsis",
"OPENAI",
"ossutil",
Expand All @@ -44,6 +46,7 @@
"Sercurity",
"sortablejs",
"temurin",
"thymeleaf",
"Tigger",
"togglefullscreen",
"umijs",
Expand Down
66 changes: 43 additions & 23 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
# 2.2.0

## ⭐ New Features

## 🐞 Bug Fixes

-

## ⭐ 新特性

- 🔥新增**表结构**编辑功能
- 🔥新增**表数据**编辑功能
-


## 🐞 问题修复

# 3.0.0
`2023-10-17`

## Changelog
- 🔥【New Features】Support for team collaboration mode
- 🔥【New Features】Support for visual table structure creation, editing, and deletion
- 🔥【New Features】Support for editing, adding, and deleting query data results
- ⭐【New Features】Support the feature of importing Navicat/DBever data source links
- ⭐【New Features】Support for AI automatic sync table structure。
- ⭐【New Features】Support export table structure
- ⭐【New Features】Support importing SQL files
- ⭐【New Features】Support the connection supports adding an environment,better distinguishing between online and daily
- ⚡️【Optimize】Optimize Editor Intellisense
- ⚡️【Optimize】Optimize AI Input
- ⚡️【Optimize】Sql query support is stopped
- ⚡️【Optimize】Sql execution supports viewing the number of affected rows
- ⚡️【Optimize】Reclaiming non-administrator permissions to edit shared connections
- ⚡️【Optimize】`Cmd/Ctrl + R` Run SQL, `Cmd/Ctrl + Shift + R` Refresh Page
- 🐞【Fixed】Table operation columns are overridden by table comments
- 🐞【Fixed】The last Tab in the query result cannot be closed
## 更新日志
- 🔥【新功能】支持团队协作模式
- 🔥【新功能】支持可视化表结构新增、编辑、删除
- 🔥【新功能】支持查询数据结果编辑、新增、删除
- ⭐【新功能】支持导入Navicat/DBeaver数据源链接的功能
- ⭐【新功能】支持AI自动同步表结构
- ⭐【新功能】支持导出表结构
- ⭐【新功能】支持导入sql文件
- ⭐【新功能】连接支持添加环境标识,更好地区分在线和日常
- ⚡️【优化】优化编辑器提示功能
- ⚡️【优化】优化AI输入
- ⚡️【优化】sql查询支持停止
- ⚡️【优化】sql执行支持查看影响行数
- ⚡️【优化】回收非管理员编辑共享连接权限
- ⚡️【优化】`Cmd/Ctrl + R` 运行SQL, `Cmd/Ctrl + Shift + R` 刷新页面
- 🐞【修复】表操作列被表注释覆盖问题
- 🐞【修复】查询结果最后一个Tab无法关闭问题

# 2.1.0

Expand All @@ -27,10 +47,9 @@

## ⭐ 新特性

-🔥新推出团队功能,支持团队协作。研发不需要知道在线数据库
密码,解决企业数据库帐号的安全问题。建议直接部署团队
使用'docker'的函数
-增加了环境选择的支持,更好地区分在线和日常
-🔥 新推出团队功能,支持团队协作。研发不需要知道在线数据库
密码,解决企业数据库帐号的安全问题。建议直接部署团队
使用'docker'的函数 -增加了环境选择的支持,更好地区分在线和日常

# 2.0.14

Expand All @@ -41,13 +60,13 @@

## ⭐ 新特性

- 🔥团队功能全新上线,支持团队协作,研发无需知道线上数据库密码,解决企业数据库账号安全问题,团队功能建议直接使用 `docker` 部署
- 🔥 团队功能全新上线,支持团队协作,研发无需知道线上数据库密码,解决企业数据库账号安全问题,团队功能建议直接使用 `docker` 部署
- 新增支持环境选择,更好的区分线上、日常环境

## 🐞 问题修复

- 修复 `Oracle` 查询 `Blob` 报错的问题
- 修改分页逻辑,修复部分SQL无法查询
- 修改分页逻辑,修复部分 SQL 无法查询

# 2.0.13

Expand All @@ -62,6 +81,7 @@
- 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)

## ⭐ 新特性

## 🐞 问题修复
Expand Down
1 change: 1 addition & 0 deletions chat2db-client/.umirc.prod.desktop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const chainWebpack = (config: any, { webpack }: any) => {
languages: ['mysql', 'pgsql', 'sql'],
},
]);
config.output.filename(`[name].${yarn_config.app_version || new Date().getTime()}.js`);
};

export default defineConfig({
Expand Down
1 change: 1 addition & 0 deletions chat2db-client/.umirc.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const chainWebpack = (config: any, { webpack }: any) => {
languages: ['mysql', 'pgsql', 'sql'],
},
]);
config.output.filename(`[name].${yarn_config.app_version || new Date().getTime()}.js`);
};

export default defineConfig({
Expand Down
12 changes: 10 additions & 2 deletions chat2db-client/.umirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const chainWebpack = (config: any, { webpack }: any) => {
languages: ['mysql', 'pgsql', 'sql'],
},
]);
config.output.filename(`[name].${yarn_config.app_version || new Date().getTime()}.js`);
};

export default defineConfig({
Expand Down Expand Up @@ -50,10 +51,17 @@ export default defineConfig({
// rel: 'manifest',
// href: 'manifest.json',
// }],
links: [
{ rel:"icon",
type:"image/ico",
sizes:"32x32",
href:"/static/front/logo.ico"
}
],
headScripts: [
`if (localStorage.getItem('app-local-storage-versions') !== 'v2') {
`if (localStorage.getItem('app-local-storage-versions') !== 'v3') {
localStorage.clear();
localStorage.setItem('app-local-storage-versions', 'v2');
localStorage.setItem('app-local-storage-versions', 'v3');
}`,
`if (window.myAPI) { window.myAPI.startServerForSpawn() }`,
// `if ("serviceWorker" in navigator) {
Expand Down
31 changes: 24 additions & 7 deletions chat2db-client/src/blocks/DatabaseTableEditor/IndexList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const Row = ({ children, ...props }: RowProps) => {
const IndexList = forwardRef((props: IProps, ref: ForwardedRef<IIndexListRef>) => {
const { databaseSupportField, tableDetails, databaseType } = useContext(Context);
const [dataSource, setDataSource] = useState<IIndexItem[]>([createInitialData()]);
const [oldDataSource, setOldDataSource] = useState<IIndexItem[]>([]); // 用于记录上一次的数据,用于对比是否有变化
const [form] = Form.useForm();
const [editingData, setEditingData] = useState<IIndexItem | null>(null);
const [includeColModalOpen, setIncludeColModalOpen] = useState(false);
Expand All @@ -96,13 +97,16 @@ const IndexList = forwardRef((props: IProps, ref: ForwardedRef<IIndexListRef>) =

useEffect(() => {
const data = tableDetails.indexList?.map((i) => {
const key = uuidv4();
return {
...i,
oldName: i.name,
key: uuidv4(),
key,
};
});
setDataSource(data || []);

setOldDataSource(lodash.cloneDeep(data) || []);
setDataSource(lodash.cloneDeep(data) || []);
}, [tableDetails]);

const addData = () => {
Expand All @@ -115,19 +119,22 @@ const IndexList = forwardRef((props: IProps, ref: ForwardedRef<IIndexListRef>) =
};

const deleteData = (record) => {
setDataSource(dataSource.filter((i) => i.key !== record?.key));
setDataSource(
dataSource.map((i) => {
const newList: any[] = dataSource
?.map((i) => {
if (i.key === record?.key) {
setEditingData(null);
if (i.editStatus === EditColumnOperationType.Add) {
return null;
}
return {
...i,
editStatus: EditColumnOperationType.Delete,
};
}
return i;
}),
);
})
?.filter((i) => i);
setDataSource(newList || []);
};

const handelFieldsChange = (field: any) => {
Expand Down Expand Up @@ -321,8 +328,18 @@ const IndexList = forwardRef((props: IProps, ref: ForwardedRef<IIndexListRef>) =
setDataSource(
dataSource.map((i) => {
const columnList = includeColRef.current?.getIncludeColInfo();
// 对比新老的IncludeColInfo有没有变化
if (i.key === editingData?.key && columnList) {
i.columnList = columnList;
oldDataSource.map((old) => {
if (old.key === editingData?.key) {
if (!lodash.isEqual(old.columnList, columnList)) {
i.editStatus = EditColumnOperationType.Modify;
} else {
i.editStatus = null;
}
}
});
}
return i;
}),
Expand Down
7 changes: 3 additions & 4 deletions chat2db-client/src/components/Console/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -452,13 +452,12 @@ function Console(props: IProps, ref: ForwardedRef<IConsoleRef>) {
const handleSelectTableSyncModel = () => {
const syncModel: SyncModelType | null = Number(localStorage.getItem('syncTableModel')) ?? null;
const hasAiAccess = aiModel.hasWhite;

if (!hasAiAccess || isEmpty(syncModel)) {
setSyncTableModel(SyncModelType.MANUAL);
if (syncModel !== null) {
setSyncTableModel(syncModel);
return;
}

setSyncTableModel(syncModel);
setSyncTableModel(hasAiAccess ? SyncModelType.AUTO : SyncModelType.MANUAL);
};

return (
Expand Down
6 changes: 3 additions & 3 deletions chat2db-client/src/components/Iconfont/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ if (__ENV__ === 'local') {
/* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
@font-face {
font-family: 'iconfont'; /* Project id 3633546 */
src: url('//at.alicdn.com/t/c/font_3633546_wmiaztua9a.woff2?t=1697545878708') format('woff2'),
url('//at.alicdn.com/t/c/font_3633546_wmiaztua9a.woff?t=1697545878708') format('woff'),
url('//at.alicdn.com/t/c/font_3633546_wmiaztua9a.ttf?t=1697545878708') format('truetype');
src: url('//at.alicdn.com/t/c/font_3633546_sze67iyjern.woff2?t=1697545966975') format('woff2'),
url('//at.alicdn.com/t/c/font_3633546_sze67iyjern.woff?t=1697545966975') format('woff'),
url('//at.alicdn.com/t/c/font_3633546_sze67iyjern.ttf?t=1697545966975') format('truetype');
}
`;
const style = document.createElement('style');
Expand Down
Loading

0 comments on commit 06d7096

Please sign in to comment.