Skip to content

Commit e643431

Browse files
committed
zancun
2 parents 25b1d06 + 92bbbb7 commit e643431

13 files changed

Lines changed: 185 additions & 71 deletions

File tree

.github/workflows/release_test.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,14 @@ jobs:
7474
- name: Copy Jre for Windows
7575
if: ${{ runner.os == 'Windows' }}
7676
run: |
77+
mkdir chat2db-client/static
7778
cp -r "${{ env.JAVA_HOME }}" chat2db-client/static/jre
7879
7980
# 复制jre macOS
8081
- name: Copy Jre for macOS
8182
if: ${{ runner.os == 'macOS' }}
8283
run: |
84+
mkdir chat2db-client/static
8385
cp -r $JAVA_HOME chat2db-client/static/jre
8486
chmod -R 777 chat2db-client/static/jre/
8587
@@ -103,15 +105,15 @@ jobs:
103105
cd chat2db-client
104106
npm install
105107
npm run build:web:prod --appVersion=${{ steps.chat2db_version.outputs.substring }} --appPort=10822
106-
# cp -r dist ../ali-dbhub-server/ali-dbhub-server-start/src/main/resources/static/front
108+
# cp -r dist ../chat2db-server/chat2db-server-start/src/main/resources/static/front
107109
# 编译服务端java版本
108110
- name: Build Java
109-
run: mvn clean package -B '-Dmaven.test.skip=true' -f ali-dbhub-server/pom.xml
111+
run: mvn clean package -B '-Dmaven.test.skip=true' -f chat2db-server/pom.xml
110112

111113
# 复制服务端java 到指定位置
112114
- name: Copy App
113115
run: |
114-
cp ali-dbhub-server/ali-dbhub-server-start/target/ali-dbhub-server-start.jar chat2db-client/static/
116+
cp chat2db-server/chat2db-server-start/target/chat2db-server-start.jar chat2db-client/static/
115117
116118
- name: npm install electron
117119
run: |
@@ -230,7 +232,7 @@ jobs:
230232
content: |
231233
{
232234
"title": "MacOS-amd64-test-构建完成通知",
233-
"text": "# MacOS-amd64-test-打包完成通知 \n ![bang](https://oss-chat2db.alibaba.com/static/bang100.gif) \n ### 任务id:[${{ github.run_id }}](https://github.com/alibaba/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Intel芯片下载地址:[https://oss-chat2db.alibaba.com/test/mac/amd/Chat2DB-Test-1.0.${{ github.run_id }}-Test.dmg](https://oss-chat2db.alibaba.com/test/mac/amd/Chat2DB-Test-1.0.${{ github.run_id }}-Test.dmg) \n ### jar包下载地址:[https://oss-chat2db.alibaba.com/test/jar/${{ github.run_id }}/ali-dbhub-server-start.jar](https://oss-chat2db.alibaba.com/test/jar/${{ github.run_id }}/ali-dbhub-server-start.jar) "
235+
"text": "# MacOS-amd64-test-打包完成通知 \n ![bang](https://oss-chat2db.alibaba.com/static/bang100.gif) \n ### 任务id:[${{ github.run_id }}](https://github.com/alibaba/Chat2DB/actions/runs/${{ github.run_id }}) \n ### Intel芯片下载地址:[https://oss-chat2db.alibaba.com/test/mac/amd/Chat2DB-Test-1.0.${{ github.run_id }}-Test.dmg](https://oss-chat2db.alibaba.com/test/mac/amd/Chat2DB-Test-1.0.${{ github.run_id }}-Test.dmg) \n ### jar包下载地址:[https://oss-chat2db.alibaba.com/test/jar/${{ github.run_id }}/chat2db-server-start.jar](https://oss-chat2db.alibaba.com/test/jar/${{ github.run_id }}/chat2db-server-start.jar) "
234236
}
235237
236238
# 构建完成通知

