Upgrade vue cli version in frp web dashboard

This commit is contained in:
Raoul1996 2020-01-09 11:38:41 +08:00
parent 4832a2a1e9
commit c52ae5a939
33 changed files with 15305 additions and 18033 deletions

View File

@ -1,14 +0,0 @@
{
"presets": [
["es2015", { "modules": false }]
],
"plugins": [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
]
]
}

23
web/frpc/.gitignore vendored
View File

@ -1,6 +1,21 @@
.DS_Store .DS_Store
node_modules/ node_modules
dist/ /dist
npm-debug.log
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea .idea
.vscode/settings.json .vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@ -3,4 +3,4 @@ build:
@npm run build @npm run build
dev: dev:
@npm run dev @npm run serve

20
web/frpc/README.md Normal file
View File

@ -0,0 +1,20 @@
# frpc-web
> An admin web ui for frp client.
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

5
web/frpc/babel.config.js Normal file
View File

@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

18522
web/frpc/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,46 +1,31 @@
{ {
"name": "frpc-web", "name": "frpc-web",
"description": "An admin web ui for frp client.", "description": "An admin web ui for frp client.",
"author": "fatedier", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "webpack-dev-server -d --inline --hot --env.dev", "serve": "vue-cli-service serve",
"build": "rimraf dist && webpack -p --progress --hide-modules" "build": "vue-cli-service build"
}, },
"dependencies": { "dependencies": {
"element-ui": "^2.5.3", "core-js": "^3.4.4",
"vue": "^2.5.22", "echarts": "^4.6.0",
"vue-resource": "^1.5.1", "element-ui": "^2.13.0",
"vue-router": "^3.0.2", "less": "^3.10.3",
"less-loader": "^5.0.0",
"postcss-loader": "^3.0.0",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"whatwg-fetch": "^3.0.0" "whatwg-fetch": "^3.0.0"
}, },
"engines": {
"node": ">=6"
},
"devDependencies": { "devDependencies": {
"autoprefixer": "^9.4.7", "@vue/cli-plugin-babel": "^4.1.0",
"babel-core": "^6.26.3", "@vue/cli-plugin-router": "^4.1.0",
"babel-eslint": "^10.0.1", "@vue/cli-service": "^4.1.0",
"babel-loader": "^7.1.5", "vue-template-compiler": "^2.6.10"
"babel-plugin-component": "^1.1.1", },
"babel-preset-es2015": "^6.24.1", "browserslist": [
"css-loader": "^2.1.0", "> 1%",
"eslint": "^5.12.1", "last 2 versions"
"eslint-config-enough": "^0.3.4", ]
"eslint-loader": "^2.1.1",
"file-loader": "^3.0.1",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^2.24.1",
"less": "^3.9.0",
"less-loader": "^4.1.0",
"postcss-loader": "^3.0.0",
"rimraf": "^2.6.3",
"style-loader": "^0.23.1",
"url-loader": "^1.1.2",
"vue-loader": "^15.6.2",
"vue-template-compiler": "^2.5.22",
"webpack": "^2.7.0",
"webpack-cli": "^3.2.1",
"webpack-dev-server": "^3.1.14"
}
} }

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>frpc web</title>
</head>
<body>
<noscript>
<strong>We're sorry but frpc web doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

View File

@ -1,15 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>frp client admin UI</title>
</head>
<body>
<div id="app"></div>
<!--<script src="https://code.jquery.com/jquery-3.2.0.min.js"></script>-->
<!--<script src="//cdn.bootcss.com/echarts/3.4.0/echarts.min.js"></script>-->
</body>
</html>

View File

