├── src ├── index.less ├── initReducer.js ├── fonts │ ├── pomelo.ttf │ ├── icomoon.eot │ ├── icomoon.ttf │ └── icomoon.woff ├── images │ ├── logo.png │ └── logo-no-circle.png ├── routers │ ├── Login │ │ ├── images │ │ │ ├── qq.png │ │ │ ├── logo.png │ │ │ ├── weixin.png │ │ │ └── logo-no-circle.png │ │ ├── Callback.js │ │ └── index.scss │ ├── Logs │ │ ├── images │ │ │ ├── pig1.png │ │ │ ├── pig2.png │ │ │ ├── pig3.png │ │ │ └── pig4.png │ │ ├── logs.scss │ │ └── Multi.js │ ├── Term │ │ ├── images │ │ │ ├── pig1.png │ │ │ ├── pig2.png │ │ │ ├── pig3.png │ │ │ └── pig4.png │ │ ├── fullscreen.css │ │ └── logs.scss │ ├── Config │ │ ├── images │ │ │ ├── pig1.png │ │ │ ├── pig2.png │ │ │ └── pig3.png │ │ └── index.scss │ ├── NoMatch │ │ ├── index.scss │ │ └── index.js │ ├── Reg │ │ ├── RegAwait.js │ │ ├── Activate.js │ │ └── index.js │ ├── Pwd │ │ ├── Reset.js │ │ └── index.js │ ├── Binding │ │ └── index.js │ └── Settings │ │ └── UserSetting.js ├── components │ ├── Config │ │ ├── images │ │ │ └── pig.png │ │ ├── index.js │ │ └── index.scss │ ├── Header │ │ ├── index.scss │ │ ├── Header2.js │ │ └── index.js │ ├── Source │ │ ├── index.scss │ │ ├── index.js │ │ ├── Agent.js │ │ └── Group.js │ ├── CopyRight │ │ └── index.js │ ├── Right │ │ ├── index.scss │ │ └── index.js │ └── Setting │ │ └── index.js ├── defaultData.js ├── actions │ ├── AjaxAction.js │ ├── CommonAction.js │ ├── SettingAction.js │ ├── index.js │ └── LoginAction.js ├── configureStore.js ├── utils │ ├── crypto.js │ ├── CheckList.js │ ├── ajax.js │ ├── url.js │ └── ApiList.js ├── logo.svg ├── index.scss └── index.js ├── images ├── log.jpg ├── config.png └── taillog.png ├── public ├── logo.ico ├── logo.png ├── logo.icns ├── favicon.ico ├── font-awesome-4.7.0 │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ ├── less │ │ ├── screen-reader.less │ │ ├── fixed-width.less │ │ ├── larger.less │ │ ├── list.less │ │ ├── core.less │ │ ├── stacked.less │ │ ├── font-awesome.less │ │ ├── bordered-pulled.less │ │ ├── rotated-flipped.less │ │ ├── path.less │ │ ├── animated.less │ │ └── mixins.less │ ├── scss │ │ ├── _fixed-width.scss │ │ ├── _screen-reader.scss │ │ ├── _larger.scss │ │ ├── _list.scss │ │ ├── _core.scss │ │ ├── font-awesome.scss │ │ ├── _stacked.scss │ │ ├── _bordered-pulled.scss │ │ ├── _rotated-flipped.scss │ │ ├── _path.scss │ │ ├── _animated.scss │ │ └── _mixins.scss │ └── HELP-US-OUT.txt ├── manifest.json └── index.html ├── scripts ├── main.js ├── test.js ├── start.js └── build.js ├── config ├── jest │ ├── fileTransform.js │ └── cssTransform.js ├── polyfills.js ├── paths.js ├── env.js └── webpackDevServer.config.js ├── .gitignore ├── node ├── Service │ ├── CommonServer.js │ ├── AgentServer.js │ ├── SSHServer.js │ └── GroupServer.js ├── WebSocketServer.js ├── TermSSH.js └── WebServer.js ├── LICENSE ├── package.json └── README.md /src/index.less: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/initReducer.js: -------------------------------------------------------------------------------- 1 | export default {} -------------------------------------------------------------------------------- /images/log.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/images/log.jpg -------------------------------------------------------------------------------- /public/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/public/logo.ico -------------------------------------------------------------------------------- /public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/public/logo.png -------------------------------------------------------------------------------- /images/config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/images/config.png -------------------------------------------------------------------------------- /public/logo.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/public/logo.icns -------------------------------------------------------------------------------- /images/taillog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/images/taillog.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /src/fonts/pomelo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/fonts/pomelo.ttf -------------------------------------------------------------------------------- /src/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/images/logo.png -------------------------------------------------------------------------------- /src/fonts/icomoon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/fonts/icomoon.eot -------------------------------------------------------------------------------- /src/fonts/icomoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/fonts/icomoon.ttf -------------------------------------------------------------------------------- /src/fonts/icomoon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/fonts/icomoon.woff -------------------------------------------------------------------------------- /src/images/logo-no-circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/images/logo-no-circle.png -------------------------------------------------------------------------------- /src/routers/Login/images/qq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/routers/Login/images/qq.png -------------------------------------------------------------------------------- /src/routers/Logs/images/pig1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/routers/Logs/images/pig1.png -------------------------------------------------------------------------------- /src/routers/Logs/images/pig2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/routers/Logs/images/pig2.png -------------------------------------------------------------------------------- /src/routers/Logs/images/pig3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/routers/Logs/images/pig3.png -------------------------------------------------------------------------------- /src/routers/Logs/images/pig4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/routers/Logs/images/pig4.png -------------------------------------------------------------------------------- /src/routers/Term/images/pig1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/routers/Term/images/pig1.png -------------------------------------------------------------------------------- /src/routers/Term/images/pig2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/routers/Term/images/pig2.png -------------------------------------------------------------------------------- /src/routers/Term/images/pig3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/routers/Term/images/pig3.png -------------------------------------------------------------------------------- /src/routers/Term/images/pig4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/routers/Term/images/pig4.png -------------------------------------------------------------------------------- /src/routers/Config/images/pig1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/routers/Config/images/pig1.png -------------------------------------------------------------------------------- /src/routers/Config/images/pig2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/routers/Config/images/pig2.png -------------------------------------------------------------------------------- /src/routers/Config/images/pig3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/routers/Config/images/pig3.png -------------------------------------------------------------------------------- /src/routers/Login/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/routers/Login/images/logo.png -------------------------------------------------------------------------------- /src/routers/Login/images/weixin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/routers/Login/images/weixin.png -------------------------------------------------------------------------------- /src/components/Config/images/pig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/components/Config/images/pig.png -------------------------------------------------------------------------------- /src/components/Header/index.scss: -------------------------------------------------------------------------------- 1 | .login-badge { 2 | .ant-badge-status-processing { 3 | background-color: #ffbf00; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/routers/Login/images/logo-no-circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/src/routers/Login/images/logo-no-circle.png -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/public/font-awesome-4.7.0/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/public/font-awesome-4.7.0/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/public/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /src/defaultData.js: -------------------------------------------------------------------------------- 1 | export const listParams = { 2 | "dir": "DESC", 3 | "current": 1,//保持antd的风格 4 | "pageSize": 10, 5 | "sortKey": "createTime", 6 | }; -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/public/font-awesome-4.7.0/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/djmpink/TailLog-Source/HEAD/public/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/less/screen-reader.less: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { .sr-only(); } 5 | .sr-only-focusable { .sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/less/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/scss/_fixed-width.scss: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .#{$fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/scss/_screen-reader.scss: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { @include sr-only(); } 5 | .sr-only-focusable { @include sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /src/routers/Term/fullscreen.css: -------------------------------------------------------------------------------- 1 | .xterm.fullscreen { 2 | position: fixed; 3 | top: 0; 4 | bottom: 0; 5 | left: 0; 6 | right: 0; 7 | width: auto; 8 | height: auto; 9 | z-index: 255; 10 | } 11 | -------------------------------------------------------------------------------- /scripts/main.js: -------------------------------------------------------------------------------- 1 | const {webSocketServer} = require('../node/WebSocketServer'); 2 | const {webServer} = require('../node/WebServer'); 3 | const {termSSH} = require('../node/TermSSH'); 4 | //启动本地后端服务 5 | webServer();//启动后台web服务 6 | webSocketServer();//启动连接SSH服务器websocket服务 7 | termSSH();//启动终端工具websocket服务 -------------------------------------------------------------------------------- /src/actions/AjaxAction.js: -------------------------------------------------------------------------------- 1 | import CommonAction from "./CommonAction"; 2 | import LoginAction from "./LoginAction"; 3 | import LogAction from "./LogAction"; 4 | import SettingAction from "./SettingAction"; 5 | 6 | export default { 7 | ...CommonAction, 8 | ...LoginAction, 9 | ...LogAction, 10 | ...SettingAction, 11 | } -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/HELP-US-OUT.txt: -------------------------------------------------------------------------------- 1 | I hope you love Font Awesome. If you've found it useful, please do me a favor and check out my latest project, 2 | Fort Awesome (https://fortawesome.com). It makes it easy to put the perfect icons on your website. Choose from our awesome, 3 | comprehensive icon sets or copy and paste your own. 4 | 5 | Please. Check it out. 6 | 7 | -Dave Gandy 8 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /config/jest/fileTransform.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | 5 | // This is a custom Jest transformer turning file imports into filenames. 6 | // http://facebook.github.io/jest/docs/tutorial-webpack.html 7 | 8 | module.exports = { 9 | process(src, filename) { 10 | return `module.exports = ${JSON.stringify(path.basename(filename))};`; 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /config/jest/cssTransform.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // This is a custom Jest transformer turning style imports into empty objects. 4 | // http://facebook.github.io/jest/docs/tutorial-webpack.html 5 | 6 | module.exports = { 7 | process() { 8 | return 'module.exports = {};'; 9 | }, 10 | getCacheKey() { 11 | // The output is always the same. 12 | return 'cssTransform'; 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /src/configureStore.js: -------------------------------------------------------------------------------- 1 | import {applyMiddleware, compose, createStore} from "redux"; 2 | import thunkMiddleware from "redux-thunk"; 3 | 4 | const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; 5 | 6 | export default (reducer, initialState) => { 7 | return createStore(reducer, initialState, composeEnhancers( 8 | applyMiddleware( 9 | thunkMiddleware 10 | ) 11 | )); 12 | }; -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/less/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | 11 | # misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | .idea/ 22 | /OutApp/ 23 | /*.dmg 24 | /*.iml 25 | /node/.database/ 26 | /build/ 27 | /app/ -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/scss/_larger.scss: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .#{$fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .#{$fa-css-prefix}-2x { font-size: 2em; } 11 | .#{$fa-css-prefix}-3x { font-size: 3em; } 12 | .#{$fa-css-prefix}-4x { font-size: 4em; } 13 | .#{$fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/less/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: (-@fa-li-width + (4em / 14)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/scss/_list.scss: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: $fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .#{$fa-css-prefix}-li { 11 | position: absolute; 12 | left: -$fa-li-width; 13 | width: $fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.#{$fa-css-prefix}-lg { 17 | left: -$fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/less/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/scss/_core.scss: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/scss/font-awesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "animated"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | @import "screen-reader"; 19 | -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/less/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/scss/_stacked.scss: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; } 21 | -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/less/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables.less"; 7 | @import "mixins.less"; 8 | @import "path.less"; 9 | @import "core.less"; 10 | @import "larger.less"; 11 | @import "fixed-width.less"; 12 | @import "list.less"; 13 | @import "bordered-pulled.less"; 14 | @import "animated.less"; 15 | @import "rotated-flipped.less"; 16 | @import "stacked.less"; 17 | @import "icons.less"; 18 | @import "screen-reader.less"; 19 | -------------------------------------------------------------------------------- /node/Service/CommonServer.js: -------------------------------------------------------------------------------- 1 | //封装返回数据 2 | const response = (err, resp, date) => { 3 | if (err) { 4 | errorResponse(resp, err); 5 | } else { 6 | successResponse(resp, date); 7 | } 8 | }; 9 | 10 | const successResponse = (resp, date) => { 11 | resp.send({ 12 | "msg": "success", 13 | "result": true, 14 | "data": date 15 | }); 16 | }; 17 | 18 | const errorResponse = (resp, msg) => { 19 | resp.send({ 20 | "msg": msg, 21 | "result": false 22 | }); 23 | }; 24 | 25 | module.exports = { 26 | successResponse, 27 | errorResponse, 28 | response 29 | }; -------------------------------------------------------------------------------- /src/routers/NoMatch/index.scss: -------------------------------------------------------------------------------- 1 | #react-content { 2 | height: 100%; 3 | background-color: #fff; 4 | } 5 | #page-404 { 6 | width: 100%; 7 | height: 100%; 8 | background: url(https://os.alipayobjects.com/rmsportal/NOAjOBbnYCrNzrW.jpg) no-repeat fixed 50%; 9 | background-size: 100%; 10 | position: fixed; 11 | top: 0; 12 | left: 0; 13 | right: 0; 14 | bottom: 0; 15 | z-index: 100; 16 | } 17 | #page-404 section { 18 | position: absolute; 19 | top: 48%; 20 | left: 55%; 21 | margin: -103px 0 0 -120px; 22 | text-align: center; 23 | } 24 | #page-404 h1 { 25 | color: #94a5e3; 26 | font-size: 120px; 27 | font-weight: 500; 28 | } -------------------------------------------------------------------------------- /src/utils/crypto.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by CoolGuy on 2017/3/18. 3 | * 用于加解密,目前先简单地实现一个移位算法 4 | */ 5 | 6 | export let en = (str) => { 7 | let len = str.length; 8 | let arr = []; 9 | for (let i = 0; i < len; i++) { 10 | arr[i] = str.charCodeAt(i);//charCodeAt 总是返回一个小于 65,536 的值 11 | arr[i] += 10; 12 | } 13 | return arr.join(","); 14 | }; 15 | 16 | export let de = (str) => { 17 | let arr = str.split(","); 18 | if (!arr || !arr.length) { 19 | return str;//兼容旧的没有加密的密码 20 | } 21 | arr = arr.map((v) => { 22 | return (Number(v) - 10); 23 | }); 24 | return String.fromCharCode(...arr); 25 | 26 | }; 27 | -------------------------------------------------------------------------------- /config/polyfills.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | if (typeof Promise === 'undefined') { 4 | // Rejection tracking prevents a common issue where React gets into an 5 | // inconsistent state due to an error, but it gets swallowed by a Promise, 6 | // and the user has no idea what causes React's erratic future behavior. 7 | require('promise/lib/rejection-tracking').enable(); 8 | window.Promise = require('promise/lib/es6-extensions.js'); 9 | } 10 | 11 | // fetch() polyfill for making API calls. 12 | require('whatwg-fetch'); 13 | 14 | // Object.assign() is commonly used with React. 15 | // It will use the native implementation if it's present and isn't buggy. 16 | Object.assign = require('object-assign'); 17 | -------------------------------------------------------------------------------- /src/actions/CommonAction.js: -------------------------------------------------------------------------------- 1 | const AJAX_START = "AJAX_START";//通用ajax开始 2 | const AJAX_FAIL = "AJAX_FAIL";//通用ajax失败 3 | const AJAX_LOADING_START = "AJAX_LOADING_START";//通用的带加载的ajax开始 4 | let ajaxStart = (data) => { 5 | //考虑获取ajax前的处理 6 | return { 7 | type: AJAX_START, 8 | data 9 | } 10 | }; 11 | let ajaxFail = (data) => { 12 | return { 13 | type: AJAX_FAIL, 14 | data 15 | } 16 | }; 17 | let ajaxLoadingStart = (data) => { 18 | return { 19 | type: AJAX_LOADING_START, 20 | data 21 | } 22 | }; 23 | export default { 24 | AJAX_START, 25 | AJAX_FAIL, 26 | AJAX_LOADING_START, 27 | ajaxStart, 28 | ajaxFail, 29 | ajaxLoadingStart, 30 | } -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/less/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .@{fa-css-prefix}-pull-left { float: left; } 11 | .@{fa-css-prefix}-pull-right { float: right; } 12 | 13 | .@{fa-css-prefix} { 14 | &.@{fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.@{fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .@{fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/scss/_bordered-pulled.scss: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em $fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .#{$fa-css-prefix}-pull-left { float: left; } 11 | .#{$fa-css-prefix}-pull-right { float: right; } 12 | 13 | .#{$fa-css-prefix} { 14 | &.#{$fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.#{$fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .#{$fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/less/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .@{fa-css-prefix}-rotate-90, 15 | :root .@{fa-css-prefix}-rotate-180, 16 | :root .@{fa-css-prefix}-rotate-270, 17 | :root .@{fa-css-prefix}-flip-horizontal, 18 | :root .@{fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /src/routers/NoMatch/index.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from "react"; 2 | import {Link} from "react-router"; 3 | //styles 4 | import "./index.scss"; 5 | export default class NoMatch extends Component { 6 | render() { 7 | return ( 8 |
9 |
10 |
11 |

404

12 |

13 | 你要找的页面不存在 14 |

15 | 主页 16 | 登录 17 |
18 |
19 |
20 | ) 21 | } 22 | } -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/scss/_rotated-flipped.scss: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } 5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } 6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } 7 | 8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } 9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .#{$fa-css-prefix}-rotate-90, 15 | :root .#{$fa-css-prefix}-rotate-180, 16 | :root .#{$fa-css-prefix}-rotate-270, 17 | :root .#{$fa-css-prefix}-flip-horizontal, 18 | :root .#{$fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/less/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'), 9 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 10 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 11 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /scripts/test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // Do this as the first thing so that any code reading it knows the right env. 4 | process.env.BABEL_ENV = 'test'; 5 | process.env.NODE_ENV = 'test'; 6 | process.env.PUBLIC_URL = ''; 7 | 8 | // Makes the script crash on unhandled rejections instead of silently 9 | // ignoring them. In the future, promise rejections that are not handled will 10 | // terminate the Node.js process with a non-zero exit code. 11 | process.on('unhandledRejection', err => { 12 | throw err; 13 | }); 14 | 15 | // Ensure environment variables are read. 16 | require('../config/env'); 17 | 18 | const jest = require('jest'); 19 | const argv = process.argv.slice(2); 20 | 21 | // Watch unless on CI or in coverage mode 22 | if (!process.env.CI && argv.indexOf('--coverage') < 0) { 23 | argv.push('--watch'); 24 | } 25 | 26 | 27 | jest.run(argv); 28 | -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/scss/_path.scss: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); 7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), 8 | url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'), 9 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), 10 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), 11 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/less/animated.less: -------------------------------------------------------------------------------- 1 | // Animated Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .@{fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/scss/_animated.scss: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .#{$fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .#{$fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/components/Source/index.scss: -------------------------------------------------------------------------------- 1 | .ant-select-lg .ant-select-selection--single { 2 | height: 32px; 3 | color: #ccc; 4 | font-size: 14px; 5 | background-color: #3e434e; 6 | border-width: 0; 7 | .ant-select-selection__placeholder { 8 | color: #888 9 | } 10 | } 11 | 12 | .ant-select-dropdown { 13 | background: #94a5e3; 14 | } 15 | 16 | .ant-select-dropdown-menu-item { 17 | color: #ffffff; 18 | background-color: #94a5e3; 19 | } 20 | 21 | .ant-select-dropdown-menu-item:hover { 22 | background-color: #7289da; 23 | color: #ffffff; 24 | } 25 | 26 | .ant-select-dropdown-menu-item-active { 27 | background-color: #94a5e3; 28 | } 29 | 30 | 31 | .ant-modal-footer{ 32 | button, html [type="button"], [type="reset"], [type="submit"] { 33 | -webkit-appearance: button; 34 | background: rgba(204, 204, 204, 0); 35 | color: #94a5e3; 36 | border-color: #3e434e; 37 | } 38 | .ant-btn:hover, .ant-btn:focus, .ant-btn:active, .ant-btn.active { 39 | background: #343842; 40 | border-color: #3e434e; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 zhouli 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/utils/CheckList.js: -------------------------------------------------------------------------------- 1 | export default { 2 | username: (str) => { 3 | return /^[\w\d]+$/.test(str); 4 | }, 5 | password: (str) => { 6 | //6~20位 7 | return /^.{6,20}$/.test(str); 8 | }, 9 | //手机号码校验 10 | mobile(text){ 11 | return /^(1\d{10})$/.test(text); 12 | }, 13 | // 身份证校验 14 | identity(text){ 15 | let weightFactor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; //加权因子 16 | let verifyCode = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2']; //校验码 17 | let sum = 0; 18 | let mod = 0; 19 | 20 | if (!(/^\s*[0-9]{17}[0-9X]\s*$/).test(text)) { 21 | return false; 22 | } 23 | 24 | for (let i = 0; i < 17; ++i) { 25 | sum += text[i] * weightFactor[i]; 26 | } 27 | mod = sum % 11; 28 | 29 | return (text[17] === verifyCode[mod]); 30 | }, 31 | //QQ号码校验 32 | QCheck(text){ 33 | return /^[1-9]\d{4,10}$/.test(text); 34 | }, 35 | //邮箱校验 36 | emailCheck(text){ 37 | return /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(text); 38 | }, 39 | } -------------------------------------------------------------------------------- /src/components/CopyRight/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import {Badge, Col, Layout, Row} from "antd"; 3 | const {Footer} = Layout; 4 | export default () => ( 5 | 6 | 32 | 33 | ) -------------------------------------------------------------------------------- /src/components/Right/index.scss: -------------------------------------------------------------------------------- 1 | $rightWidth: 100%; 2 | .right-detail { 3 | position: fixed; 4 | top: 0; 5 | right: 0; 6 | left: 0; 7 | bottom: 0; 8 | background-color: rgba(55, 55, 55, .6); 9 | height: 100%; 10 | z-index: 1000; 11 | .content { 12 | box-shadow: 0 0 29px #060606; 13 | background: #292C34; 14 | width: $rightWidth; 15 | min-width: 960px; 16 | position: absolute; 17 | right: 0; 18 | top: 0; 19 | bottom: 0; 20 | animation: right-in .35s ease-out; 21 | //animation: fade-in;/*动画名称*/ 22 | //animation-duration: 0.3s;/*动画持续时间*/ 23 | //-webkit-animation:fade-in 0.5s;/*针对webkit内核*/ 24 | } 25 | } 26 | 27 | @keyframes right-in { 28 | from { 29 | right: -$rightWidth; 30 | } 31 | to { 32 | right: 0; 33 | } 34 | } 35 | 36 | @keyframes fade-in { 37 | 0% { 38 | opacity: 0; 39 | } 40 | /*初始状态 透明度为0*/ 41 | 50% { 42 | opacity: 0; 43 | } 44 | /*过渡状态 透明度为0*/ 45 | 100% { 46 | opacity: 1; 47 | } 48 | /*结束状态 透明度为1*/ 49 | } 50 | 51 | @-webkit-keyframes fade-in { /*针对webkit内核*/ 52 | 0% { 53 | opacity: 0; 54 | } 55 | 50% { 56 | opacity: 0; 57 | } 58 | 100% { 59 | opacity: 1; 60 | } 61 | } -------------------------------------------------------------------------------- /src/routers/Reg/RegAwait.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import {connect} from "react-redux"; 3 | import {Button, Card, Col, Layout, Row} from "antd"; 4 | import "../Login/index.scss"; 5 | import Header from "../../components/Header/Header2"; 6 | 7 | //等待注册激活页 8 | class RegAwait extends React.Component { 9 | login = () => { 10 | let {router} = this.props; 11 | router.push('/login'); 12 | }; 13 | 14 | render() { 15 | return ( 16 | 17 |
18 |
19 | 20 |

