Skip to content

Commit 131e87d

Browse files
committed
feat: FE Packages
1 parent 6b3b356 commit 131e87d

18 files changed

Lines changed: 169 additions & 45 deletions

File tree

.vscode/settings.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"cSpell.words": [
3+
"ahooks",
4+
"antd",
5+
"asar",
6+
"Dserver",
7+
"Dspring",
8+
"echarts",
9+
"nsis",
10+
"pgsql",
11+
"Sercurity",
12+
"sortablejs"
13+
]
14+
}

chat2db-client/.umirc.prod.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { formatDate } from './src/utils/date';
22
import { defineConfig } from 'umi';
33
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
4-
const UMI_PublicPath = process.env.UMI_PublicPath || '/static/front/';
4+
const UMI_PublicPath = process.env.UMI_PublicPath || './';
55

66
const chainWebpack = (config: any, { webpack }: any) => {
77
config.plugin('monaco-editor').use(MonacoWebpackPlugin, [
@@ -10,13 +10,16 @@ const chainWebpack = (config: any, { webpack }: any) => {
1010
},
1111
]);
1212

13-
config.plugin('define').use(require('webpack').DefinePlugin, [{
14-
__BUILD_TIME__: JSON.stringify(formatDate(new Date(),'yyyyMMddhhmmss')),
15-
__APP_VERSION__: JSON.stringify(process.env.APP_VERSION || '0.0.0'),
16-
}]);
13+
config.plugin('define').use(require('webpack').DefinePlugin, [
14+
{
15+
__BUILD_TIME__: JSON.stringify(formatDate(new Date(), 'yyyyMMddhhmmss')),
16+
__APP_VERSION__: JSON.stringify(process.env.APP_VERSION || '0.0.0'),
17+
},
18+
]);
1719
};
1820

1921
export default defineConfig({
2022
publicPath: UMI_PublicPath,
21-
chainWebpack
23+
chainWebpack,
24+
headScripts: ['if (window.myAPI) { window.myAPI.startServerForSpawn() }'],
2225
});

chat2db-client/.umirc.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ const chainWebpack = (config: any, { webpack }: any) => {
1919

2020
export default defineConfig({
2121
title: 'Chat2DB',
22+
history: {
23+
type: 'hash',
24+
},
2225
base: '/',
2326
publicPath: '/',
27+
hash: false,
2428
routes: [
2529
{ path: '/demo', component: '@/pages/demo' },
2630
{ path: '/connections', component: 'main' },
@@ -39,4 +43,5 @@ export default defineConfig({
3943
changeOrigin: true,
4044
},
4145
},
46+
headScripts: ['if (window.myAPI) { window.myAPI.startServerForSpawn() }'],
4247
});

chat2db-client/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"build": "npm run build:web && npm run build:main",
99
"build:main": "cross-env NODE_ENV=development electron-builder",
1010
"build:main:prod": "cross-env NODE_ENV=production electron-builder",
11+
"build:prod": "npm run build:web:prod && npm run build:main:prod",
1112
"build:web": "umi build",
13+
"build:web:prod": "cross-env UMI_ENV=prod cross-env APP_VERSION=${npm_config_appVersion} cross-env APP_PORT=${npm_config_appPort} umi build",
1214
"postinstall": "umi setup",
1315
"lint": "umi lint",
1416
"start": "concurrently \"npm run start:web\" \"npm run start:main\"",
@@ -59,9 +61,10 @@
5961
"output": "release/"
6062
},
6163
"productName": "Chat2DB",
62-
"asar": true,
64+
"asar": false,
6365
"files": [
6466
"dist/",
67+
"static/",
6568
"src/main",
6669
"node_modules/",
6770
"package.json"

chat2db-client/src/assets/font/iconfont.css

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
@font-face {
22
font-family: "iconfont"; /* Project id 3633546 */
3-
src: url('iconfont.woff2?t=1685165802134') format('woff2'),
4-
url('iconfont.woff?t=1685165802134') format('woff'),
5-
url('iconfont.ttf?t=1685165802134') format('truetype');
3+
src: url('iconfont.woff2?t=1687510856958') format('woff2'),
4+
url('iconfont.woff?t=1687510856958') format('woff'),
5+
url('iconfont.ttf?t=1687510856958') format('truetype');
66
}
77

88
.iconfont {
@@ -13,6 +13,62 @@
1313
-moz-osx-font-smoothing: grayscale;
1414
}
1515

16+
.icon-24gl-folderMinus:before {
17+
content: "\eabe";
18+
}
19+
20+
.icon-24gl-folderOpen:before {
21+
content: "\eabf";
22+
}
23+
24+
.icon-24gf-folderOpen:before {
25+
content: "\eac7";
26+
}
27+
28+
.icon-yunshujuku:before {
29+
content: "\e744";
30+
}
31+
32+
.icon-baobiao:before {
33+
content: "\e612";
34+
}
35+
36+
.icon-gongzuotai:before {
37+
content: "\e614";
38+
}
39+
40+
.icon-mongodb:before {
41+
content: "\ec21";
42+
}
43+
44+
.icon-Redis:before {
45+
content: "\e6a2";
46+
}
47+
48+
.icon-HIVE:before {
49+
content: "\e60e";
50+
}
51+
52+
.icon-Kingbase:before {
53+
content: "\e6a0";
54+
}
55+
56+
.icon-yibiaopan:before {
57+
content: "\e60d";
58+
}
59+
60+
.icon-presto_sql:before {
61+
content: "\e60b";
62+
}
63+
64+
.icon-shujukuleixingtubiao-kuozhan-:before {
65+
content: "\e60a";
66+
}
67+
68+
.icon-oceanbase:before {
69+
content: "\e982";
70+
}
71+
1672
.icon-dameng1:before {
1773
content: "\e655";
1874
}
5.96 KB
Binary file not shown.
3.97 KB
Binary file not shown.
3.2 KB
Binary file not shown.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,10 @@ function RenderForm(props: IRenderFormProps) {
350350
if (keyName === 'host' && !aliasChanged) {
351351
newData.alias = '@' + keyValue;
352352
}
353-
console.log({
354-
...dataObj,
355-
...newData,
356-
});
353+
// console.log({
354+
// ...dataObj,
355+
// ...newData,
356+
// });
357357
form.setFieldsValue({
358358
...dataObj,
359359
...newData,
Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
import React, { PureComponent } from 'react';
22
import classnames from 'classnames';
3-
// import desktopStyle from './desktop.less';
4-
// TODO: windows端加载cdn资源报错
3+
import desktopStyle from './desktop.less';
54
import prodStyle from './prod.less';
6-
export default class Iconfont extends PureComponent<{
7-
code: string;
8-
} & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>> {
5+
6+
export default class Iconfont extends PureComponent<
7+
{
8+
code: string;
9+
} & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>
10+
> {
911
render() {
10-
// const styles = window._ENV !== 'prod' ? desktopStyle : prodStyle
11-
const styles = prodStyle;
12-
return <i {...this.props} className={classnames(this.props.className, styles.iconfont)}>{this.props.code}</i>
12+
const styles = window._ENV !== 'prod' ? desktopStyle : prodStyle;
13+
// const styles = prodStyle;
14+
return (
15+
<i {...this.props} className={classnames(this.props.className, styles.iconfont)}>
16+
{this.props.code}
17+
</i>
18+
);
1319
}
1420
}

0 commit comments

Comments
 (0)