Skip to content

Commit

Permalink
Merge pull request #13 from gogo-easy/dev-1.0.3
Browse files Browse the repository at this point in the history
prepare release 1.0.3 version
  • Loading branch information
Fijileijun authored Jan 2, 2020
2 parents 5843109 + 58ac1b4 commit f8f9e5e
Show file tree
Hide file tree
Showing 50 changed files with 890 additions and 304 deletions.
7 changes: 6 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
],
"plugins": [
"@babel/plugin-proposal-function-bind",
"@babel/plugin-proposal-class-properties"
"@babel/plugin-proposal-class-properties",
["import", {
"libraryName": "antd",
"libraryDirectory": "es",
"style": true // `style: true` 会加载 less 文件
}]
]
}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules/*
package-lock.json
.idea/
dist/static/
dist/
public/
.DS_Store
118 changes: 19 additions & 99 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,105 +2,25 @@

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/gogo-easy/ngrAdminPortal/blob/master/LICENSE) [![Version](https://img.shields.io/github/v/release/gogo-easy/ngrAdminPortal)](https://github.com/gogo-easy/ngrAdminPortal/releases)

## Quick Start

### 项目安装依赖
```
npm install
```

### 本地环境运行
```
npm run start
```

### 编译打包生产,
```
npm run build
```

### 在config/index.js中,根据不同环境,提供不同的NgrAdmin RESTFUL API域名和端口

```
var path = require('path')
const NODE_ENV = process.env.NODE_ENV
module.exports = {
build: {
restfulApi:'http://product.gateway-api.com',
mode: NODE_ENV,
sourceMap: false,
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
bundleAnalyzerReport: process.env.analyz
},
dev: {
restfulApi:'http://dev.gateway-api.com',
mode: NODE_ENV,
sourceMap: 'source-map',
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
port: 3000,
autoOpenBrowser: true,
overlay: true,
historyApiFallback: true,
noInfo: true
},
}
```

### 提供在服务器上pm2启动项目的功能

```
1. 修改config/index, 配置Ngr Admin RESTFUL API server地址。配置一次即可。
var path = require('path')
const NODE_ENV = process.env.NODE_ENV
module.exports = {
build: {
restfulApi:'http://product.gateway-api.com',
mode: NODE_ENV,
sourceMap: false,
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
bundleAnalyzerReport: process.env.analyz
},
dev: {
restfulApi:'http://dev.gateway-api.com',
mode: NODE_ENV,
sourceMap: 'source-map',
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
port: 3000,
autoOpenBrowser: true,
overlay: true,
historyApiFallback: true,
noInfo: true
},
}
2. 本地打包编译。
npm run build
3. 推送代码到远程仓库
git push origin xxx
4. 服务器用pm2起node服务
npm run pm2_start
5. 服务器ip+端口访问,如有需要自行配置ngnix做域名解析
```

### 部署建议

- NgrAdmin服务与NgrAdminPortal部署在同一应用实例上,NgrAdminPortal访问本地NgrAdmin服务。
## How to use

- [User Guide](https://github.com/gogo-easy/ngrAdminPortal/wiki/Using-Guide)

## Deployment & Installation

- [Deployment & Installation](https://github.com/gogo-easy/ngrAdminPortal/wiki/Quick-Start)

## Release

- [版本发布](https://github.com/gogo-easy/ngrAdminPortal/releases)

## 贡献者

- [@Fijian](https://github.com/jacobslei)
- [@yearyeardiff](https://github.com/yearyeardiff)
- [@wl4ever](https://github.com/wl4ever)
- [@helicopter19](https://github.com/helicopter19)
- [@xuwei-fe](https://github.com/xuwei-fe)

## License

Expand Down
17 changes: 10 additions & 7 deletions build/webpack.base.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

const darkTheme = require('@ant-design/dark-theme');
const path = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const config = require('../config')
Expand Down Expand Up @@ -38,17 +38,20 @@ module.exports = {
},
module: {
rules: [
{
test: /\.css$/,
use: [NODE_ENV === 'development' ? 'style-loader' : MiniCssExtractPlugin.loader, 'css-loader'],
},
{
test: /\.(js|jsx)$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.css$/,
use: [NODE_ENV === 'development' ? 'style-loader' : MiniCssExtractPlugin.loader, 'css-loader'],
},{
test: /\.less$/,
use: ['style-loader', 'css-loader', 'less-loader']
{ test: /\.less/, use: [
{ loader: "style-loader" },
{ loader: "css-loader" },
{ loader: "less-loader", options: { "modifyVars":darkTheme.default,javascriptEnabled: true}}
]
},
// {
// test: preRegex,
Expand Down
3 changes: 2 additions & 1 deletion build/webpack.dev.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ module.exports = merge(baseWebpackConfig, {
new WebpackServerQRcode(),
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
template: './src/index.tpl.html'
template: './src/index.tpl.html',
favicon: './src/favicon.ico'
}),
]
})
3 changes: 2 additions & 1 deletion build/webpack.prod.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const webpackConfig = merge(baseWebpackConfig, {
new OptimizeCssAssetsPlugin(),
new HtmlWebpackPlugin({
template: './src/index.tpl.html',
favicon: './src/favicon.ico',
minify: {
removeComments: true, // 移除注释
collapseWhitespace: true, // 去除空格
Expand All @@ -61,4 +62,4 @@ if (config.build.bundleAnalyzerReport) {
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}

module.exports = webpackConfig
module.exports = webpackConfig
1 change: 0 additions & 1 deletion dist/index.html

This file was deleted.

5 changes: 5 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM nginx
# Run 'npm instsall' and 'npm run build' to generate the 'dist' directory, and make a tarball
ADD dist.tar.gz /tmp
COPY ngradminportal.conf /etc/nginx/conf.d/ngradminportal.conf
EXPOSE 3000
Binary file added docker/dist.tar.gz
Binary file not shown.
8 changes: 8 additions & 0 deletions docker/ngradminportal.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
server {
listen 3000;
root /tmp/dist;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
Binary file added images/Add_AB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Add_gateway.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Add_host.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Add_router_rule.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Plugins.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Rate_limit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Target.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@babel/plugin-proposal-function-bind": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.0.0",
"@electerm/antd-dark-theme": "^0.0.4",
"@ice-point/webpack-server-qrcode": "^1.0.0",
"autoprefixer": "^9.1.5",
"babel-loader": "^8.0.4",
Expand Down Expand Up @@ -43,20 +44,22 @@
"webpack-merge": "^4.1.4"
},
"dependencies": {
"@ant-design/dark-theme": "^1.0.3",
"antd": "^3.4.3",
"axios": "^0.18.0",
"body-parser": "~1.17.1",
"classnames": "^2.2.6",
"cookie-parser": "~1.4.3",
"ejs": "~2.5.6",
"antd": "^3.4.3",
"classnames": "^2.2.6",
"express": "^4.16.4",
"history": "^4.2.0",
"jquery": "^3.3.1",
"moment": "^2.24.0",
"pm2": "^3.5.1",
"react-json-editor-ajrm": "^2.5.9",
"react": "^16.8.5",
"react-dom": "^16.8.5",
"react-json-editor-ajrm": "^2.5.9",
"react-loadable": "^5.5.0",
"react-router-dom": "^4.3.1"
}
}
34 changes: 24 additions & 10 deletions src/common/less/private.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

.ant-advanced-search-form {
padding: 24px;
background: #fbfbfb;
border: 1px solid #d9d9d9;
border-radius: 6px;

.ant-row {
Expand All @@ -28,8 +26,6 @@
}

.modal_form {
background: #fbfbfb;
border: 1px solid #d9d9d9;
padding: 24px;

.ant-form-item {
Expand Down Expand Up @@ -71,12 +67,8 @@
height: 45px;
text-align: left;
font-weight: bold;
color: #323223;
}

.ant-layout-sider {
background: #fff;
}

.btn_box {
overflow: hidden;
Expand Down Expand Up @@ -175,7 +167,7 @@
.target_container {
margin-top: 10px;
padding-top: 3px;
border-top: 1px solid #ccc;
border-top: 1px solid #17171f;

h4 {
text-align: center
Expand Down Expand Up @@ -228,12 +220,34 @@
.log_list,
.user_list {
padding: 24px;
border: 1px solid #d9d9d9;
border-radius: 6px;
}

.log-info-pane {

width: 550px !important;

}

tr.ant-table-expanded-row, tr.ant-table-expanded-row:hover{
background:none!important;
}
textarea{
background:#3b3b4d!important;
border:1px solid rgb(23, 23, 31);
border-radius:4px;
}
.ant-table-thead > tr > th, .ant-table-tbody > tr > td{
padding: 16px 0!important;
}
#g_body{
.ismini{
width:0px!important;
max-width:auto!important;
min-width:auto!important;
}
.transition{
transition-property: width, max-height,padding;
transition-duration: 0.35s;
}
}
9 changes: 6 additions & 3 deletions src/core/change_password.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ class NormalLoginForm extends React.Component {
passWordModifyModelInstance.excute(res => {
notification.open({
message: '修改成功',
description: res["msg"]
description: "",
type: "success"

});
setTimeout(() => {
localStorage.clear();
Expand All @@ -55,8 +57,9 @@ class NormalLoginForm extends React.Component {

}, err => {
notification.open({
message: '创建失败',
description: err["msg"]
message: '修改失败',
description: err["msg"],
type: "error"
});
})

Expand Down
Loading

0 comments on commit f8f9e5e

Please sign in to comment.