已发送注册邮件,请点击邮件链接激活

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
30 | 31 | ) 32 | 33 | } 34 | } 35 | 36 | export default connect()(RegAwait); -------------------------------------------------------------------------------- /src/routers/Login/Callback.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import "./index.scss"; 3 | import AjaxAction from "../../actions/AjaxAction"; 4 | import {connect} from "react-redux"; 5 | import {Card, Layout} from "antd"; 6 | import Header from "../../components/Header/Header2"; 7 | 8 | //登录成功页面 9 | class Callback extends React.Component { 10 | 11 | componentDidMount() { 12 | let {dispatch} = this.props; 13 | let platform = this.props.params.platform; 14 | let {code} = this.props.location.query; 15 | let {router} = this.props; 16 | dispatch(AjaxAction.oauth2Callback(platform, code)).then((data) => { 17 | if (data.result) { 18 | router.push('/config'); 19 | } 20 | }); 21 | } 22 | 23 | render() { 24 | return ( 25 | 26 |
27 |
28 | 29 |

登录成功

30 |
31 |
32 | 33 | ) 34 | } 35 | } 36 | export default connect((state) => { 37 | return { 38 | user: state.user 39 | } 40 | })((Callback)); -------------------------------------------------------------------------------- /src/routers/Reg/Activate.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import {connect} from "react-redux"; 3 | import {Button, Card, Col, Layout, Row} from "antd"; 4 | import AjaxAction from "../../actions/AjaxAction"; 5 | import "../Login/index.scss"; 6 | import Header from "../../components/Header/Header2"; 7 | 8 | //注册激活页 9 | class Activate extends React.Component { 10 | 11 | componentDidMount() { 12 | let {dispatch, router} = this.props; 13 | let {email, ticket} = this.props.location.query; 14 | dispatch(AjaxAction.activate(email, ticket)).then((data) => { 15 | if (data.result) { 16 | setTimeout(() => { 17 | router.push('/login'); 18 | }, 3000) 19 | } 20 | }); 21 | } 22 | 23 | render() { 24 | return ( 25 | 26 |
27 |
28 | 29 | 30 |