chat2db-client/.umirc.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@ export default defineConfig({
4444
},
4545
},
4646
headScripts: ['if (window.myAPI) { window.myAPI.startServerForSpawn() }'],
47+
favicons: ['logo.ico'],
4748
});

chat2db-client/public/logo.ico

9.59 KB
Binary file not shown.

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ export default function CreateConnection(props: IProps) {
147147
? i18n('common.message.modifySuccessfully')
148148
: i18n('common.message.addedSuccessfully'),
149149
);
150+
151+
if (type === submitType.SAVE) {
152+
setBackfillData({
153+
...backfillData,
154+
id: res,
155+
});
156+
}
150157
}
151158
})
152159
.finally(() => {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ export default {
1717
'connection.message.testSshConnection': 'Test the ssh connection',
1818
'connection.tableHeader.name': 'Name',
1919
'connection.tableHeader.value': 'Value',
20+
'connection.menu.enterToWorkSpace': 'Go to DataSource',
2021
};

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ export default {
1717
'connection.message.testSshConnection': '测试ssh连接',
1818
'connection.tableHeader.name': '名称',
1919
'connection.tableHeader.value': '值',
20+
'connection.menu.enterToWorkSpace': '前往数据源',
2021
}

chat2db-client/src/pages/main/connections/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ export default memo<IProps>(function Connections(props) {
8181
<Dropdown
8282
menu={{
8383
items: [
84+
{
85+
key: 'EnterWorkSpace',
86+
label: i18n('connection.menu.enterToWorkSpace'),
87+
onClick: () => {
88+
window.location.replace('/workspace');
89+
},
90+
},
8491
{
8592
key: 'Delete',
8693
label: i18n('common.button.delete'),

chat2db-client/src/pages/main/dashboard/index.less

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
@import '../../../styles/var.less';
2+
13
.box {
24
display: flex;
35
background-color: var(--color-bg);
46
height: 100%;
57
width: 100%;
6-
font-family: Helvetica;
78
}
89

910
.boxLeft {
@@ -23,14 +24,22 @@
2324

2425
.boxLeftTitle {
2526
font-size: 20px;
26-
// color: rgba(0, 0, 0);
2727
line-height: 24px;
2828
font-weight: 500;
2929
margin-bottom: 40px;
30-
padding-left: 24px;
30+
padding-left: 20px;
3131
padding-right: 8px;
3232
display: flex;
3333
justify-content: space-between;
34+
align-items: center;
35+
}
36+
.plusIcon {
37+
font-size: 18px;
38+
padding: 2px;
39+
cursor: pointer;
40+
&:hover {
41+
background-color: var(--color-hover-bg);
42+
}
3443
}
3544

3645
.boxLeftItem {
@@ -56,12 +65,10 @@
5665
}
5766
}
5867

59-
6068
.activeItem {
6169
background-color: var(--color-bg-elevated);
6270
}
6371

64-
6572
.boxRight {
6673
flex: 1;
6774
padding: 24px 40px;
@@ -78,10 +85,10 @@
7885
margin-bottom: 24px;
7986
}
8087

81-
.boxRightContent {}
88+
.boxRightContent {
89+
}
8290

8391
.boxRightContentRow {
84-
8592
display: flex;
8693
}
8794

@@ -92,4 +99,4 @@
9299
&:last-child {
93100
margin-right: 0px;
94101
}
95-
}
102+
}

chat2db-client/src/pages/main/dashboard/index.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
updateChart,
1818
updateDashboard,
1919
} from '@/service/dashboard';
20-
import { MoreOutlined, PlusOutlined } from '@ant-design/icons';
20+
import { MoreOutlined } from '@ant-design/icons';
2121
import styles from './index.less';
2222
import i18n from '@/i18n';
2323

@@ -234,7 +234,7 @@ function Chart(props: IProps) {
234234
<div className={styles.boxLeft}>
235235
<div className={styles.boxLeftTitle}>
236236
<div>{i18n('dashboard.title')}</div>
237-
<PlusOutlined onClick={() => setOpenAddDashboard(true)} />
237+
<Iconfont code="&#xe631;" className={styles.plusIcon} onClick={() => setOpenAddDashboard(true)} />
238238
</div>
239239
{renderLeft()}
240240
</div>
@@ -270,18 +270,13 @@ function Chart(props: IProps) {
270270
okText="Confirm"
271271
cancelText="Cancel"
272272
>
273-
<Form form={form} autoComplete={'off'}>
273+
<Form labelCol={{ span: 4 }} wrapperCol={{ span: 20 }} form={form} autoComplete={'off'}>
274274
<Form.Item label={'name'} name={'name'} rules={[{ required: true, message: 'Please input your name' }]}>
275275
<Input />
276276
</Form.Item>
277277
<Form.Item label={'description'} name={'description'}>
278278
<Input.TextArea />
279279
</Form.Item>
280-
{/* <Form.Item>
281-
<Button type="primary" onClick={onCheck}>
282-
Check
283-
</Button>
284-
</Form.Item> */}
285280
</Form>
286281
</Modal>
287282
</>

chat2db-client/src/pages/main/workspace/components/WorkspaceLeft/index.tsx

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Tree from '../Tree';
99
import Iconfont from '@/components/Iconfont';
1010
import LoadingContent from '@/components/Loading/LoadingContent';
1111
import { TreeNodeType } from '@/constants/tree';
12-
import { ITreeNode } from '@/typings/tree'
12+
import { ITreeNode } from '@/typings/tree';
1313
import { useReducerContext } from '../../index';
1414
import { workspaceActionType } from '../../context';
1515
interface IProps {
@@ -19,15 +19,25 @@ interface IProps {
1919
export default memo<IProps>(function WorkspaceLeft(props) {
2020
const { className } = props;
2121

22-
return <div className={classnames(styles.box, className)}>
23-
<div className={styles.header}>
24-
<RenderSelectDatabase></RenderSelectDatabase>
22+
return (
23+
<div className={classnames(styles.box, className)}>
24+
<div className={styles.header}>
25+
<RenderSelectDatabase></RenderSelectDatabase>
26+
</div>
27+
<div className={styles.save_box}>Save</div>
28+
<Divider />
29+
<RenderTableBox></RenderTableBox>
2530
</div>
31+
<<<<<<< HEAD
2632
<RenderSaveBox></RenderSaveBox>
2733
<Divider />
2834
<RenderTableBox></RenderTableBox>
2935
</div>
3036
})
37+
=======
38+
);
39+
});
40+
>>>>>>> 92bbbb7a2c26113765f2a43d9fb6eaa27db66463
3141

3242
interface Option {
3343
value: number;
@@ -49,18 +59,18 @@ function RenderSelectDatabase() {
4959
pageNo: 1,
5060
pageSize: 999,
5161
};
52-
treeConfig[TreeNodeType.DATA_SOURCES].getChildren!(p).then(res => {
62+
treeConfig[TreeNodeType.DATA_SOURCES].getChildren!(p).then((res) => {
5363
let newOptions: any = res.map((t) => {
5464
return {
5565
label: t.name,
5666
value: t.key,
5767
type: TreeNodeType.DATA_SOURCE,
5868
isLeaf: false,
59-
databaseType: t.extraParams?.databaseType
69+
databaseType: t.extraParams?.databaseType,
6070
};
6171
});
6272
setOptions(newOptions);
63-
})
73+
});
6474
}
6575

6676
const onChange: any = (valueArr: any, selectedOptions: any) => {
@@ -74,36 +84,36 @@ function RenderSelectDatabase() {
7484
databaseSourceName: labelArr[0],
7585
databaseName: labelArr[1],
7686
schemaName: labelArr[2],
77-
databaseType: selectedOptions[0].databaseType
78-
}
87+
databaseType: selectedOptions[0].databaseType,
88+
};
7989

8090
dispatch({
8191
type: workspaceActionType.CURRENT_WORKSPACE_DATA,
82-
payload: currentWorkspaceData
92+
payload: currentWorkspaceData,
8393
});
8494
};
8595

8696
// 及联loadData
8797
const loadData = (selectedOptions: any) => {
8898
if (selectedOptions.length > 1) {
89-
return
99+
return;
90100
}
91101

92102
const targetOption = selectedOptions[0];
93103
treeConfig[TreeNodeType.DATA_SOURCE].getChildren!({
94-
id: targetOption.value
95-
}).then(res => {
104+
id: targetOption.value,
105+
}).then((res) => {
96106
let newOptions = res.map((t) => {
97107
return {
98108
label: t.name,
99109
value: t.key,
100110
type: TreeNodeType.DATABASE,
101-
databaseType: t.extraParams?.databaseType
111+
databaseType: t.extraParams?.databaseType,
102112
};
103113
});
104114
targetOption.children = newOptions;
105115
setOptions([...(options || [])]);
106-
})
116+
});
107117

108118
// TODO:根据后端字段 如果有SCHEMAS再去查询SCHEMAS
109119
// if (targetOption.type === TreeNodeType.SCHEMAS) {
@@ -122,7 +132,6 @@ function RenderSelectDatabase() {
122132
// })
123133
// } else {
124134
// }
125-
126135
};
127136

128137
const dropdownRender = (menus: React.ReactNode) => (
@@ -134,7 +143,7 @@ function RenderSelectDatabase() {
134143

135144
function renderCurrentSelected() {
136145
const { databaseName, schemaName, databaseSourceName } = currentWorkspaceData;
137-
const currentSelectedArr = [databaseSourceName, databaseName, schemaName].filter(t => t);
146+
const currentSelectedArr = [databaseSourceName, databaseName, schemaName].filter((t) => t);
138147
return currentSelectedArr.join('/');
139148
}
140149

@@ -147,16 +156,17 @@ function RenderSelectDatabase() {
147156
loadData={loadData}
148157
bordered={false}
149158
dropdownRender={dropdownRender}
159+
placeholder={'xxxxxxx'}
150160
>
151161
<div className={styles.current_database}>
152-
<div className={styles.name}>
153-
{renderCurrentSelected()}
154-
</div>
162+
<div className={styles.name}>{renderCurrentSelected()}</div>
155163
<Iconfont code="&#xe608;" />
156164
</div>
157165
</Cascader>
158166
<div className={styles.other_operations}>
159-
<div className={styles.icon_box}><Iconfont code='&#xec08;' /></div>
167+
<div className={styles.icon_box}>
168+
<Iconfont code="&#xec08;" />
169+
</div>
160170
</div>
161171
</div>
162172
);
@@ -169,22 +179,30 @@ function RenderTableBox() {
169179

170180
useEffect(() => {
171181
getInitialData();
172-
}, [currentWorkspaceData])
182+
}, [currentWorkspaceData]);
173183

174184
function getInitialData() {
175185
treeConfig[TreeNodeType.TABLES].getChildren!({
176186
pageNo: 1,
177187
pageSize: 999,
178188
...currentWorkspaceData,
179-
extraParams: currentWorkspaceData
180-
}).then(res => {
189+
extraParams: currentWorkspaceData,
190+
}).then((res) => {
181191
setInitialData(res);
182-
})
192+
});
183193
}
184194

195+
<<<<<<< HEAD
185196
return <div className={styles.table_box}>
186197
<Tree className={styles.tree} initialData={initialData}></Tree>
187198
</div>
199+
=======
200+
return (
201+
<div className={styles.table_box}>
202+
<Tree className={styles.tree} initialData={initialData}></Tree>
203+
</div>
204+
);
205+
>>>>>>> 92bbbb7a2c26113765f2a43d9fb6eaa27db66463
188206
}
189207

190208
function RenderSaveBox(){

0 commit comments

Comments
 (0)