Skip to content

Commit

Permalink
调整工程
Browse files Browse the repository at this point in the history
  • Loading branch information
bktNULL committed Nov 17, 2022
1 parent 6b01080 commit 0b6c41f
Show file tree
Hide file tree
Showing 165 changed files with 23,049 additions and 1,215 deletions.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
.idea
/vendor
vendor
out
go.sum

node_modules
dist
.umi
.umi-production
16 changes: 16 additions & 0 deletions admin/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
8 changes: 8 additions & 0 deletions admin/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/lambda/
/scripts
/config
.history
public
dist
.umi
mock
8 changes: 8 additions & 0 deletions admin/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
extends: [require.resolve('@umijs/fabric/dist/eslint')],
globals: {
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true,
page: true,
REACT_APP_ENV: true,
},
};
23 changes: 23 additions & 0 deletions admin/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**/*.svg
package.json
.umi
.umi-production
/dist
.dockerignore
.DS_Store
.eslintignore
*.png
*.toml
docker
.editorconfig
Dockerfile*
.gitignore
.prettierignore
LICENSE
.eslintcache
*.lock
yarn-error.log
.history
CNAME
/build
/public
5 changes: 5 additions & 0 deletions admin/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const fabric = require('@umijs/fabric');

module.exports = {
...fabric.prettier,
};
5 changes: 5 additions & 0 deletions admin/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const fabric = require('@umijs/fabric');

module.exports = {
...fabric.stylelint,
};
15 changes: 15 additions & 0 deletions admin/config/config.dev.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// https://umijs.org/config/
import { defineConfig } from 'umi';

export default defineConfig({
plugins: [
// https://github.com/zthxxx/react-dev-inspector
'react-dev-inspector/plugins/umi/react-inspector',
],
// https://github.com/zthxxx/react-dev-inspector#inspector-loader-props
inspectorConfig: {
exclude: [],
babelPlugins: [],
babelOptions: {},
},
});
57 changes: 57 additions & 0 deletions admin/config/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// https://umijs.org/config/
import { defineConfig } from 'umi';

import defaultSettings from './defaultSettings';
import proxy from './proxy';
import routes from './routes';

const { REACT_APP_ENV } = process.env;

export default defineConfig({
hash: true,
antd: {},
dva: {
hmr: true,
},
layout: {
// https://umijs.org/zh-CN/plugins/plugin-layout
locale: true,
siderWidth: 208,
...defaultSettings,
},
// https://umijs.org/zh-CN/plugins/plugin-locale
locale: {
// default zh-CN
default: 'zh-CN',
antd: true,
// default true, when it is true, will use `navigator.language` overwrite default
baseNavigator: true,
},
dynamicImport: {
loading: '@ant-design/pro-layout/es/PageLoading',
},
targets: {
ie: 11,
},
// umi routes: https://umijs.org/docs/routing
routes,
// Theme for antd: https://ant.design/docs/react/customize-theme-cn
theme: {
'primary-color': defaultSettings.primaryColor,
},
// esbuild is father build tools
// https://umijs.org/plugins/plugin-esbuild
esbuild: {},
title: false,
ignoreMomentLocale: true,
proxy: proxy[REACT_APP_ENV || 'dev'],
manifest: {
basePath: '/',
},
// Fast Refresh 热更新
fastRefresh: {},
nodeModulesTransform: { type: 'none' },
mfsu: {},
webpack5: {},
exportStatic: {},
});
21 changes: 21 additions & 0 deletions admin/config/defaultSettings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Settings as LayoutSettings } from '@ant-design/pro-layout';

const Settings: LayoutSettings & {
pwa?: boolean;
logo?: string;
} = {
navTheme: 'light',
// 拂晓蓝
primaryColor: '#1890ff',
layout: 'mix',
contentWidth: 'Fluid',
fixedHeader: false,
fixSiderbar: true,
colorWeak: false,
title: 'CheerIngress',
pwa: false,
logo: '/logo.svg',
iconfontUrl: '',
};

export default Settings;
36 changes: 36 additions & 0 deletions admin/config/proxy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
* -------------------------------
* The agent cannot take effect in the production environment
* so there is no configuration of the production environment
* For details, please see
* https://pro.ant.design/docs/deploy
*/
export default {
dev: {
'/api/': {
target: 'https://preview.pro.ant.design',
changeOrigin: true,
pathRewrite: { '^': '' },
},
'/xapi/': {
target: 'http://127.0.0.1:16666',
changeOrigin: true,
pathRewrite: { '^': '' },
},
},
test: {
'/api/': {
target: 'https://preview.pro.ant.design',
changeOrigin: true,
pathRewrite: { '^': '' },
},
},
pre: {
'/api/': {
target: 'your pre url',
changeOrigin: true,
pathRewrite: { '^': '' },
},
},
};
62 changes: 62 additions & 0 deletions admin/config/routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
export default [
{
path: '/account',
routes: [
{
path: '/account',
routes: [
{
name: 'login',
path: '/account/login',
layout: false,
component: './Account/Login',
},
{
name: 'settings',
path: '/account/settings',
component: './Account/Setting',
},
],
},
{
component: './404',
},
],
},
{
name: 'namespace',
icon: 'database',
path: '/app/namespace',
component: '@/pages/App/Namespace',
},
{
name: 'action',
icon: 'code',
path: '/app/action',
routes: [
{
name: 'backend',
path: '/app/action/backend',
component: '@/pages/App/Action/Backend',
},
{
name: 'static',
path: '/app/action/static',
component: '@/pages/App/Action/Static',
},
],
},
{
name: 'site',
icon: 'cluster',
path: '/app/site',
component: '@/pages/App/Site',
},
{
path: '/',
redirect: '/app/namespace',
},
{
component: './404',
},
];
10 changes: 10 additions & 0 deletions admin/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
testURL: 'http://localhost:8000',
testEnvironment: './tests/PuppeteerEnvironment',
verbose: false,
extraSetupFiles: ['./tests/setupTests.js'],
globals: {
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: false,
localStorage: null,
},
};
11 changes: 11 additions & 0 deletions admin/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"jsx": "react-jsx",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}
Loading

0 comments on commit 0b6c41f

Please sign in to comment.