@ -1,5 +1,4 @@
import Vue from 'vue' import Vue from 'vue'
// import ElementUI from 'element-ui'
import { import {
Button, Button,
Form, Form,
@ -40,13 +39,10 @@ Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$confirm = MessageBox.confirm Vue.prototype.$confirm = MessageBox.confirm
Vue.prototype.$message = Message Vue.prototype.$message = Message
//Vue.use(ElementUI)
Vue.config.productionTip = false Vue.config.productionTip = false
new Vue({ new Vue({
el: '#app',
router, router,
template: '<App/>', render: h => h(App)
components: { App } }).$mount('#app')
})

View File

@ -1,107 +0,0 @@
const path = require('path')
var webpack = require('webpack')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var VueLoaderPlugin = require('vue-loader/lib/plugin')
var url = require('url')
var publicPath = ''
module.exports = (options = {}) => ({
entry: {
vendor: './src/main'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: options.dev ? '[name].js' : '[name].js?[chunkhash]',
chunkFilename: '[id].js?[chunkhash]',
publicPath: options.dev ? '/assets/' : publicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': path.resolve(__dirname, 'src'),
}
},
module: {
rules: [{
test: /\.vue$/,
loader: 'vue-loader'
}, {
test: /\.js$/,
use: ['babel-loader'],
exclude: /node_modules/
}, {
test: /\.html$/,
use: [{
loader: 'html-loader',
options: {
root: path.resolve(__dirname, 'src'),
attrs: ['img:src', 'link:href']
}
}]
}, {
test: /\.less$/,
loader: 'style-loader!css-loader!postcss-loader!less-loader'
}, {
test: /\.css$/,
use: ['style-loader', 'css-loader', 'postcss-loader']
}, {
test: /favicon\.png$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
}]
}, {
test: /\.(png|jpg|jpeg|gif|eot|ttf|woff|woff2|svg|svgz)(\?.+)?$/,
exclude: /favicon\.png$/,
use: [{
loader: 'url-loader',
options: {
limit: 10000
}
}]
}]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
names: ['vendor', 'manifest']
}),
new HtmlWebpackPlugin({
favicon: 'src/assets/favicon.ico',
template: 'src/index.html'
}),
new webpack.NormalModuleReplacementPlugin(/element-ui[\/\\]lib[\/\\]locale[\/\\]lang[\/\\]zh-CN/, 'element-ui/lib/locale/lang/en'),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
comments: false,
compress: {
warnings: false
}
}),
new VueLoaderPlugin()
],
devServer: {
host: '127.0.0.1',
port: 8010,
proxy: {
'/api/': {
target: 'http://127.0.0.1:8080',
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
},
historyApiFallback: {
index: url.parse(options.dev ? '/assets/' : publicPath).pathname
}
}//,
//devtool: options.dev ? '#eval-source-map' : '#source-map'
})

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +0,0 @@
{
"presets": [
["es2015", { "modules": false }]
],
"plugins": [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
]
]
}

View File

@ -4,4 +4,4 @@ build:
@npm run build @npm run build
dev: install dev: install
@npm run dev @npm run serve

25
web/frps/README.md Normal file
View File

@ -0,0 +1,25 @@
# frps-dashboard
> A dashboard for frp server.
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

5
web/frps/babel.config.js Normal file
View File

@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

16496
web/frps/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -2,47 +2,34 @@
"name": "frps-dashboard", "name": "frps-dashboard",
"description": "A dashboard for frp server.", "description": "A dashboard for frp server.",
"author": "fatedier", "author": "fatedier",
"version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "webpack-dev-server -d --inline --hot --env.dev", "serve": "vue-cli-service serve",
"build": "rimraf dist && webpack -p --progress --hide-modules" "build": "vue-cli-service build",
"lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"bootstrap": "^3.3.7", "core-js": "^3.4.4",
"echarts": "^3.5.0", "echarts": "^4.6.0",
"element-ui": "^2.3.8", "element-ui": "^2.13.0",
"humanize-plus": "^1.8.2", "humanize-plus": "^1.8.2",
"vue": "^2.5.16", "less": "^3.10.3",
"vue-resource": "^1.2.1", "less-loader": "^5.0.0",
"vue-router": "^2.3.0", "vue": "^2.6.10",
"whatwg-fetch": "^2.0.3" "vue-router": "^3.1.3",
}, "whatwg-fetch": "^3.0.0"
"engines": {
"node": ">=6"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^6.6.0", "@vue/cli-plugin-babel": "^4.1.0",
"babel-core": "^6.21.0", "@vue/cli-service": "^4.1.0",
"babel-eslint": "^7.1.1", "babel-eslint": "^10.0.3",
"babel-loader": "^6.4.0", "eslint": "^5.16.0",
"babel-plugin-component": "^1.1.1", "eslint-plugin-vue": "^5.0.0",
"babel-preset-es2015": "^6.13.2", "vue-template-compiler": "^2.6.10"
"css-loader": "^0.27.0", },
"eslint": "^3.12.2", "browserslist": [
"eslint-config-enough": "^0.2.2", "> 1%",
"eslint-loader": "^1.6.3", "last 2 versions"
"file-loader": "^0.10.1", ]
"html-loader": "^0.4.5",
"html-webpack-plugin": "^2.24.1",
"less": "^3.0.4",
"less-loader": "^4.1.0",
"postcss-loader": "^1.3.3",
"rimraf": "^2.5.4",
"style-loader": "^0.13.2",
"url-loader": "^1.0.1",
"vue-loader": "^15.0.10",
"vue-template-compiler": "^2.1.8",
"webpack": "^2.2.0-rc.4",
"webpack-dev-server": "^3.1.4"
}
} }

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>frps dashboard</title>
</head>
<body>
<noscript>
<strong>We're sorry but frps dashboard doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

