Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Chat2DB-Pro committed Dec 27, 2023
2 parents 22add55 + c82b761 commit 23c4640
Show file tree
Hide file tree
Showing 28 changed files with 247 additions and 53 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/pushdocker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ jobs:
cd chat2db-client
yarn install
yarn run build:web:prod --app_version=${{ steps.chat2db_version.outputs.substring }}
mkdir -p ../chat2db-server/chat2db-server-web-start/src/main/resources/static/
mkdir -p ../chat2db-server/chat2db-server-web-start/src/main/resources/thymeleaf/
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/
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 3.1.17

`2023-12-27`

**Changelog**

- ⭐【New Features】Connection replicable
- ⚡️【Optimize】Select the table to view the DDL of the table in Information on the right expansion bar
- 🐞【Fixed】Home connection cannot switch pages
- 🐞【Fixed】Columns cannot be viewed or edited in some tables of the Oracle database

## 3.1.16

`2023-12-25`
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG_CN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 3.1.17

`2023-12-27`

**更新日志**

- ⭐【新功能】连接可复制
- ⚡️【优化】选中表可直接在右侧拓展栏的“信息”中查看表DDL
- 🐞【修复】Oracle数据库部分表无法查看列、无法编辑问题
- 🐞【修复】团队管理归属连接无法切换分页



## 3.1.16

`2023-12-25`
Expand Down
29 changes: 26 additions & 3 deletions chat2db-client/src/assets/font/demo_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ <h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" targ
<div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box">

<li class="dib">
<span class="icon iconfont">&#xe8e8;</span>
<div class="name">305信息-线性圆框</div>
<div class="code-name">&amp;#xe8e8;</div>
</li>

<li class="dib">
<span class="icon iconfont">&#xe726;</span>
<div class="name">加号</div>
Expand Down Expand Up @@ -1230,9 +1236,9 @@ <h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</co
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.woff2?t=1702019801419') format('woff2'),
url('iconfont.woff?t=1702019801419') format('woff'),
url('iconfont.ttf?t=1702019801419') format('truetype');
src: url('iconfont.woff2?t=1703676613329') format('woff2'),
url('iconfont.woff?t=1703676613329') format('woff'),
url('iconfont.ttf?t=1703676613329') format('truetype');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
Expand All @@ -1258,6 +1264,15 @@ <h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面
<div class="content font-class">
<ul class="icon_lists dib-box">

<li class="dib">
<span class="icon iconfont icon-xinxi-xianxingyuankuang"></span>
<div class="name">
305信息-线性圆框
</div>
<div class="code-name">.icon-xinxi-xianxingyuankuang
</div>
</li>

<li class="dib">
<span class="icon iconfont icon-jiahao"></span>
<div class="name">
Expand Down Expand Up @@ -3022,6 +3037,14 @@ <h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h
<div class="content symbol">
<ul class="icon_lists dib-box">

<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-xinxi-xianxingyuankuang"></use>
</svg>
<div class="name">305信息-线性圆框</div>
<div class="code-name">#icon-xinxi-xianxingyuankuang</div>
</li>

<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-jiahao"></use>
Expand Down
10 changes: 7 additions & 3 deletions chat2db-client/src/assets/font/iconfont.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 3633546 */
src: url('iconfont.woff2?t=1702019801419') format('woff2'),
url('iconfont.woff?t=1702019801419') format('woff'),
url('iconfont.ttf?t=1702019801419') format('truetype');
src: url('iconfont.woff2?t=1703676613329') format('woff2'),
url('iconfont.woff?t=1703676613329') format('woff'),
url('iconfont.ttf?t=1703676613329') format('truetype');
}

.iconfont {
Expand All @@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}

.icon-xinxi-xianxingyuankuang:before {
content: "\e8e8";
}

.icon-jiahao:before {
content: "\e726";
}
Expand Down
2 changes: 1 addition & 1 deletion chat2db-client/src/assets/font/iconfont.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions chat2db-client/src/assets/font/iconfont.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "1727525",
"name": "305信息-线性圆框",
"font_class": "xinxi-xianxingyuankuang",
"unicode": "e8e8",
"unicode_decimal": 59624
},
{
"icon_id": "577312",
"name": "加号",
Expand Down
Binary file modified chat2db-client/src/assets/font/iconfont.ttf
Binary file not shown.
Binary file modified chat2db-client/src/assets/font/iconfont.woff
Binary file not shown.
Binary file modified chat2db-client/src/assets/font/iconfont.woff2
Binary file not shown.
14 changes: 14 additions & 0 deletions chat2db-client/src/blocks/Tree/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ITreeNode } from '@/typings';
import { TreeNodeType, databaseMap } from '@/constants';
import { treeConfig, switchIcon, ITreeConfigItem } from './treeConfig';
import { useCommonStore } from '@/store/common';
import { setCurrentWorkspaceGlobalExtend } from '@/pages/main/workspace/store/common';
import LoadingGracile from '@/components/Loading/LoadingGracile';
import { setFocusId, useTreeStore } from './treeStore';
import { useGetRightClickMenu } from './hooks/useGetRightClickMenu';
Expand Down Expand Up @@ -321,6 +322,19 @@ const TreeNode = memo((props: TreeNodeIProps) => {
useCommonStore.setState({
focusedContent: (treeNodeData.name || '') as any,
});
if(treeNodeData.treeNodeType === TreeNodeType.TABLE){
setCurrentWorkspaceGlobalExtend({
code: 'viewDDL',
uniqueData: {
dataSourceId: treeNodeData.extraParams?.dataSourceId,
dataSourceName: treeNodeData.extraParams?.dataSourceName,
databaseName: treeNodeData.extraParams?.databaseName,
databaseType: treeNodeData.extraParams?.databaseType,
schemaName: treeNodeData.extraParams?.schemaName,
tableName: treeNodeData.name,
}
});
}
setFocusId(treeNodeData.uuid || '');
};

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_k2vec3ylzxg.woff2?t=1701918215684') format('woff2'),
url('//at.alicdn.com/t/c/font_3633546_k2vec3ylzxg.woff?t=1701918215684') format('woff'),
url('//at.alicdn.com/t/c/font_3633546_k2vec3ylzxg.ttf?t=1701918215684') format('truetype');
src: url('//at.alicdn.com/t/c/font_3633546_oqofqe5r679.woff2?t=1703676557975') format('woff2'),
url('//at.alicdn.com/t/c/font_3633546_oqofqe5r679.woff?t=1703676557975') format('woff'),
url('//at.alicdn.com/t/c/font_3633546_oqofqe5r679.ttf?t=1703676557975') format('truetype');
}
`;
const style = document.createElement('style');
Expand Down
1 change: 0 additions & 1 deletion chat2db-client/src/components/Output/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
display: flex;
align-items: center;

background-color: var(--color-bg-subtle);
line-height: 32px;
padding: 0px 10px;
font-weight: bold;
Expand Down
3 changes: 2 additions & 1 deletion chat2db-client/src/components/ViewDDL/index.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import '../../styles/var.less';

.box {
.viewDDL {
height: 100%;
}
22 changes: 18 additions & 4 deletions chat2db-client/src/components/ViewDDL/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,37 @@ import styles from './index.less';
import classnames from 'classnames';
import MonacoEditor, { IExportRefFunction } from '@/components/MonacoEditor';
import { v4 as uuid } from 'uuid';
import sqlServer from '@/service/sql';

interface IProps {
className?: string;
sql: string;
data: any;
}

export default memo<IProps>((props) => {
const { className, sql } = props;
const { className, data } = props;
const [monacoEditorId] = React.useState(uuid());
const monacoEditorRef = React.useRef<IExportRefFunction>(null);
const [sql,setSql] = React.useState('');

useEffect(() => {
monacoEditorRef.current?.setValue(sql, 'reset');
if(data){
sqlServer
.exportCreateTableSql({
...data,
} as any)
.then((res) => {
setSql(res);
});
}
}, [data]);

useEffect(() => {
monacoEditorRef.current?.setValue(sql || '', 'reset');
}, [sql]);

return (
<div className={classnames(styles.box, className)}>
<div className={classnames(styles.viewDDL, className)}>
<MonacoEditor
id={monacoEditorId}
ref={monacoEditorRef}
Expand Down
1 change: 1 addition & 0 deletions chat2db-client/src/i18n/en-us/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,5 @@ export default {
'common.label.tcp': 'TCP',
'common.label.LocalFile': 'LocalFile',
'common.text.rename': 'Rename',
'common.title.info': 'Info',
};
1 change: 1 addition & 0 deletions chat2db-client/src/i18n/ja-jp/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,5 @@ export default {
'common.label.tcp': 'オンライン',
'common.label.LocalFile': 'ローカルファイル',
'common.text.rename': '名前を変更',
'common.title.info': '情報',
};
1 change: 1 addition & 0 deletions chat2db-client/src/i18n/tr-tr/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,5 @@ export default {
'common.label.tcp': 'TCP',
'common.label.LocalFile': 'Yerel Dosya',
'common.text.rename': 'Yeniden Adlandır',
'common.title.info': 'Bilgi',
};
2 changes: 2 additions & 0 deletions chat2db-client/src/i18n/zh-cn/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,6 @@ export default {
'common.label.tcp': '线上',
'common.label.LocalFile': '本地',
'common.text.rename': '重命名',
'common.title.info': '信息',

};
13 changes: 13 additions & 0 deletions chat2db-client/src/pages/main/connection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,25 @@ const ConnectionsPage = () => {
handleMenuItemDoubleClick(t);
};

const copyConnection = (e) => {
e.domEvent?.stopPropagation?.();
connectionService.clone({ id: t.id }).then((res) => {
getConnectionList();
setConnectionActiveId(res);
});
}

return [
{
key: 'enterWorkSpace',
label: <MenuLabel icon="&#xec57;" label={i18n('connection.button.connect')} />,
onClick: enterWorkSpace,
},
{
key: 'copyConnection',
label: <MenuLabel icon="&#xec7a;" label={i18n('common.button.copy')} />,
onClick: copyConnection,
},
{
key: 'delete',
label: <MenuLabel icon="&#xe6a7;" label={i18n('connection.button.remove')} />,
Expand Down
21 changes: 20 additions & 1 deletion chat2db-client/src/pages/main/team/universal-drawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ function UniversalDrawer(props: IProps) {
showSizeChanger: true,
showQuickJumper: true,
});
const [total, setTotal] = useState(0);

const managementMap: Record<AffiliationType, IAffiliationDetail> = useMemo(
() => ({
Expand Down Expand Up @@ -322,6 +323,7 @@ function UniversalDrawer(props: IProps) {
showSizeChanger: true,
showQuickJumper: true,
});
setTotal(0);
setModalInfo({
open: false,
type: managementDataByType?.searchType,
Expand All @@ -346,6 +348,7 @@ function UniversalDrawer(props: IProps) {
});
if (res) {
setDataSource(res?.data ?? []);
setTotal(res?.total ?? 0);
}
};

Expand All @@ -356,6 +359,13 @@ function UniversalDrawer(props: IProps) {
});
};

const handleTableChange = (p: any) => {
setPagination({
...pagination,
...p,
});
};

if (!managementDataByType) {
return;
}
Expand Down Expand Up @@ -385,7 +395,16 @@ function UniversalDrawer(props: IProps) {
{i18n('common.button.add')}
</Button>
</div>
<Table rowKey={'id'} columns={managementDataByType?.columns} dataSource={dataSource} />
<Table
rowKey={'id'}
pagination={{
...pagination,
total,
}}
columns={managementDataByType?.columns}
dataSource={dataSource}
onChange={handleTableChange}
/>

<UniversalAddModal
{...modalInfo}
Expand Down
Loading

0 comments on commit 23c4640

Please sign in to comment.