Merge branch 'master' into shiyang
# Conflicts: # app/web/config/router.config.js
This commit is contained in:
commit
4f31d70c98
|
@ -16,3 +16,7 @@ config/manifest.json
|
||||||
app/web/.temp
|
app/web/.temp
|
||||||
.umi
|
.umi
|
||||||
docker/.node_modules/*
|
docker/.node_modules/*
|
||||||
|
.vscode/
|
||||||
|
.umi*
|
||||||
|
|
||||||
|
data
|
20
README.md
20
README.md
|
@ -38,7 +38,7 @@ npm run docker:build
|
||||||
cnpm run docker:dev
|
cnpm run docker:dev
|
||||||
```
|
```
|
||||||
|
|
||||||
启动完成,稍等片刻,打开 http://localhost:10000/,手动刷新即可看到最新的更改。
|
启动完成,稍等片刻,打开 http://localhost:7001/,手动刷新即可看到最新的更改。
|
||||||
|
|
||||||
#### 手动更新开发镜像
|
#### 手动更新开发镜像
|
||||||
|
|
||||||
|
@ -70,7 +70,9 @@ cnpm install
|
||||||
cnpm run dev
|
cnpm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
在浏览器中访问:[http://localhost:8000](http://localhost:8000)
|
后端开发:在浏览器中访问:[http://localhost:7001](http://localhost:7001) ,使用真实接口实现;
|
||||||
|
|
||||||
|
前端开发:在浏览器中访问:[http://localhost:10000](http://localhost:10000),使用 Mock 接口数据。
|
||||||
|
|
||||||
|
|
||||||
### 构建和部署
|
### 构建和部署
|
||||||
|
@ -79,9 +81,21 @@ cnpm run dev
|
||||||
cnpm run build
|
cnpm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
执行该命令后会生成最终的 HTML、CSS 和 JS 到 `dist` 目录下。它们是浏览器可以直接识别并运行的代码,这样你就可以将它们部署到你想要的服务器上了。
|
执行该命令后会生成最终的 HTML、CSS 和 JS 到 `app/public` 目录下。它们是浏览器可以直接识别并运行的代码,这样你就可以将它们部署到你想要的服务器上了。
|
||||||
|
|
||||||
|
或者使用 Docker 来运行最终的程序。
|
||||||
|
```
|
||||||
|
cnpm run docker:prod
|
||||||
|
```
|
||||||
|
启动完成,稍等片刻,打开 http://localhost:8001/,即可看到最终的程序界面。
|
||||||
|
|
||||||
### 新增项目依赖包
|
### 新增项目依赖包
|
||||||
```
|
```
|
||||||
cnpm install --save md5
|
cnpm install --save md5
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 启动 MySQL 服务器
|
||||||
|
```
|
||||||
|
npm run docker:start-mysql
|
||||||
|
```
|
||||||
|
端口 3306,默认 root 密码 admin
|
|
@ -6,6 +6,7 @@
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
|
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
|
||||||
<meta name="format-detection" content="telephone=no"/>
|
<meta name="format-detection" content="telephone=no"/>
|
||||||
<meta name="format-detection" content="email=no"/>
|
<meta name="format-detection" content="email=no"/>
|
||||||
|
<link rel="icon" href="/public/favicon.ico" type="image/x-icon">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
|
||||||
<title></title>
|
<title></title>
|
||||||
{{ helper.assets.getStyle('umi.css') | safe }}
|
{{ helper.assets.getStyle('umi.css') | safe }}
|
||||||
|
|
|
@ -178,13 +178,13 @@ class BasicLayout extends React.PureComponent {
|
||||||
const currRouterData = this.matchParamsPath(pathname);
|
const currRouterData = this.matchParamsPath(pathname);
|
||||||
|
|
||||||
if (!currRouterData) {
|
if (!currRouterData) {
|
||||||
return 'Ant Design Pro';
|
return 'INFINI';
|
||||||
}
|
}
|
||||||
const message = formatMessage({
|
const message = formatMessage({
|
||||||
id: currRouterData.locale || currRouterData.name,
|
id: currRouterData.locale || currRouterData.name,
|
||||||
defaultMessage: currRouterData.name,
|
defaultMessage: currRouterData.name,
|
||||||
});
|
});
|
||||||
return `${message} - Ant Design Pro`;
|
return `${message} - INFINI`;
|
||||||
};
|
};
|
||||||
|
|
||||||
getLayoutStyle = () => {
|
getLayoutStyle = () => {
|
||||||
|
|
|
@ -31,22 +31,14 @@ const copyright = (
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const appname = formatMessage({ id: 'layout.user.appname' });
|
||||||
|
const appslogon = formatMessage({ id: 'layout.user.appslogon' });
|
||||||
|
|
||||||
class UserLayout extends React.PureComponent {
|
class UserLayout extends React.PureComponent {
|
||||||
// @TODO title
|
|
||||||
// getPageTitle() {
|
|
||||||
// const { routerData, location } = this.props;
|
|
||||||
// const { pathname } = location;
|
|
||||||
// let title = 'Ant Design Pro';
|
|
||||||
// if (routerData[pathname] && routerData[pathname].name) {
|
|
||||||
// title = `${routerData[pathname].name} - Ant Design Pro`;
|
|
||||||
// }
|
|
||||||
// return title;
|
|
||||||
// }
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { children } = this.props;
|
const { children } = this.props;
|
||||||
return (
|
return (
|
||||||
// @TODO <DocumentTitle title={this.getPageTitle()}>
|
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<div className={styles.lang}>
|
<div className={styles.lang}>
|
||||||
<SelectLang />
|
<SelectLang />
|
||||||
|
@ -56,10 +48,10 @@ class UserLayout extends React.PureComponent {
|
||||||
<div className={styles.header}>
|
<div className={styles.header}>
|
||||||
<Link to="/">
|
<Link to="/">
|
||||||
<img alt="logo" className={styles.logo} src={logo} />
|
<img alt="logo" className={styles.logo} src={logo} />
|
||||||
<span className={styles.title}>极限日志分析中心</span>
|
<span className={styles.title}>{appname}</span>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.desc}>极限科技的日志分析中心是东半球最好用的日志分析平台</div>
|
<div className={styles.desc}>{appslogon}</div>
|
||||||
</div>
|
</div>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
export default {
|
export default {
|
||||||
'navBar.lang': 'Languages',
|
'navBar.lang': 'Languages',
|
||||||
|
|
||||||
|
'layout.user.appname':"INFINI LOGGING CENTER",
|
||||||
|
'layout.user.appslogon':"INFINI logging center is the best log analysis platform in the world",
|
||||||
|
|
||||||
'layout.user.link.help': 'Help',
|
'layout.user.link.help': 'Help',
|
||||||
'layout.user.link.privacy': 'Privacy',
|
'layout.user.link.privacy': 'Privacy',
|
||||||
'layout.user.link.terms': 'Terms',
|
'layout.user.link.terms': 'Terms',
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
export default {
|
export default {
|
||||||
'navBar.lang': '语言',
|
'navBar.lang': '语言',
|
||||||
|
|
||||||
|
'layout.user.appname':"极限日志分析中心",
|
||||||
|
'layout.user.appslogon':"极限科技的日志分析中心是东半球最好用的日志分析平台",
|
||||||
|
|
||||||
'layout.user.link.help': '帮助',
|
'layout.user.link.help': '帮助',
|
||||||
'layout.user.link.privacy': '隐私',
|
'layout.user.link.privacy': '隐私',
|
||||||
'layout.user.link.terms': '条款',
|
'layout.user.link.terms': '条款',
|
||||||
|
|
||||||
'validation.email.required': '请输入邮箱地址!',
|
'validation.email.required': '请输入邮箱地址!',
|
||||||
'validation.email.wrong-format': '邮箱地址格式错误!',
|
'validation.email.wrong-format': '邮箱地址格式错误!',
|
||||||
'validation.password.required': '请输入密码!',
|
'validation.password.required': '请输入密码!',
|
||||||
|
@ -180,6 +185,8 @@ export default {
|
||||||
|
|
||||||
'app.setting.appname':"日志分析中心",
|
'app.setting.appname':"日志分析中心",
|
||||||
|
|
||||||
|
'app.login.appname':"日志分析中心",
|
||||||
|
|
||||||
'app.settings.menuMap.basic': '基本设置',
|
'app.settings.menuMap.basic': '基本设置',
|
||||||
'app.settings.menuMap.security': '安全设置',
|
'app.settings.menuMap.security': '安全设置',
|
||||||
'app.settings.menuMap.binding': '账号绑定',
|
'app.settings.menuMap.binding': '账号绑定',
|
||||||
|
|
|
@ -1,166 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import {
|
|
||||||
_setIntlObject,
|
|
||||||
addLocaleData,
|
|
||||||
IntlProvider,
|
|
||||||
intlShape,
|
|
||||||
LangContext,
|
|
||||||
_setLocaleContext
|
|
||||||
} from 'umi-plugin-locale/lib/locale';
|
|
||||||
|
|
||||||
const InjectedWrapper = (() => {
|
|
||||||
let sfc = (props, context) => {
|
|
||||||
_setIntlObject(context.intl);
|
|
||||||
return props.children;
|
|
||||||
};
|
|
||||||
sfc.contextTypes = {
|
|
||||||
intl: intlShape,
|
|
||||||
};
|
|
||||||
return sfc;
|
|
||||||
})();
|
|
||||||
|
|
||||||
import 'moment/locale/pt-br';
|
|
||||||
import 'moment/locale/zh-cn';
|
|
||||||
import 'moment/locale/zh-tw';
|
|
||||||
|
|
||||||
const baseNavigator = true;
|
|
||||||
const baseSeparator = '-';
|
|
||||||
const useLocalStorage = true;
|
|
||||||
|
|
||||||
import { LocaleProvider, version } from 'antd';
|
|
||||||
import moment from 'moment';
|
|
||||||
import 'moment/locale/zh-cn';
|
|
||||||
let defaultAntd = require('antd/lib/locale-provider/zh_CN');
|
|
||||||
defaultAntd = defaultAntd.default || defaultAntd;
|
|
||||||
|
|
||||||
const localeInfo = {
|
|
||||||
'en-US': {
|
|
||||||
messages: {
|
|
||||||
...((locale) => locale.__esModule ? locale.default : locale)(require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/locales/en-US.js')),
|
|
||||||
},
|
|
||||||
locale: 'en-US',
|
|
||||||
antd: require('antd/lib/locale-provider/en_US'),
|
|
||||||
data: require('react-intl/locale-data/en'),
|
|
||||||
momentLocale: '',
|
|
||||||
},
|
|
||||||
'pt-BR': {
|
|
||||||
messages: {
|
|
||||||
...((locale) => locale.__esModule ? locale.default : locale)(require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/locales/pt-BR.js')),
|
|
||||||
},
|
|
||||||
locale: 'pt-BR',
|
|
||||||
antd: require('antd/lib/locale-provider/pt_BR'),
|
|
||||||
data: require('react-intl/locale-data/pt'),
|
|
||||||
momentLocale: 'pt-br',
|
|
||||||
},
|
|
||||||
'zh-CN': {
|
|
||||||
messages: {
|
|
||||||
...((locale) => locale.__esModule ? locale.default : locale)(require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/locales/zh-CN.js')),
|
|
||||||
},
|
|
||||||
locale: 'zh-CN',
|
|
||||||
antd: require('antd/lib/locale-provider/zh_CN'),
|
|
||||||
data: require('react-intl/locale-data/zh'),
|
|
||||||
momentLocale: 'zh-cn',
|
|
||||||
},
|
|
||||||
'zh-TW': {
|
|
||||||
messages: {
|
|
||||||
...((locale) => locale.__esModule ? locale.default : locale)(require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/locales/zh-TW.js')),
|
|
||||||
},
|
|
||||||
locale: 'zh-TW',
|
|
||||||
antd: require('antd/lib/locale-provider/zh_TW'),
|
|
||||||
data: require('react-intl/locale-data/zh'),
|
|
||||||
momentLocale: 'zh-tw',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
class LocaleWrapper extends React.Component{
|
|
||||||
state = {
|
|
||||||
locale: 'zh-CN',
|
|
||||||
};
|
|
||||||
getAppLocale(){
|
|
||||||
let appLocale = {
|
|
||||||
locale: 'zh-CN',
|
|
||||||
messages: {},
|
|
||||||
data: require('react-intl/locale-data/zh'),
|
|
||||||
momentLocale: 'zh-cn',
|
|
||||||
};
|
|
||||||
|
|
||||||
const runtimeLocale = require('umi/_runtimePlugin').mergeConfig('locale') || {};
|
|
||||||
const runtimeLocaleDefault = typeof runtimeLocale.default === 'function' ? runtimeLocale.default() : runtimeLocale.default;
|
|
||||||
if (
|
|
||||||
useLocalStorage
|
|
||||||
&& typeof localStorage !== 'undefined'
|
|
||||||
&& localStorage.getItem('umi_locale')
|
|
||||||
&& localeInfo[localStorage.getItem('umi_locale')]
|
|
||||||
) {
|
|
||||||
appLocale = localeInfo[localStorage.getItem('umi_locale')];
|
|
||||||
} else if (
|
|
||||||
typeof navigator !== 'undefined'
|
|
||||||
&& localeInfo[navigator.language]
|
|
||||||
&& baseNavigator
|
|
||||||
) {
|
|
||||||
appLocale = localeInfo[navigator.language];
|
|
||||||
} else if(localeInfo[runtimeLocaleDefault]){
|
|
||||||
appLocale = localeInfo[runtimeLocaleDefault];
|
|
||||||
} else {
|
|
||||||
appLocale = localeInfo['zh-CN'] || appLocale;
|
|
||||||
}
|
|
||||||
window.g_lang = appLocale.locale;
|
|
||||||
window.g_langSeparator = baseSeparator || '-';
|
|
||||||
appLocale.data && addLocaleData(appLocale.data);
|
|
||||||
|
|
||||||
// support dynamic add messages for umi ui
|
|
||||||
// { 'zh-CN': { key: value }, 'en-US': { key: value } }
|
|
||||||
const runtimeLocaleMessagesType = typeof runtimeLocale.messages;
|
|
||||||
if (runtimeLocaleMessagesType === 'object' || runtimeLocaleMessagesType === 'function') {
|
|
||||||
const runtimeMessage = runtimeLocaleMessagesType === 'object'
|
|
||||||
? runtimeLocale.messages[appLocale.locale]
|
|
||||||
: runtimeLocale.messages()[appLocale.locale];
|
|
||||||
Object.assign(appLocale.messages, runtimeMessage || {});
|
|
||||||
}
|
|
||||||
|
|
||||||
return appLocale;
|
|
||||||
}
|
|
||||||
reloadAppLocale = () => {
|
|
||||||
const appLocale = this.getAppLocale();
|
|
||||||
this.setState({
|
|
||||||
locale: appLocale.locale,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
render(){
|
|
||||||
const appLocale = this.getAppLocale();
|
|
||||||
// react-intl must use `-` separator
|
|
||||||
const reactIntlLocale = appLocale.locale.split(baseSeparator).join('-');
|
|
||||||
const LangContextValue = {
|
|
||||||
locale: reactIntlLocale,
|
|
||||||
reloadAppLocale: this.reloadAppLocale,
|
|
||||||
};
|
|
||||||
let ret = this.props.children;
|
|
||||||
ret = (<IntlProvider locale={reactIntlLocale} messages={appLocale.messages}>
|
|
||||||
<InjectedWrapper>
|
|
||||||
<LangContext.Provider value={LangContextValue}>
|
|
||||||
<LangContext.Consumer>{(value) => {
|
|
||||||
_setLocaleContext(value);
|
|
||||||
return this.props.children
|
|
||||||
}}</LangContext.Consumer>
|
|
||||||
</LangContext.Provider>
|
|
||||||
</InjectedWrapper>
|
|
||||||
</IntlProvider>)
|
|
||||||
// avoid antd ConfigProvider not found
|
|
||||||
let AntdProvider = LocaleProvider;
|
|
||||||
const [major, minor] = `${version || ''}`.split('.');
|
|
||||||
// antd 3.21.0 use ConfigProvider not LocaleProvider
|
|
||||||
const isConfigProvider = Number(major) > 3 || (Number(major) >= 3 && Number(minor) >= 21);
|
|
||||||
if (isConfigProvider) {
|
|
||||||
try {
|
|
||||||
AntdProvider = require('antd/lib/config-provider').default;
|
|
||||||
} catch (e) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (<AntdProvider locale={appLocale.antd ? (appLocale.antd.default || appLocale.antd) : defaultAntd}>
|
|
||||||
{ret}
|
|
||||||
</AntdProvider>);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export default LocaleWrapper;
|
|
|
@ -1,42 +0,0 @@
|
||||||
import dva from 'dva';
|
|
||||||
import { Component } from 'react';
|
|
||||||
import createLoading from 'dva-loading';
|
|
||||||
import history from '@tmp/history';
|
|
||||||
|
|
||||||
let app = null;
|
|
||||||
|
|
||||||
export function _onCreate() {
|
|
||||||
const plugins = require('umi/_runtimePlugin');
|
|
||||||
const runtimeDva = plugins.mergeConfig('dva');
|
|
||||||
app = dva({
|
|
||||||
history,
|
|
||||||
|
|
||||||
...(runtimeDva.config || {}),
|
|
||||||
...(window.g_useSSR ? { initialState: window.g_initialData } : {}),
|
|
||||||
});
|
|
||||||
|
|
||||||
app.use(createLoading());
|
|
||||||
(runtimeDva.plugins || []).forEach(plugin => {
|
|
||||||
app.use(plugin);
|
|
||||||
});
|
|
||||||
|
|
||||||
app.model({ namespace: 'global', ...(require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/models/global.js').default) });
|
|
||||||
app.model({ namespace: 'list', ...(require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/models/list.js').default) });
|
|
||||||
app.model({ namespace: 'login', ...(require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/models/login.js').default) });
|
|
||||||
app.model({ namespace: 'project', ...(require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/models/project.js').default) });
|
|
||||||
app.model({ namespace: 'setting', ...(require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/models/setting.js').default) });
|
|
||||||
app.model({ namespace: 'user', ...(require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/models/user.js').default) });
|
|
||||||
return app;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getApp() {
|
|
||||||
return app;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class _DvaContainer extends Component {
|
|
||||||
render() {
|
|
||||||
const app = getApp();
|
|
||||||
app.router(() => this.props.children);
|
|
||||||
return app.start()();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
// create history
|
|
||||||
const history = require('umi/lib/createHistory').default({
|
|
||||||
basename: window.routerBase,
|
|
||||||
});
|
|
||||||
window.g_history = history;
|
|
||||||
export default history;
|
|
|
@ -1,6 +0,0 @@
|
||||||
import 'core-js';
|
|
||||||
import 'regenerator-runtime/runtime';
|
|
||||||
|
|
||||||
// Include this seperatly since it's not included in core-js
|
|
||||||
// ref: https://github.com/zloirock/core-js/issues/117
|
|
||||||
import '../../../../../../infini-logging-center/node_modules/_url-polyfill@1.1.5@url-polyfill/url-polyfill.js';
|
|
|
@ -1,883 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import {
|
|
||||||
Router as DefaultRouter,
|
|
||||||
Route,
|
|
||||||
Switch,
|
|
||||||
StaticRouter,
|
|
||||||
} from 'react-router-dom';
|
|
||||||
import dynamic from 'umi/dynamic';
|
|
||||||
import renderRoutes from 'umi/lib/renderRoutes';
|
|
||||||
import history from '@@/history';
|
|
||||||
import RendererWrapper0 from 'C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/.umi-production/LocaleWrapper.jsx';
|
|
||||||
import { routerRedux, dynamic as _dvaDynamic } from 'dva';
|
|
||||||
|
|
||||||
const Router = routerRedux.ConnectedRouter;
|
|
||||||
|
|
||||||
const routes = [
|
|
||||||
{
|
|
||||||
path: '/user',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
component: () => import('../../layouts/UserLayout'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../../layouts/UserLayout').default,
|
|
||||||
routes: [
|
|
||||||
{
|
|
||||||
path: '/user',
|
|
||||||
redirect: '/user/login',
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/user/login',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/User/models/register.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'register', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../User/Login'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../User/Login').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/user/register',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/User/models/register.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'register', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../User/Register'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../User/Register').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/user/register-result',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/User/models/register.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'register', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../User/RegisterResult'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../User/RegisterResult').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
component: () => import('../../layouts/BasicLayout'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../../layouts/BasicLayout').default,
|
|
||||||
Routes: [require('../Authorized').default],
|
|
||||||
authority: ['admin', 'user'],
|
|
||||||
routes: [
|
|
||||||
{
|
|
||||||
path: '/',
|
|
||||||
redirect: '/dashboard/analysis',
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/dashboard',
|
|
||||||
name: 'dashboard',
|
|
||||||
icon: 'dashboard',
|
|
||||||
routes: [
|
|
||||||
{
|
|
||||||
path: '/dashboard/analysis',
|
|
||||||
name: 'analysis',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Dashboard/models/activities.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'activities', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Dashboard/models/chart.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'chart', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Dashboard/models/monitor.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'monitor', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../Dashboard/Analysis'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Dashboard/Analysis').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/dashboard/monitor',
|
|
||||||
name: 'monitor',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Dashboard/models/activities.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'activities', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Dashboard/models/chart.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'chart', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Dashboard/models/monitor.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'monitor', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../Dashboard/Monitor'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Dashboard/Monitor').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/dashboard/workplace',
|
|
||||||
name: 'workplace',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Dashboard/models/activities.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'activities', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Dashboard/models/chart.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'chart', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Dashboard/models/monitor.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'monitor', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../Dashboard/Workplace'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Dashboard/Workplace').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/form',
|
|
||||||
icon: 'form',
|
|
||||||
name: 'form',
|
|
||||||
routes: [
|
|
||||||
{
|
|
||||||
path: '/form/basic-form',
|
|
||||||
name: 'basicform',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Forms/models/form.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'form', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../Forms/BasicForm'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Forms/BasicForm').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/form/step-form',
|
|
||||||
name: 'stepform',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Forms/models/form.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'form', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../Forms/StepForm'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Forms/StepForm').default,
|
|
||||||
hideChildrenInMenu: true,
|
|
||||||
routes: [
|
|
||||||
{
|
|
||||||
path: '/form/step-form',
|
|
||||||
name: 'stepform',
|
|
||||||
redirect: '/form/step-form/info',
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/form/step-form/info',
|
|
||||||
name: 'info',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Forms/models/form.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'form', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../Forms/StepForm/Step1'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Forms/StepForm/Step1').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/form/step-form/confirm',
|
|
||||||
name: 'confirm',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Forms/models/form.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'form', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../Forms/StepForm/Step2'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Forms/StepForm/Step2').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/form/step-form/result',
|
|
||||||
name: 'result',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Forms/models/form.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'form', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../Forms/StepForm/Step3'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Forms/StepForm/Step3').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/form/advanced-form',
|
|
||||||
name: 'advancedform',
|
|
||||||
authority: ['admin'],
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Forms/models/form.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'form', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../Forms/AdvancedForm'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Forms/AdvancedForm').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/list',
|
|
||||||
icon: 'table',
|
|
||||||
name: 'list',
|
|
||||||
routes: [
|
|
||||||
{
|
|
||||||
path: '/list/table-list',
|
|
||||||
name: 'searchtable',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/List/models/rule.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'rule', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../List/TableList'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../List/TableList').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/list/basic-list',
|
|
||||||
name: 'basiclist',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/List/models/rule.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'rule', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../List/BasicList'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../List/BasicList').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/list/card-list',
|
|
||||||
name: 'cardlist',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/List/models/rule.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'rule', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../List/CardList'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../List/CardList').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/list/search',
|
|
||||||
name: 'searchlist',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/List/models/rule.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'rule', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../List/List'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../List/List').default,
|
|
||||||
routes: [
|
|
||||||
{
|
|
||||||
path: '/list/search',
|
|
||||||
redirect: '/list/search/articles',
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/list/search/articles',
|
|
||||||
name: 'articles',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/List/models/rule.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'rule', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../List/Articles'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../List/Articles').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/list/search/projects',
|
|
||||||
name: 'projects',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/List/models/rule.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'rule', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../List/Projects'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../List/Projects').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/list/search/applications',
|
|
||||||
name: 'applications',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/List/models/rule.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'rule', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../List/Applications'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../List/Applications').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/profile',
|
|
||||||
name: 'profile',
|
|
||||||
icon: 'profile',
|
|
||||||
routes: [
|
|
||||||
{
|
|
||||||
path: '/profile/basic',
|
|
||||||
name: 'basic',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Profile/models/profile.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'profile', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../Profile/BasicProfile'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Profile/BasicProfile').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/profile/advanced',
|
|
||||||
name: 'advanced',
|
|
||||||
authority: ['admin'],
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Profile/models/profile.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'profile', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../Profile/AdvancedProfile'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Profile/AdvancedProfile').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'result',
|
|
||||||
icon: 'check-circle-o',
|
|
||||||
path: '/result',
|
|
||||||
routes: [
|
|
||||||
{
|
|
||||||
path: '/result/success',
|
|
||||||
name: 'success',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
component: () => import('../Result/Success'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Result/Success').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/result/fail',
|
|
||||||
name: 'fail',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
component: () => import('../Result/Error'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Result/Error').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'exception',
|
|
||||||
icon: 'warning',
|
|
||||||
path: '/exception',
|
|
||||||
routes: [
|
|
||||||
{
|
|
||||||
path: '/exception/403',
|
|
||||||
name: 'not-permission',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Exception/models/error.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'error', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../Exception/403'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Exception/403').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/exception/404',
|
|
||||||
name: 'not-find',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Exception/models/error.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'error', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../Exception/404'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Exception/404').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/exception/500',
|
|
||||||
name: 'server-error',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Exception/models/error.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'error', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../Exception/500'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Exception/500').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/exception/trigger',
|
|
||||||
name: 'trigger',
|
|
||||||
hideInMenu: true,
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Exception/models/error.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'error', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../Exception/TriggerException'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Exception/TriggerException').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'account',
|
|
||||||
icon: 'user',
|
|
||||||
path: '/account',
|
|
||||||
routes: [
|
|
||||||
{
|
|
||||||
path: '/account/center',
|
|
||||||
name: 'center',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
component: () => import('../Account/Center/Center'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Account/Center/Center').default,
|
|
||||||
routes: [
|
|
||||||
{
|
|
||||||
path: '/account/center',
|
|
||||||
redirect: '/account/center/articles',
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/account/center/articles',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
component: () => import('../Account/Center/Articles'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Account/Center/Articles').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/account/center/applications',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
component: () => import('../Account/Center/Applications'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Account/Center/Applications').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/account/center/projects',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
component: () => import('../Account/Center/Projects'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Account/Center/Projects').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/account/settings',
|
|
||||||
name: 'settings',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Account/Settings/models/geographic.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'geographic', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../Account/Settings/Info'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Account/Settings/Info').default,
|
|
||||||
routes: [
|
|
||||||
{
|
|
||||||
path: '/account/settings',
|
|
||||||
redirect: '/account/settings/base',
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/account/settings/base',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Account/Settings/models/geographic.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'geographic', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () => import('../Account/Settings/BaseView'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Account/Settings/BaseView').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/account/settings/security',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Account/Settings/models/geographic.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'geographic', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () =>
|
|
||||||
import('../Account/Settings/SecurityView'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Account/Settings/SecurityView').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/account/settings/binding',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Account/Settings/models/geographic.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'geographic', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () =>
|
|
||||||
import('../Account/Settings/BindingView'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Account/Settings/BindingView').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/account/settings/notification',
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
app: require('@tmp/dva').getApp(),
|
|
||||||
models: () => [
|
|
||||||
import('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/pages/Account/Settings/models/geographic.js').then(
|
|
||||||
m => {
|
|
||||||
return { namespace: 'geographic', ...m.default };
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
component: () =>
|
|
||||||
import('../Account/Settings/NotificationView'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../Account/Settings/NotificationView').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: __IS_BROWSER
|
|
||||||
? _dvaDynamic({
|
|
||||||
component: () => import('../404'),
|
|
||||||
LoadingComponent: require('C:/Users/Administrator/Documents/infini/logging-center/app/web/src/components/PageLoading/index')
|
|
||||||
.default,
|
|
||||||
})
|
|
||||||
: require('../404').default,
|
|
||||||
exact: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
window.g_routes = routes;
|
|
||||||
const plugins = require('umi/_runtimePlugin');
|
|
||||||
plugins.applyForEach('patchRoutes', { initialValue: routes });
|
|
||||||
|
|
||||||
export { routes };
|
|
||||||
|
|
||||||
export default class RouterWrapper extends React.Component {
|
|
||||||
unListen() {}
|
|
||||||
|
|
||||||
constructor(props) {
|
|
||||||
super(props);
|
|
||||||
|
|
||||||
// route change handler
|
|
||||||
function routeChangeHandler(location, action) {
|
|
||||||
plugins.applyForEach('onRouteChange', {
|
|
||||||
initialValue: {
|
|
||||||
routes,
|
|
||||||
location,
|
|
||||||
action,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.unListen = history.listen(routeChangeHandler);
|
|
||||||
// dva 中 history.listen 会初始执行一次
|
|
||||||
// 这里排除掉 dva 的场景,可以避免 onRouteChange 在启用 dva 后的初始加载时被多执行一次
|
|
||||||
const isDva =
|
|
||||||
history.listen
|
|
||||||
.toString()
|
|
||||||
.indexOf('callback(history.location, history.action)') > -1;
|
|
||||||
if (!isDva) {
|
|
||||||
routeChangeHandler(history.location);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
componentWillUnmount() {
|
|
||||||
this.unListen();
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const props = this.props || {};
|
|
||||||
return (
|
|
||||||
<RendererWrapper0>
|
|
||||||
<Router history={history}>{renderRoutes(routes, props)}</Router>
|
|
||||||
</RendererWrapper0>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,225 +0,0 @@
|
||||||
import './polyfills';
|
|
||||||
import history from './history';
|
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import ReactDOM from 'react-dom';
|
|
||||||
import findRoute, {
|
|
||||||
getUrlQuery,
|
|
||||||
} from 'C:/Users/Administrator/Documents/infini/infini-logging-center/node_modules/_umi-build-dev@1.17.1@umi-build-dev/lib/findRoute.js';
|
|
||||||
|
|
||||||
// runtime plugins
|
|
||||||
const plugins = require('umi/_runtimePlugin');
|
|
||||||
window.g_plugins = plugins;
|
|
||||||
plugins.init({
|
|
||||||
validKeys: [
|
|
||||||
'patchRoutes',
|
|
||||||
'render',
|
|
||||||
'rootContainer',
|
|
||||||
'modifyRouteProps',
|
|
||||||
'onRouteChange',
|
|
||||||
'modifyInitialProps',
|
|
||||||
'initialProps',
|
|
||||||
'dva',
|
|
||||||
'locale',
|
|
||||||
],
|
|
||||||
});
|
|
||||||
plugins.use(
|
|
||||||
require('../../../../../node_modules/_umi-plugin-dva@1.11.0@umi-plugin-dva/lib/runtime'),
|
|
||||||
);
|
|
||||||
|
|
||||||
const app = require('@tmp/dva')._onCreate();
|
|
||||||
window.g_app = app;
|
|
||||||
|
|
||||||
// render
|
|
||||||
let clientRender = async () => {
|
|
||||||
window.g_isBrowser = true;
|
|
||||||
let props = {};
|
|
||||||
// Both support SSR and CSR
|
|
||||||
if (window.g_useSSR) {
|
|
||||||
// 如果开启服务端渲染则客户端组件初始化 props 使用服务端注入的数据
|
|
||||||
props = window.g_initialData;
|
|
||||||
} else {
|
|
||||||
const pathname = location.pathname;
|
|
||||||
const activeRoute = findRoute(require('@@/router').routes, pathname);
|
|
||||||
// 在客户端渲染前,执行 getInitialProps 方法
|
|
||||||
// 拿到初始数据
|
|
||||||
if (
|
|
||||||
activeRoute &&
|
|
||||||
activeRoute.component &&
|
|
||||||
activeRoute.component.getInitialProps
|
|
||||||
) {
|
|
||||||
const initialProps = plugins.apply('modifyInitialProps', {
|
|
||||||
initialValue: {},
|
|
||||||
});
|
|
||||||
props = activeRoute.component.getInitialProps
|
|
||||||
? await activeRoute.component.getInitialProps({
|
|
||||||
route: activeRoute,
|
|
||||||
isServer: false,
|
|
||||||
location,
|
|
||||||
...initialProps,
|
|
||||||
})
|
|
||||||
: {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const rootContainer = plugins.apply('rootContainer', {
|
|
||||||
initialValue: React.createElement(require('./router').default, props),
|
|
||||||
});
|
|
||||||
ReactDOM[window.g_useSSR ? 'hydrate' : 'render'](
|
|
||||||
rootContainer,
|
|
||||||
document.getElementById('root'),
|
|
||||||
);
|
|
||||||
};
|
|
||||||
const render = plugins.compose(
|
|
||||||
'render',
|
|
||||||
{ initialValue: clientRender },
|
|
||||||
);
|
|
||||||
|
|
||||||
const moduleBeforeRendererPromises = [];
|
|
||||||
// client render
|
|
||||||
if (__IS_BROWSER) {
|
|
||||||
Promise.all(moduleBeforeRendererPromises)
|
|
||||||
.then(() => {
|
|
||||||
render();
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
window.console && window.console.error(err);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// export server render
|
|
||||||
let serverRender, ReactDOMServer;
|
|
||||||
if (!__IS_BROWSER) {
|
|
||||||
const { matchRoutes } = require('react-router-config');
|
|
||||||
const { StaticRouter } = require('react-router');
|
|
||||||
// difference: umi-history has query object
|
|
||||||
const { createLocation } = require('umi-history');
|
|
||||||
// don't remove, use stringify html map
|
|
||||||
const stringify = require('serialize-javascript');
|
|
||||||
const router = require('./router');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 1. Load dynamicImport Component
|
|
||||||
* 2. Get Component initialProps function data
|
|
||||||
* return Component props
|
|
||||||
* @param pathname
|
|
||||||
* @param props
|
|
||||||
*/
|
|
||||||
const getInitialProps = async (pathname, props) => {
|
|
||||||
const { routes } = router;
|
|
||||||
const matchedComponents = matchRoutes(routes, pathname)
|
|
||||||
.map(({ route }) => {
|
|
||||||
if (route.component) {
|
|
||||||
return !route.component.preload
|
|
||||||
? // 同步
|
|
||||||
route.component
|
|
||||||
: // 异步,支持 dynamicImport
|
|
||||||
route.component.preload().then(component => component.default);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.filter(c => c);
|
|
||||||
const loadedComponents = await Promise.all(matchedComponents);
|
|
||||||
|
|
||||||
// get Store
|
|
||||||
const initialProps = plugins.apply('modifyInitialProps', {
|
|
||||||
initialValue: {},
|
|
||||||
});
|
|
||||||
// support getInitialProps
|
|
||||||
const promises = loadedComponents.map(component => {
|
|
||||||
if (component && component.getInitialProps) {
|
|
||||||
return component.getInitialProps({
|
|
||||||
isServer: true,
|
|
||||||
...props,
|
|
||||||
...initialProps,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return Promise.resolve(null);
|
|
||||||
});
|
|
||||||
|
|
||||||
return Promise.all(promises);
|
|
||||||
};
|
|
||||||
|
|
||||||
serverRender = async (ctx = {}) => {
|
|
||||||
// ctx.req.url may be `/bar?locale=en-US`
|
|
||||||
const [pathname] = (ctx.req.url || '').split('?');
|
|
||||||
// global
|
|
||||||
global.req = {
|
|
||||||
url: ctx.req.url,
|
|
||||||
};
|
|
||||||
const location = createLocation(ctx.req.url);
|
|
||||||
const activeRoute = findRoute(router.routes, pathname);
|
|
||||||
// omit component
|
|
||||||
const { component, ...restRoute } = activeRoute || {};
|
|
||||||
// router context hook
|
|
||||||
// get current router status 40x / 30x, share with server
|
|
||||||
const context = {};
|
|
||||||
// TODO: getInitialProps timeout handle
|
|
||||||
const initialData = await getInitialProps(pathname, {
|
|
||||||
route: restRoute,
|
|
||||||
// only exist in server
|
|
||||||
req: ctx.req || {},
|
|
||||||
res: ctx.res || {},
|
|
||||||
context,
|
|
||||||
location,
|
|
||||||
});
|
|
||||||
|
|
||||||
// 当前路由(不包含 Layout)的 getInitialProps 有返回值
|
|
||||||
// Page 值为 undefined 时,有 getInitialProps 无返回,此时 return dva model
|
|
||||||
const pageData = initialData[initialData.length - 1];
|
|
||||||
if (pageData === undefined) {
|
|
||||||
initialData[initialData.length - 1] = plugins.apply('initialProps', {
|
|
||||||
initialValue: pageData,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// reduce all match component getInitialProps
|
|
||||||
// in the same object key
|
|
||||||
// page data key will override layout key
|
|
||||||
const props = Array.isArray(initialData)
|
|
||||||
? initialData.reduce(
|
|
||||||
(acc, curr) => ({
|
|
||||||
...acc,
|
|
||||||
...curr,
|
|
||||||
}),
|
|
||||||
{},
|
|
||||||
)
|
|
||||||
: {};
|
|
||||||
|
|
||||||
const App = React.createElement(
|
|
||||||
StaticRouter,
|
|
||||||
{
|
|
||||||
location: ctx.req.url,
|
|
||||||
context,
|
|
||||||
},
|
|
||||||
React.createElement(router.default, props),
|
|
||||||
);
|
|
||||||
|
|
||||||
// render rootContainer for htmlTemplateMap
|
|
||||||
const rootContainer = plugins.apply('rootContainer', {
|
|
||||||
initialValue: App,
|
|
||||||
});
|
|
||||||
const htmlTemplateMap = {};
|
|
||||||
const matchPath = activeRoute ? activeRoute.path : undefined;
|
|
||||||
return {
|
|
||||||
htmlElement: matchPath ? htmlTemplateMap[matchPath] : '',
|
|
||||||
rootContainer,
|
|
||||||
matchPath,
|
|
||||||
g_initialData: props,
|
|
||||||
context,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
// using project react-dom version
|
|
||||||
// https://github.com/facebook/react/issues/13991
|
|
||||||
ReactDOMServer = require('react-dom/server');
|
|
||||||
}
|
|
||||||
|
|
||||||
export { ReactDOMServer };
|
|
||||||
export default (__IS_BROWSER ? null : serverRender);
|
|
||||||
|
|
||||||
require('../../global.less');
|
|
||||||
|
|
||||||
// hot module replacement
|
|
||||||
if (__IS_BROWSER && module.hot) {
|
|
||||||
module.hot.accept('./router', () => {
|
|
||||||
clientRender();
|
|
||||||
});
|
|
||||||
}
|
|
|
@ -4,8 +4,8 @@
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>Ant Design Pro</title>
|
<title>INFINI</title>
|
||||||
<link rel="icon" href="/favicon.png" type="image/x-icon">
|
<link rel="icon" href="/public/favicon.ico" type="image/x-icon">
|
||||||
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.data-set-0.9.6/dist/data-set.min.js"></script>
|
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.data-set-0.9.6/dist/data-set.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
## 数据库初始化脚本
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
infini-logging-db:
|
||||||
|
image: mariadb:10.1.19
|
||||||
|
# volumes:
|
||||||
|
# - ../data/db_data:/var/lib/mysql
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: admin
|
||||||
|
ports:
|
||||||
|
- "3306:3306"
|
|
@ -0,0 +1,25 @@
|
||||||
|
version: "3.5"
|
||||||
|
|
||||||
|
services:
|
||||||
|
infini-logging-release:
|
||||||
|
# option 1: pull image from infini docker registry
|
||||||
|
image: docker.infini.ltd:64443/nodejs-release:latest
|
||||||
|
|
||||||
|
# option 2: build image locally
|
||||||
|
# build:
|
||||||
|
# context: ../
|
||||||
|
# dockerfile: docker/Dockerfile
|
||||||
|
|
||||||
|
ports:
|
||||||
|
# - 3000:3000
|
||||||
|
- 8001:7001
|
||||||
|
# - 10000:10000
|
||||||
|
container_name: "infini-nodejs-release"
|
||||||
|
volumes:
|
||||||
|
- ../app:/usr/src/app/app
|
||||||
|
- ../config:/usr/src/app/config
|
||||||
|
- ../package.json:/usr/src/app/package.json
|
||||||
|
- ./entrypoint-release.sh:/entrypoint.sh
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
dist:
|
|
@ -0,0 +1,18 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
lockPath="/tmp/init.lock"
|
||||||
|
|
||||||
|
npm config set registry http://registry.npm.taobao.org/;
|
||||||
|
|
||||||
|
cd /usr/src/app
|
||||||
|
|
||||||
|
echo "START BUILD INFINI-LOGGING-CENTER v1.0"
|
||||||
|
|
||||||
|
if [ ! -f "$lockPath" ]; then
|
||||||
|
npm install --registry=https://registry.npm.taobao.org
|
||||||
|
npm run build
|
||||||
|
npm run start
|
||||||
|
else
|
||||||
|
npm run build
|
||||||
|
npm run start
|
||||||
|
fi
|
11
package.json
11
package.json
|
@ -73,7 +73,7 @@
|
||||||
"node": ">=8.9.0"
|
"node": ">=8.9.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "egg-scripts start --daemon --title=infini-logging-center --env prod",
|
"start": "egg-scripts start --title=infini-logging-center --env prod",
|
||||||
"stop": "egg-scripts stop --title=infini-logging-center",
|
"stop": "egg-scripts stop --title=infini-logging-center",
|
||||||
"dev": "SOCKET_SERVER=none UMI_UI=none egg-bin dev",
|
"dev": "SOCKET_SERVER=none UMI_UI=none egg-bin dev",
|
||||||
"local-dev": "egg-bin dev",
|
"local-dev": "egg-bin dev",
|
||||||
|
@ -86,9 +86,14 @@
|
||||||
"ci": "npm run lint && npm run cov",
|
"ci": "npm run lint && npm run cov",
|
||||||
"autod": "autod",
|
"autod": "autod",
|
||||||
"sync": "./script/sync.js",
|
"sync": "./script/sync.js",
|
||||||
"docker:build": "docker-compose -f ./docker/docker-compose.dev.yml build",
|
"docker:build-dev-images": "docker-compose -f ./docker/docker-compose.dev.yml build",
|
||||||
"docker:dev": "docker-compose -f ./docker/docker-compose.dev.yml up -d",
|
"docker:dev": "docker-compose -f ./docker/docker-compose.dev.yml up -d",
|
||||||
"docker:stop": "docker-compose -f ./docker/docker-compose.dev.yml down"
|
"docker:stop-dev": "docker-compose -f ./docker/docker-compose.dev.yml down",
|
||||||
|
"docker:build-release-images": "docker-compose -f ./docker/docker-compose.release.yml build",
|
||||||
|
"docker:prod": "docker-compose -f ./docker/docker-compose.release.yml up -d",
|
||||||
|
"docker:stop-prod": "docker-compose -f ./docker/docker-compose.release.yml down",
|
||||||
|
"docker:start-mysql": "docker-compose -f ./docker/docker-compose-mysql.dev.yml up -d"
|
||||||
|
|
||||||
},
|
},
|
||||||
"ci": {
|
"ci": {
|
||||||
"version": "8",
|
"version": "8",
|
||||||
|
|
Loading…
Reference in New Issue