注册成功,马上体验

31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |
39 |
40 | 41 | 42 | ) 43 | 44 | } 45 | } 46 | ; 47 | export default connect((state) => ({state: state}))((Activate)); -------------------------------------------------------------------------------- /src/routers/Term/logs.scss: -------------------------------------------------------------------------------- 1 | /*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/ 2 | ::-webkit-scrollbar 3 | { 4 | width: 12px; 5 | } 6 | 7 | /*定义滚动条轨道 内阴影+圆角*/ 8 | ::-webkit-scrollbar-track 9 | { 10 | -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); 11 | border-radius: 0px; 12 | background-color: rgb(62, 67, 78); 13 | 14 | } 15 | 16 | /*定义滑块 内阴影+圆角*/ 17 | ::-webkit-scrollbar-thumb 18 | { 19 | border-radius: 10px; 20 | background-color: rgba(148, 165, 227, 0.35); 21 | //border-color: #36393e; 22 | border: 2px solid #36393e; 23 | } 24 | 25 | .ant-cascader-menu{ 26 | height:100% 27 | } 28 | 29 | .command-input { 30 | &.ant-input-affix-wrapper .ant-input:not(:first-child) { 31 | padding-left: 40px; 32 | } 33 | input { 34 | background: transparent; 35 | border: 0; 36 | color: #ccc; 37 | } 38 | ::placeholder { 39 | color: #aaaaaa; 40 | } 41 | } 42 | 43 | .search-input { 44 | input { 45 | background: transparent; 46 | border: 0; 47 | color: #ccc; 48 | } 49 | ::placeholder { 50 | color: #aaaaaa; 51 | text-align: center; 52 | } 53 | } 54 | 55 | .config-list-back-image4 { 56 | width: 300px; 57 | height: 300px; 58 | background: url('./images/pig4.png') no-repeat; 59 | background-size: contain; 60 | opacity: 0.5; 61 | } 62 | //如果网格数有变化,请修改这个值 63 | $current_grid: 23; 64 | .layout .animatedRow.animateWidth{ 65 | width: $current_grid / 24 *100%; 66 | opacity: 1; 67 | padding:0 1px;//防止左右按钮的左右边显示有问题 68 | } 69 | .layout-header-second{ 70 | background-color: transparent; 71 | transition: 1s background-color; 72 | } 73 | .animateColor{ 74 | background-color: #3E434E; 75 | } 76 | .animatedRow{ 77 | transition: 1s all; 78 | width: 0; 79 | overflow: hidden; 80 | opacity: 0; 81 | } -------------------------------------------------------------------------------- /src/actions/SettingAction.js: -------------------------------------------------------------------------------- 1 | import Ajax from "../utils/ajax.js"; 2 | import API from "../utils/ApiList"; 3 | 4 | const { 5 | ajaxCommon 6 | } = Ajax; 7 | const USER_SETTING_ACCOUNT = "USER_SETTING_ACCOUNT";//获取用户账户信息信息 8 | const USER_SETTING_INFO = "USER_SETTING_INFO";//获取用户信息 9 | const USER_SETTING_INFO_EDIT = "USER_SETTING_INFO_EDIT";//设置用户信息 10 | const USER_SETTING_FEEDBACK = "USER_SETTING_FEEDBACK";//反馈意见 11 | 12 | export default { 13 | USER_SETTING_ACCOUNT, 14 | userSettingAccount: () => { 15 | return ajaxCommon({ 16 | api: API.UserSetting.account, 17 | success: (data) => ({ 18 | type: USER_SETTING_ACCOUNT, 19 | data 20 | }) 21 | }); 22 | }, 23 | USER_SETTING_INFO, 24 | userSettingInfo: () => { 25 | return ajaxCommon({ 26 | api: API.UserSetting.info, 27 | success: (data) => ({ 28 | type: USER_SETTING_INFO, 29 | data 30 | }) 31 | }); 32 | }, 33 | USER_SETTING_INFO_EDIT, 34 | userSettingInfoEdit: (userInfoReq) => { 35 | return ajaxCommon({ 36 | api: API.UserSetting.infoEdit, 37 | data: userInfoReq, 38 | success: (data) => ({ 39 | type: USER_SETTING_INFO_EDIT, 40 | data, 41 | }) 42 | }); 43 | }, 44 | USER_SETTING_FEEDBACK, 45 | feedback: (contact, suggest) => { 46 | return ajaxCommon({ 47 | api: API.UserSetting.feedback, 48 | data: {contact, suggest}, 49 | success: (data) => ({ 50 | type: USER_SETTING_FEEDBACK, 51 | data 52 | }) 53 | }); 54 | }, 55 | } -------------------------------------------------------------------------------- /src/components/Right/index.js: -------------------------------------------------------------------------------- 1 | import React, {Component} from "react"; 2 | import "./index.scss"; 3 | import {Layout} from "antd"; 4 | const {Header, Content, Footer} = Layout; 5 | 6 | class Right extends Component { 7 | close = () => { 8 | this.props.close && this.props.close() 9 | }; 10 | 11 | render() { 12 | let {header, footer, children, show} = this.props; 13 | return ( 14 | show ? 15 |
16 |
{ 17 | e.stopPropagation(); 18 | }}> 19 | 20 | {header && 21 |
22 | {header} 23 |
24 | } 25 | 26 | 31 | {children} 32 | 33 | 34 | {footer && 35 |
36 | {footer} 37 |
38 | } 39 |
40 |
41 |
42 | : null 43 | ); 44 | } 45 | } 46 | export default Right; -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | 23 | TailLog 24 | 25 | 26 | 29 |
30 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/actions/index.js: -------------------------------------------------------------------------------- 1 | 2 | const SHOW_CONFIG_RIGHT = "SHOW_CONFIG_RIGHT"; 3 | const FILL_CURRENT_CONFIG = "FILL_CURRENT_CONFIG"; 4 | const REMOVE_CURRENT_CONFIG = "REMOVE_CURRENT_CONFIG"; 5 | const FILL_DROPDOWN = "FILL_DROPDOWN"; 6 | const FILL_CURRENT_AGENT = "FILL_CURRENT_AGENT"; 7 | const FILL_CURRENT_SSH = "FILL_CURRENT_SSH"; 8 | const REMOVE_CURRENT_AGENT = "REMOVE_CURRENT_AGENT"; 9 | const REMOVE_CURRENT_SSH = "REMOVE_CURRENT_SSH"; 10 | const REMOVE_CURRENT_GROUP = "REMOVE_CURRENT_GROUP"; 11 | const FILL_CURRENT_GROUP = "FILL_CURRENT_GROUP"; 12 | export default { 13 | SHOW_CONFIG_RIGHT, 14 | showConfigRight: (flag) => ({ 15 | type: SHOW_CONFIG_RIGHT, 16 | flag, 17 | }), 18 | FILL_DROPDOWN, 19 | fillDropdown: (record) => ({ 20 | type: FILL_DROPDOWN, 21 | record 22 | }), 23 | FILL_CURRENT_CONFIG, 24 | fillCurrentConfig: (record) => ({ 25 | type: FILL_CURRENT_CONFIG, 26 | record 27 | }), 28 | REMOVE_CURRENT_CONFIG, 29 | removeCurrentConfig: () => ({ 30 | type: REMOVE_CURRENT_CONFIG, 31 | }), 32 | FILL_CURRENT_AGENT, 33 | fillCurrentAgent: (record) => ({ 34 | type: FILL_CURRENT_AGENT, 35 | record 36 | }), 37 | REMOVE_CURRENT_AGENT, 38 | removeCurrentAgent: () => ({ 39 | type: REMOVE_CURRENT_AGENT, 40 | }), 41 | FILL_CURRENT_SSH, 42 | fillCurrentSSH: (record) => ({ 43 | type: FILL_CURRENT_SSH, 44 | record 45 | }), 46 | REMOVE_CURRENT_SSH, 47 | removeCurrentSSH: () => ({ 48 | type: REMOVE_CURRENT_SSH, 49 | }), 50 | REMOVE_CURRENT_GROUP, 51 | removeCurrentGroup: () => ({ 52 | type: REMOVE_CURRENT_GROUP, 53 | }), 54 | FILL_CURRENT_GROUP, 55 | fillCurrentGroup: (record) => ({ 56 | type: FILL_CURRENT_GROUP, 57 | record 58 | }), 59 | 60 | } -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/less/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | .fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | 14 | .fa-icon-rotate(@degrees, @rotation) { 15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation})"; 16 | -webkit-transform: rotate(@degrees); 17 | -ms-transform: rotate(@degrees); 18 | transform: rotate(@degrees); 19 | } 20 | 21 | .fa-icon-flip(@horiz, @vert, @rotation) { 22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation}, mirror=1)"; 23 | -webkit-transform: scale(@horiz, @vert); 24 | -ms-transform: scale(@horiz, @vert); 25 | transform: scale(@horiz, @vert); 26 | } 27 | 28 | 29 | // Only display content to screen readers. A la Bootstrap 4. 30 | // 31 | // See: http://a11yproject.com/posts/how-to-hide-content/ 32 | 33 | .sr-only() { 34 | position: absolute; 35 | width: 1px; 36 | height: 1px; 37 | padding: 0; 38 | margin: -1px; 39 | overflow: hidden; 40 | clip: rect(0,0,0,0); 41 | border: 0; 42 | } 43 | 44 | // Use in conjunction with .sr-only to only display content when it's focused. 45 | // 46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 47 | // 48 | // Credit: HTML5 Boilerplate 49 | 50 | .sr-only-focusable() { 51 | &:active, 52 | &:focus { 53 | position: static; 54 | width: auto; 55 | height: auto; 56 | margin: 0; 57 | overflow: visible; 58 | clip: auto; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /public/font-awesome-4.7.0/scss/_mixins.scss: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------- 3 | 4 | @mixin fa-icon() { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | 14 | @mixin fa-icon-rotate($degrees, $rotation) { 15 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation})"; 16 | -webkit-transform: rotate($degrees); 17 | -ms-transform: rotate($degrees); 18 | transform: rotate($degrees); 19 | } 20 | 21 | @mixin fa-icon-flip($horiz, $vert, $rotation) { 22 | -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}, mirror=1)"; 23 | -webkit-transform: scale($horiz, $vert); 24 | -ms-transform: scale($horiz, $vert); 25 | transform: scale($horiz, $vert); 26 | } 27 | 28 | 29 | // Only display content to screen readers. A la Bootstrap 4. 30 | // 31 | // See: http://a11yproject.com/posts/how-to-hide-content/ 32 | 33 | @mixin sr-only { 34 | position: absolute; 35 | width: 1px; 36 | height: 1px; 37 | padding: 0; 38 | margin: -1px; 39 | overflow: hidden; 40 | clip: rect(0,0,0,0); 41 | border: 0; 42 | } 43 | 44 | // Use in conjunction with .sr-only to only display content when it's focused. 45 | // 46 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 47 | // 48 | // Credit: HTML5 Boilerplate 49 | 50 | @mixin sr-only-focusable { 51 | &:active, 52 | &:focus { 53 | position: static; 54 | width: auto; 55 | height: auto; 56 | margin: 0; 57 | overflow: visible; 58 | clip: auto; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/routers/Login/index.scss: -------------------------------------------------------------------------------- 1 | .ant-card-bordered { 2 | 3 | border: 1px solid #2e313a; 4 | border-top-color: #7289da; 5 | } 6 | 7 | .ant-input-group-addon { 8 | color: #94a5e3; 9 | } 10 | 11 | .login-div { 12 | .login-badge{ 13 | .ant-badge-status-processing{ 14 | background-color: #ffbf00; 15 | } 16 | } 17 | //border: 1px solid #ccc; 18 | padding: 20px 40px 40px 40px; 19 | width: 550px; 20 | margin: 10% auto; 21 | background: #2e313a; 22 | h1 { 23 | font-size: 20px; 24 | text-align: center; 25 | margin-bottom: 40px; 26 | color: #94a5e3; 27 | } 28 | h2 { 29 | font-size: 16px; 30 | text-align: center; 31 | 32 | } 33 | color: #555; 34 | .remember { 35 | height: 48px; 36 | align-items: center; 37 | svg:first-child { 38 | fill: #666 !important; //hack 39 | } 40 | } 41 | .link { 42 | cursor: pointer; 43 | text-decoration: underline; 44 | color: #999; 45 | margin-left: 10px; 46 | } 47 | .btn-wrapper { 48 | margin-top: 15px; 49 | } 50 | .reg { 51 | margin: 20px 0; 52 | text-align: center; 53 | } 54 | .pwd { 55 | flex: 1; 56 | text-align: right; 57 | } 58 | .third-login { 59 | text-align: center; 60 | margin-top: 20px; 61 | margin-bottom: 10px; 62 | p { 63 | margin-bottom: 15px; 64 | } 65 | } 66 | .icon-qq { 67 | background: url("./images/qq.png") no-repeat; 68 | background-size: contain; 69 | } 70 | .icon-weixin { 71 | background: url("./images/weixin.png") no-repeat; 72 | background-size: contain; 73 | } 74 | .icon { 75 | display: inline-block; 76 | flex: 1; 77 | height: 40px; 78 | width: 40px; 79 | background-position: center center; 80 | cursor: pointer; 81 | } 82 | .third-login-i-wrapper { 83 | width: 200px; 84 | margin: 0 auto; 85 | display: flex; 86 | } 87 | } 88 | 89 | .flex-row { 90 | flex-direction: row; 91 | } -------------------------------------------------------------------------------- /src/components/Header/Header2.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import {connect} from "react-redux"; 3 | import {Col, Layout, Row,Badge,Tooltip,Button} from "antd"; 4 | import "./index.scss"; 5 | const {Header} = Layout; 6 | 7 | 8 | class Header2 extends React.Component { 9 | offLine = () => { 10 | this.props.router.push("/config"); 11 | }; 12 | render() { 13 | 14 | return ( 15 |
16 | 17 | 18 | T 29 | 30 | 31 | 36 | TailLog 37 | 38 | 39 | 40 | 41 | 44 | 46 | 47 | }/> 48 | 49 | 50 |
51 | ) 52 | } 53 | } 54 | 55 | export default connect()(Header2); 56 | -------------------------------------------------------------------------------- /node/WebSocketServer.js: -------------------------------------------------------------------------------- 1 | let Client = require('ssh2').Client; 2 | let websocket = require("nodejs-websocket"); 3 | 4 | //ssh连接,通过WebSocket实时传输日志信息 5 | const webSocketServer = function () { 6 | 7 | let server = websocket.createServer(function (ws) { 8 | 9 | ws.on("text", function (message) { 10 | console.log("===> request params:", message); 11 | let msg = JSON.parse(message.toString()); 12 | let ssh = msg.ssh; 13 | if (ssh === null) { 14 | return; 15 | } 16 | 17 | let conn = new Client(); 18 | conn.connect({ 19 | host: ssh.ip + "", 20 | port: Number(ssh.port), 21 | username: ssh.username + "", 22 | password: ssh.password + "" 23 | }); 24 | 25 | conn.on('ready', function () { 26 | console.log('===> connection ready'); 27 | 28 | let cmd = msg.content; 29 | console.log('===> cmd :', cmd + ""); 30 | 31 | conn.exec(cmd + "", function (err, stream) { 32 | if (err) throw err; 33 | stream.on('close', function (code, signal) { 34 | console.log('===> close: code: ' + code + ', signal: ' + signal); 35 | conn.end(); 36 | }).on('data', function (data) { 37 | try { 38 | ws.sendText("" + data); 39 | } catch (e) { 40 | console.log('===> WebSocket already closed' + e); 41 | conn.end(); 42 | } 43 | 44 | }).stderr.on('data', function (data) { 45 | console.log('===> exception: ' + data); 46 | }); 47 | }); 48 | }) 49 | }); 50 | ws.on("close", function (code, reason) { 51 | console.log("connection closed") 52 | }); 53 | ws.on("error", function (code, reason) { 54 | console.log("close exception") 55 | }); 56 | }).listen(10776); 57 | }; 58 | 59 | module.exports = { 60 | webSocketServer 61 | }; -------------------------------------------------------------------------------- /config/paths.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const path = require('path'); 4 | const fs = require('fs'); 5 | const url = require('url'); 6 | 7 | // Make sure any symlinks in the project folder are resolved: 8 | // https://github.com/facebookincubator/create-react-app/issues/637 9 | const appDirectory = fs.realpathSync(process.cwd()); 10 | const resolveApp = relativePath => path.resolve(appDirectory, relativePath); 11 | 12 | const envPublicUrl = process.env.PUBLIC_URL; 13 | 14 | function ensureSlash(path, needsSlash) { 15 | const hasSlash = path.endsWith('/'); 16 | if (hasSlash && !needsSlash) { 17 | return path.substr(path, path.length - 1); 18 | } else if (!hasSlash && needsSlash) { 19 | return `${path}/`; 20 | } else { 21 | return path; 22 | } 23 | } 24 | 25 | const getPublicUrl = appPackageJson => 26 | envPublicUrl || require(appPackageJson).homepage; 27 | 28 | // We use `PUBLIC_URL` environment variable or "homepage" field to infer 29 | // "public path" at which the app is served. 30 | // Webpack needs to know it to put the right