Commit 266255a2 authored by 姚广胤's avatar 姚广胤

启用task

parent 608f0ac6
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: ygy * @Author: ygy
* @Date: 2018-03-14 19:40:01 * @Date: 2018-03-14 19:40:01
* @Last Modified by: ygy * @Last Modified by: ygy
* @Last Modified time: 2018-03-16 14:50:17 * @Last Modified time: 2018-03-22 20:38:08
*/ */
const Koa = require('koa'); const Koa = require('koa');
const send = require('koa-send'); const send = require('koa-send');
...@@ -62,7 +62,7 @@ app.use(router()); ...@@ -62,7 +62,7 @@ app.use(router());
const schedule = require('node-schedule'); const schedule = require('node-schedule');
const j = schedule.scheduleJob({ hour: 16 }, function() { const j = schedule.scheduleJob({ hour: 4 }, function() {
console.log('执行任务开始'); console.log('执行任务开始');
task.runTiming(); task.runTiming();
console.log('执行任务结束'); console.log('执行任务结束');
......
...@@ -4,7 +4,7 @@ var config = { ...@@ -4,7 +4,7 @@ var config = {
database: 'fed_pf_test', // 使用哪个数据库 database: 'fed_pf_test', // 使用哪个数据库
username: 'fed', // 用户名 username: 'fed', // 用户名
password: 'tuia123', // 口令 password: 'tuia123', // 口令
host: '172.16.80.91', // 主机名 host: '172.16.80.122', // 主机名
port: 3306 // 端口号,MySQL默认3306 port: 3306 // 端口号,MySQL默认3306
}, },
cookie: { cookie: {
......
{ {
"name": "ali-oss-service", "name": "warden",
"description": "aiyun oss web tool", "description": "an automate performance watcher",
"version": "2.0.0", "version": "1.0.0",
"main": "app.js", "main": "app.js",
"scripts": { "scripts": {
"dev": "export NODE_ENV=development && nodemon --harmony app.js", "dev": "export NODE_ENV=development && nodemon --harmony app.js",
...@@ -18,10 +18,6 @@ ...@@ -18,10 +18,6 @@
{ {
"email": "ygy@duiba.com.cn", "email": "ygy@duiba.com.cn",
"name": "ygy" "name": "ygy"
},
{
"email": "fxt@duiba.com.cn",
"name": "方雄韬"
} }
], ],
"license": "MIT", "license": "MIT",
......
...@@ -2,6 +2,16 @@ const historyDAO = require('../dao/historyDAO'); ...@@ -2,6 +2,16 @@ const historyDAO = require('../dao/historyDAO');
let findAllPagination = async(path = '', pageSize = 20, currentPage = 1) => { let findAllPagination = async(path = '', pageSize = 20, currentPage = 1) => {
let logs = await historyDAO.findAllPagination(path, pageSize, currentPage); let logs = await historyDAO.findAllPagination(path, pageSize, currentPage);
console.log(logs.rows);
const {
rows
} = logs;
rows && rows.forEach(item => {
item.result = JSON.parse(item.result);
});
let data; let data;
if (logs) { if (logs) {
data = { data = {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: ygy * @Author: ygy
* @Date: 2018-03-14 19:39:46 * @Date: 2018-03-14 19:39:46
* @Last Modified by: ygy * @Last Modified by: ygy
* @Last Modified time: 2018-03-16 12:01:32 * @Last Modified time: 2018-03-22 20:34:40
*/ */
const historyService = require('../services/historyService'); const historyService = require('../services/historyService');
...@@ -18,7 +18,7 @@ const runTiming = async () => { ...@@ -18,7 +18,7 @@ const runTiming = async () => {
} }
]; ];
await timing.iterateTimes(urls, 100); await timing.iterateTimes(urls, 10);
const resultToSave = urls[0]['arr']; const resultToSave = urls[0]['arr'];
const total = resultToSave.reduce((item, index) => { const total = resultToSave.reduce((item, index) => {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<body style="background-repeat:no-repeat; background-attachment:fixed;background-size:cover;background-image: url(https://img.xjh.me/random_img.php?type=bg&ctype=nature&return=302);"> <body style="background-repeat:no-repeat; background-attachment:fixed;background-size:cover;background-image: url(https://img.xjh.me/random_img.php?type=bg&ctype=nature&return=302);">
<div id="app"></div> <div id="app"></div>
<script src="http://localhost:8086/dist/public.js"></script> <script src="http://localhost:5001/dist/public.js"></script>
</body> </body>
</html> </html>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<body style="background-repeat:no-repeat; background-attachment:fixed;background-size:cover;background-image: url(//yun.duiba.com.cn/tuia/cdn/background-logo.jpg);"> <body style="background-repeat:no-repeat; background-attachment:fixed;background-size:cover;background-image: url(//yun.duiba.com.cn/tuia/cdn/background-logo.jpg);">
<div id="app"></div> <div id="app"></div>
<script src="http://localhost:8086/dist/private.js"></script> <script src="http://localhost:5001/dist/private.js"></script>
</body> </body>
</html> </html>
...@@ -25,7 +25,7 @@ module.exports = { ...@@ -25,7 +25,7 @@ module.exports = {
entry: entryList, entry: entryList,
output: { output: {
path: path.resolve(__dirname, '../dist'), path: path.resolve(__dirname, '../dist'),
publicPath: process.env.NODE_ENV === 'production' ? 'http://yun.dui88.com/tuia/cdn/' : '/dist' , publicPath: process.env.NODE_ENV === 'production' ? 'http://yun.dui88.com/tuia/cdn/' : '/dist/' ,
filename: '[name].js' filename: '[name].js'
}, },
resolve: { resolve: {
......
{ {
"name": "web", "name": "warden",
"description": "aiyun oss web tool", "description": "an automate performance watcher",
"version": "2.0.0", "version": "1.0.0",
"author": "jsholic <junhe0723@gmail.com>", "author": "jsholic <junhe0723@gmail.com>",
"contributors": [ "contributors": [
{ {
"email": "ygy@duiba.com.cn", "email": "ygy@duiba.com.cn",
"name": "ygy" "name": "ygy"
},
{
"email": "fxt@duiba.com.cn",
"name": "方雄韬"
} }
], ],
"scripts": { "scripts": {
......
<template lang="html"> <template lang="html">
<el-menu :default-active="activeIndex" mode="horizontal" router> <el-menu :default-active="activeIndex" mode="horizontal" router>
<h2 class="nav-title"><img class="logo" src="//yun.tuiapple.com/tuia/cdn/heave-logo-small.png" alt=""></h2> <h2 class="nav-title"><img class="logo" src="//yun.tuiapple.com/tuia/cdn/heave-logo-small.png" alt=""></h2>
<el-menu-item index="home">上传测试</el-menu-item> <el-menu-item index="home">性能数据</el-menu-item>
<el-menu-item index="list">同步生产</el-menu-item>
<li class="tip-pane"> <li class="tip-pane">
<span class="name">{{userName}}</span> <span class="name">{{userName}}</span>
<span class="separator">|</span> <span class="separator">|</span>
......
<template lang="html"> <template lang="html">
<div> <div class="chart-tool">
<el-select v-model="value" placeholder="请选择"> <el-select v-model="value" placeholder="请选择">
<el-option <el-option
v-for="item in options" v-for="item in options"
...@@ -84,17 +84,25 @@ export default { ...@@ -84,17 +84,25 @@ export default {
axios axios
.get('/history/list') .get('/history/list')
.then(response => { .then(response => {
this.initChart(response.data.data); const {
data
} = response.data;
const days = data.map(item => item['day']);
const seriesData = data.map(item => item['result']['all']);
this.initChart(days, seriesData);
}) })
.catch(error => { .catch(error => {
console.log(error); console.log(error);
}); });
}, },
initChart(data) { initChart(days, seriesData) {
this.chart = echarts.init(this.$refs.myEchart); this.chart = echarts.init(this.$refs.myEchart);
const xData = data.map(item => item[0]); const xData = days;
const yData = data.map(item => item[1]); const yData = seriesData;
console.log(xData, yData); console.log(xData, yData);
var option = { var option = {
...@@ -153,5 +161,7 @@ export default { ...@@ -153,5 +161,7 @@ export default {
</script> </script>
<style lang="css"> <style lang="css">
.chart-tool {
margin-top: 30px;
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment