mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-21 05:19:42 +08:00
Merge branch 'dev' of http://gitlab.corp.qunar.com/mfe/yapi into dev
This commit is contained in:
commit
df18193c5f
@ -36,32 +36,16 @@
|
||||
}
|
||||
}
|
||||
.group-operate {
|
||||
height: 48px;
|
||||
padding: 10px 6px;
|
||||
background: #eee;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
.search {
|
||||
margin-right: 6px;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
@media screen and (min-width:1100px){
|
||||
.search {
|
||||
display: inline-block;
|
||||
margin-right: 6px;
|
||||
width: 162px;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width:1100px){
|
||||
.search {
|
||||
display: inline-block;
|
||||
margin-right: 6px;
|
||||
width: 80%;
|
||||
margin: 0px auto;
|
||||
display: block;
|
||||
}
|
||||
button{
|
||||
width: 80%;
|
||||
margin: 0px auto;
|
||||
display: block;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.group-list {
|
||||
max-height: 650px;
|
||||
|
@ -1,5 +1,11 @@
|
||||
module.exports = {
|
||||
import path from 'path'
|
||||
/**
|
||||
* config.js是用来第一次安装初始化网站配置,如果不用默认的runtime_path,可以直接修改runtime_path路径
|
||||
*/
|
||||
let runtime_path = path.join(path.resolve(__dirname, '../'), 'runtime')
|
||||
let config = {
|
||||
"port": 80,
|
||||
"runtime_path": runtime_path,
|
||||
"webhost": "yapi.local.qunar.com",
|
||||
"adminAccount": "admin@admin.com",
|
||||
"db": {
|
||||
@ -16,4 +22,8 @@ module.exports = {
|
||||
"pass": "**********"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = config
|
||||
|
||||
|
||||
|
@ -2,8 +2,10 @@ import path from 'path';
|
||||
import fs from 'fs-extra';
|
||||
import config from '../config.js';
|
||||
|
||||
fs.ensureDirSync( path.join(path.resolve(__dirname, '../../'), 'runtime') );
|
||||
let configPath = path.join(path.resolve(__dirname, '../../'), 'runtime', 'config.json')
|
||||
let runtimePath = config.runtime_path;
|
||||
fs.ensureDirSync( runtimePath );
|
||||
fs.ensureDirSync( path.join(runtimePath, 'log'));
|
||||
let configPath = path.join(runtimePath, 'config.json')
|
||||
|
||||
fs.writeFileSync(configPath,
|
||||
JSON.stringify(config, null, '\t'),
|
||||
|
@ -8,7 +8,7 @@ let mail;
|
||||
|
||||
const WEBROOT = path.resolve(__dirname, '..'); //路径
|
||||
const WEBROOT_SERVER = __dirname;
|
||||
const WEBROOT_RUNTIME = path.join(WEBROOT, 'runtime');
|
||||
const WEBROOT_RUNTIME = config.runtime_path;
|
||||
const WEBROOT_LOG = path.join(WEBROOT_RUNTIME, 'log');
|
||||
const WEBCONFIG = config;
|
||||
|
||||
|
@ -1,7 +1,18 @@
|
||||
"use strict";
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
var _path = require('path');
|
||||
|
||||
var _path2 = _interopRequireDefault(_path);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/**
|
||||
* config.js是用来第一次安装初始化网站配置,如果不用默认的runtime_path,可以直接修改runtime_path路径
|
||||
*/
|
||||
var runtime_path = _path2.default.join(_path2.default.resolve(__dirname, '../'), 'runtime');
|
||||
var config = {
|
||||
"port": 80,
|
||||
"runtime_path": runtime_path,
|
||||
"webhost": "yapi.local.qunar.com",
|
||||
"adminAccount": "admin@admin.com",
|
||||
"db": {
|
||||
@ -18,4 +29,6 @@ module.exports = {
|
||||
"pass": "**********"
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = config;
|
@ -18,7 +18,9 @@ var _config2 = _interopRequireDefault(_config);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
_fsExtra2.default.ensureDirSync(_path2.default.join(_path2.default.resolve(__dirname, '../../'), 'runtime'));
|
||||
var configPath = _path2.default.join(_path2.default.resolve(__dirname, '../../'), 'runtime', 'config.json');
|
||||
var runtimePath = _config2.default.runtime_path;
|
||||
_fsExtra2.default.ensureDirSync(runtimePath);
|
||||
_fsExtra2.default.ensureDirSync(_path2.default.join(runtimePath, 'log'));
|
||||
var configPath = _path2.default.join(runtimePath, 'config.json');
|
||||
|
||||
_fsExtra2.default.writeFileSync(configPath, (0, _stringify2.default)(_config2.default, null, '\t'), { encoding: 'utf8' });
|
@ -27,7 +27,7 @@ var mail = void 0;
|
||||
|
||||
var WEBROOT = _path2.default.resolve(__dirname, '..'); //路径
|
||||
var WEBROOT_SERVER = __dirname;
|
||||
var WEBROOT_RUNTIME = _path2.default.join(WEBROOT, 'runtime');
|
||||
var WEBROOT_RUNTIME = _config2.default.runtime_path;
|
||||
var WEBROOT_LOG = _path2.default.join(WEBROOT_RUNTIME, 'log');
|
||||
var WEBCONFIG = _config2.default;
|
||||
|
||||
|
39
service.sh
Normal file
39
service.sh
Normal file
@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
prog="/var/soft/node-v6.11.1-linux-x64/bin/pm2"
|
||||
app="/home/q/www/yapi.beta.corp.qunar.com/webapp/server_dist/app.js"
|
||||
|
||||
|
||||
|
||||
start() {
|
||||
echo "Starting Server..."
|
||||
eval "$prog start $app --name=yapi"
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo "Stopping Server..."
|
||||
eval "$prog stop yapi"
|
||||
}
|
||||
|
||||
restart() {
|
||||
echo "Restart Server..."
|
||||
eval "$prog restart yapi"
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start && exit 0
|
||||
;;
|
||||
stop)
|
||||
stop || exit 0
|
||||
;;
|
||||
restart)
|
||||
restart || exit 0
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|restart}"
|
||||
exit 2
|
||||
esac
|
Loading…
Reference in New Issue
Block a user