Skip to content

Commit 1ed799b

Browse files
committed
fix:The console tab locates bugs
1 parent bfcda23 commit 1ed799b

13 files changed

Lines changed: 101 additions & 53 deletions

File tree

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# 2.2.0
2+
3+
## ⭐ New Features
4+
5+
## 🐞 Bug Fixes
6+
7+
-
8+
9+
## ⭐ 新特性
10+
11+
- 🔥新增**表结构**编辑功能
12+
- 🔥新增**表数据**编辑功能
13+
-
14+
15+
16+
## 🐞 问题修复
17+
18+
119
# 2.1.0
220

321
## ⭐ New Features
@@ -7,6 +25,13 @@
725
function using 'docker'
826
- Added support for environment selection, better distinguishing between online and daily
927

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

1237
## 🐞 Bug Fixes

chat2db-client/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@
2222
"start": "concurrently \"npm run start:web\" \"npm run start:main\"",
2323
"start:main": "cross-env NODE_ENV=development electron .",
2424
"start:main:prod": "cross-env NODE_ENV=production electron .",
25-
"start:web": "cross-env UMI_ENV=local HMR=none cross-env APP_VERSION=${npm_config_app_version} umi dev"
25+
"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",

chat2db-client/src/blocks/Setting/AiSetting/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export default function SettingAI(props: IProps) {
2424
setLoading(true);
2525
try {
2626
const res = await getUser();
27+
// 向cookie中写入当前用户id
28+
const date = new Date('2030-12-30 12:30:00').toUTCString();
29+
document.cookie = `CHAT2DB.USER_ID=${res?.id};Expires=${date}`;
2730
setUserInfo(res);
2831
} finally {
2932
setLoading(false);

chat2db-client/src/components/SearchResult/TableBox/index.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
.art-table-cell {
4747
position: relative;
4848
}
49+
.art-sticky-scroll {
50+
display: none !important;
51+
}
4952
.art-sticky-scroll.art-horizontal-scroll-container {
5053
position: sticky;
5154
bottom: 26px !important;

chat2db-client/src/components/TabsNew/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export interface IOnchangeProps {
2323
interface IProps {
2424
className?: string;
2525
items?: ITabItem[];
26-
activeKey?: number | string;
27-
onChange?: (key: string | number | undefined) => void;
26+
activeKey?: number | string | null;
27+
onChange?: (key: string | number | null) => void;
2828
onEdit?: (action: 'add' | 'remove', data?: ITabItem, list?: ITabItem[]) => void;
2929
hideAdd?: boolean;
3030
type?: 'line';
@@ -48,7 +48,7 @@ export default memo<IProps>((props) => {
4848
concealTabHeader,
4949
} = props;
5050
const [internalTabs, setInternalTabs] = useState<ITabItem[]>([]);
51-
const [internalActiveTab, setInternalActiveTab] = useState<number | string | undefined>();
51+
const [internalActiveTab, setInternalActiveTab] = useState<number | string | null>(null);
5252
const [editingTab, setEditingTab] = useState<ITabItem['key'] | undefined>();
5353

5454
useEffect(() => {
@@ -85,7 +85,7 @@ export default memo<IProps>((props) => {
8585
onEdit?.('remove', data, newInternalTabs);
8686
}
8787

88-
function changeTab(key: string | number | undefined) {
88+
function changeTab(key: string | number | null) {
8989
setInternalActiveTab(key);
9090
}
9191

chat2db-client/src/i18n/en-us/connection.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default {
2626
'connection.text.tryAgainDownload': 'Try again download',
2727
'connection.text.downloading': 'Downloading...',
2828
'connection.label.private': 'Private',
29-
'connection.label.shared': 'Shared',
30-
31-
};
29+
'connection.button.shared': 'Shared',
30+
'connection.button.createConnection': 'Create connection',
31+
'connection.tips.noConnection': 'You have not created any connections yet',
32+
};

chat2db-client/src/i18n/zh-cn/connection.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ export default {
2727
'connection.text.downloading': '下载中...',
2828
'connection.label.private': '私有',
2929
'connection.label.shared': '共享',
30+
'connection.button.createConnection': '创建连接',
31+
'connection.tips.noConnection': '您当前还没有创建任何连接',
3032
}

chat2db-client/src/layouts/index.tsx

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import React, { useEffect, useLayoutEffect, useState } from 'react';
22
import i18n, { isEn } from '@/i18n';
3-
import { Outlet, useNavigate } from 'umi';
3+
import { Outlet } from 'umi';
44
import { ConfigProvider, theme, Spin } from 'antd';
55
import { v4 as uuidv4 } from 'uuid';
66
import { getAntdThemeConfig, injectThemeVar } from '@/theme';
77
import { IVersionResponse } from '@/typings';
88
import miscService from '@/service/misc';
9-
import { getUser } from '@/service/user';
109
import antdEnUS from 'antd/locale/en_US';
1110
import antdZhCN from 'antd/locale/zh_CN';
1211
import { useTheme } from '@/hooks';
@@ -77,13 +76,11 @@ export default function Layout() {
7776
const restartCount = 200;
7877

7978
function AppContainer() {
80-
const navigate = useNavigate();
8179
const { token } = useToken();
8280
const [initEnd, setInitEnd] = useState(false);
8381
const [appTheme, setAppTheme] = useTheme();
8482
const [startSchedule, setStartSchedule] = useState(0); // 0 初始状态 1 服务启动中 2 启动成功
8583
const [serviceFail, setServiceFail] = useState(false);
86-
const [isLogin, setIsLogin] = useState<boolean | null>(null);
8784

8885
useLayoutEffect(() => {
8986
collectInitApp();
@@ -93,18 +90,6 @@ function AppContainer() {
9390
injectThemeVar(token as any, appTheme.backgroundColor, appTheme.primaryColor);
9491
}, [token]);
9592

96-
function handelGetUserInfo() {
97-
getUser().then((res) => {
98-
if (!res) {
99-
navigate('/login');
100-
}
101-
// 向cookie中写入当前用户id
102-
const date = new Date('2030-12-30 12:30:00').toUTCString();
103-
document.cookie = `CHAT2DB.USER_ID=${res?.id};Expires=${date}`;
104-
setIsLogin(!!res);
105-
});
106-
}
107-
10893
// 初始化app
10994
function collectInitApp() {
11095
monitorOsTheme();
@@ -162,7 +147,6 @@ function AppContainer() {
162147
.then(() => {
163148
clearInterval(time);
164149
setStartSchedule(2);
165-
handelGetUserInfo();
166150
flag++;
167151
})
168152
.catch(() => {
@@ -181,7 +165,7 @@ function AppContainer() {
181165
{initEnd && (
182166
<div className={styles.app}>
183167
{/* 服务启动中 */}
184-
{(startSchedule < 2 || isLogin === null) && (
168+
{startSchedule < 2 && (
185169
<div className={styles.loadingBox}>
186170
<Spin spinning={!serviceFail} size="large" />
187171
{/* 状态等于1时,说明没服务起来需要轮训接口,这时可能服务配置又问题,需要设置来修改 */}
@@ -211,7 +195,7 @@ function AppContainer() {
211195
</div>
212196
)}
213197
{/* 服务启动完成 */}
214-
{startSchedule === 2 && isLogin !== null && <Outlet />}
198+
{startSchedule === 2 && <Outlet />}
215199
</div>
216200
)}
217201
{/* 全局的弹窗 */}

chat2db-client/src/pages/main/workspace/components/SaveList/index.less

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22

33
.saveModule {
44
flex-shrink: 0;
5-
padding-top: 6px;
65
}
76

87
.leftModuleTitle {
98
flex-shrink: 0;
109
margin-bottom: 4px;
1110
padding: 0px 10px;
11+
height: 32px;
12+
display: flex;
13+
align-items: center;
1214
.leftModuleTitleText {
15+
width: 100%;
1316
display: flex;
1417
justify-content: space-between;
1518
align-items: center;
@@ -42,6 +45,11 @@
4245
}
4346
}
4447

48+
.loadingContent {
49+
height: auto;
50+
padding-bottom: 4px;
51+
}
52+
4553
.saveBoxList {
4654
padding: 0px 10px;
4755
height: calc(26px * 3 + 6px);

chat2db-client/src/pages/main/workspace/components/WorkspaceHeader/index.less

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,27 @@
1414
height: 36px;
1515
}
1616

17-
.workspaceHeaderRight{
17+
.workspaceHeaderRight {
1818
width: 0px;
1919
flex: 1;
2020
flex-shrink: 0;
2121
overflow: hidden;
2222
}
2323

24-
.workspaceHeaderLeft{
24+
.workspaceHeaderLeft {
2525
display: flex;
2626
align-items: center;
2727
flex: 1;
2828
}
2929

30-
.workspaceHeaderCenter{
30+
.workspaceHeaderCenter {
3131
flex-shrink: 0;
3232
display: flex;
3333
justify-content: center;
3434
padding: 0px 40px;
3535
}
3636

37-
.databaseTypeIcon{
37+
.databaseTypeIcon {
3838
margin-right: 10px;
3939
font-weight: 400;
4040
color: var(--color-primary);
@@ -83,7 +83,7 @@
8383
}
8484
}
8585

86-
.arrow{
86+
.arrow {
8787
flex-shrink: 0;
8888
font-size: 10px;
8989
margin: 0px 4px;
@@ -97,8 +97,25 @@
9797

9898
.noConnectionModal {
9999
display: flex;
100-
justify-content: space-between;
101-
100+
flex-direction: column;
101+
align-items: center;
102+
.icon {
103+
font-size: 60px;
104+
margin: 10px 0px;
105+
color: var(--color-text-secondary);
106+
}
102107
.mainText {
108+
display: flex;
109+
align-items: center;
110+
justify-content: center;
111+
font-size: 18px;
112+
}
113+
.createButton {
114+
font-size: 16px;
115+
color: var(--color-primary);
116+
cursor: pointer;
117+
&:hover {
118+
text-decoration: underline;
119+
}
103120
}
104121
}

0 commit comments

Comments
 (0)