View File

@ -52,7 +52,8 @@
</template> </template>
<script> <script>
import {DrawTrafficChart, DrawProxyChart} from '../utils/chart.js' import {DrawProxyChart, DrawTrafficChart} from "../utils/chart.js"
export default { export default {
data() { data() {
return { return {

View File

@ -89,11 +89,10 @@
</template> </template>
<script> <script>
import Humanize from 'humanize-plus'; import Humanize from "humanize-plus";
import Traffic from './Traffic.vue' import Traffic from "./Traffic.vue"
import { import {HttpProxy} from "../utils/proxy.js"
HttpProxy
} from '../utils/proxy.js'
export default { export default {
data() { data() {
return { return {

View File

@ -84,11 +84,10 @@
</template> </template>
<script> <script>
import Humanize from 'humanize-plus'; import Humanize from "humanize-plus";
import Traffic from './Traffic.vue' import Traffic from "./Traffic.vue"
import { import {HttpsProxy} from "../utils/proxy.js"
HttpsProxy
} from '../utils/proxy.js'
export default { export default {
data() { data() {
return { return {

View File

@ -72,9 +72,10 @@
</template> </template>
<script> <script>
import Humanize from 'humanize-plus' import Humanize from "humanize-plus"
import Traffic from './Traffic.vue' import Traffic from "./Traffic.vue"
import { StcpProxy } from '../utils/proxy.js' import {StcpProxy} from "../utils/proxy.js"
export default { export default {
data() { data() {
return { return {

View File

@ -80,9 +80,10 @@
</template> </template>
<script> <script>
import Humanize from 'humanize-plus' import Humanize from "humanize-plus"
import Traffic from './Traffic.vue' import Traffic from "./Traffic.vue"
import { TcpProxy } from '../utils/proxy.js' import {TcpProxy} from "../utils/proxy.js"
export default { export default {
data() { data() {
return { return {

View File

@ -80,11 +80,10 @@
</template> </template>
<script> <script>
import Humanize from 'humanize-plus'; import Humanize from "humanize-plus";
import Traffic from './Traffic.vue' import Traffic from "./Traffic.vue"
import { import {UdpProxy} from "../utils/proxy.js"
UdpProxy
} from '../utils/proxy.js'
export default { export default {
data() { data() {
return { return {

View File

@ -3,8 +3,9 @@
</template> </template>
<script> <script>
import {DrawProxyTrafficChart} from '../utils/chart.js' import {DrawProxyTrafficChart} from "../utils/chart.js"
export default {
export default {
props: ['proxy_name'], props: ['proxy_name'],
created() { created() {
this.fetchData() this.fetchData()

View File

@ -1,15 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>frps dashboard</title>
</head>
<body>
<div id="app"></div>
<!--<script src="https://code.jquery.com/jquery-3.2.0.min.js"></script>-->
<!--<script src="//cdn.bootcss.com/echarts/3.4.0/echarts.min.js"></script>-->
</body>
</html>

View File

@ -1,27 +1,13 @@
import Vue from 'vue' import Vue from "vue"
//import ElementUI from 'element-ui' import {Button, Col, Form, FormItem, Menu, MenuItem, Popover, Row, Submenu, Table, TableColumn, Tag} from "element-ui"
import { import lang from "element-ui/lib/locale/lang/en"
Button, import locale from "element-ui/lib/locale"
Form, import "element-ui/lib/theme-chalk/index.css"
FormItem, import "./utils/less/custom.less"
Row,
Col,
Table,
TableColumn,
Popover,
Menu,
Submenu,
MenuItem,
Tag
} from 'element-ui'
import lang from 'element-ui/lib/locale/lang/en'
import locale from 'element-ui/lib/locale'
import 'element-ui/lib/theme-chalk/index.css'
import './utils/less/custom.less'
import App from './App.vue' import App from "./App.vue"
import router from './router' import router from "./router"
import 'whatwg-fetch' import "whatwg-fetch"
locale.use(lang) locale.use(lang)
@ -39,10 +25,7 @@ Vue.use(MenuItem)
Vue.use(Tag) Vue.use(Tag)
Vue.config.productionTip = false Vue.config.productionTip = false
new Vue({ new Vue({
el: '#app',
router, router,
template: '<App/>', render: h => h(App),
components: { App } }).$mount('#app')
})

View File

@ -1,11 +1,11 @@
import Vue from 'vue' import Vue from "vue"
import Router from 'vue-router' import Router from "vue-router"
import Overview from '../components/Overview.vue' import Overview from "../components/Overview.vue"
import ProxiesTcp from '../components/ProxiesTcp.vue' import ProxiesTcp from "../components/ProxiesTcp.vue"
import ProxiesUdp from '../components/ProxiesUdp.vue' import ProxiesUdp from "../components/ProxiesUdp.vue"
import ProxiesHttp from '../components/ProxiesHttp.vue' import ProxiesHttp from "../components/ProxiesHttp.vue"
import ProxiesHttps from '../components/ProxiesHttps.vue' import ProxiesHttps from "../components/ProxiesHttps.vue"
import ProxiesStcp from '../components/ProxiesStcp.vue' import ProxiesStcp from "../components/ProxiesStcp.vue"
Vue.use(Router) Vue.use(Router)

View File

@ -1,107 +0,0 @@
const path = require('path')
var webpack = require('webpack')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var VueLoaderPlugin = require('vue-loader/lib/plugin')
var url = require('url')
var publicPath = ''
module.exports = (options = {}) => ({
entry: {
vendor: './src/main'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: options.dev ? '[name].js' : '[name].js?[chunkhash]',
chunkFilename: '[id].js?[chunkhash]',
publicPath: options.dev ? '/assets/' : publicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': path.resolve(__dirname, 'src'),
}
},
module: {
rules: [{
test: /\.vue$/,
loader: 'vue-loader'
}, {
test: /\.js$/,
use: ['babel-loader'],
exclude: /node_modules/
}, {
test: /\.html$/,
use: [{
loader: 'html-loader',
options: {
root: path.resolve(__dirname, 'src'),
attrs: ['img:src', 'link:href']
}
}]
}, {
test: /\.less$/,
loader: 'style-loader!css-loader!postcss-loader!less-loader'
}, {
test: /\.css$/,
use: ['style-loader', 'css-loader', 'postcss-loader']
}, {
test: /favicon\.png$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
}]
}, {
test: /\.(png|jpg|jpeg|gif|eot|ttf|woff|woff2|svg|svgz)(\?.+)?$/,
exclude: /favicon\.png$/,
use: [{
loader: 'url-loader',
options: {
limit: 10000
}
}]
}]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({
names: ['vendor', 'manifest']
}),
new HtmlWebpackPlugin({
favicon: 'src/assets/favicon.ico',
template: 'src/index.html'
}),
new webpack.NormalModuleReplacementPlugin(/element-ui[\/\\]lib[\/\\]locale[\/\\]lang[\/\\]zh-CN/, 'element-ui/lib/locale/lang/en'),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: false,
comments: false,
compress: {
warnings: false
}
}),
new VueLoaderPlugin()
],
devServer: {
host: '127.0.0.1',
port: 8010,
proxy: {
'/api/': {
target: 'http://127.0.0.1:8080',
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
},
historyApiFallback: {
index: url.parse(options.dev ? '/assets/' : publicPath).pathname
}
}//,
//devtool: options.dev ? '#eval-source-map' : '#source-map'
})