Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
warden
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姚广胤
warden
Commits
266255a2
Commit
266255a2
authored
Mar 22, 2018
by
姚广胤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
启用task
parent
608f0ac6
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
41 additions
and
30 deletions
+41
-30
app.js
server/app.js
+2
-2
config-dev.js
server/config/config-dev.js
+1
-1
package.json
server/package.json
+3
-7
historyService.js
server/services/historyService.js
+10
-0
index.js
server/task/index.js
+2
-2
index.html
server/views/index.html
+1
-1
private.html
server/views/private.html
+1
-1
webpack.base.js
web/build/webpack.base.js
+1
-1
package.json
web/package.json
+3
-7
NavHeader.vue
web/src/containers/private/components/NavHeader.vue
+1
-2
DirTree.vue
web/src/containers/private/components/trend/DirTree.vue
+16
-6
No files found.
server/app.js
View file @
266255a2
...
@@ -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
(
'执行任务结束'
);
...
...
server/config/config-dev.js
View file @
266255a2
...
@@ -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
:
{
...
...
server/package.json
View file @
266255a2
{
{
"name"
:
"
ali-oss-service
"
,
"name"
:
"
warden
"
,
"description"
:
"a
iyun oss web tool
"
,
"description"
:
"a
n 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"
,
...
...
server/services/historyService.js
View file @
266255a2
...
@@ -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
=
{
...
...
server/task/index.js
View file @
266255a2
...
@@ -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
,
10
0
);
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
)
=>
{
...
...
server/views/index.html
View file @
266255a2
...
@@ -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>
server/views/private.html
View file @
266255a2
...
@@ -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>
web/build/webpack.base.js
View file @
266255a2
...
@@ -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
:
{
...
...
web/package.json
View file @
266255a2
{
{
"name"
:
"w
eb
"
,
"name"
:
"w
arden
"
,
"description"
:
"a
iyun oss web tool
"
,
"description"
:
"a
n 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"
:
{
...
...
web/src/containers/private/components/NavHeader.vue
View file @
266255a2
<
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>
...
...
web/src/containers/private/components/trend/DirTree.vue
View file @
266255a2
<
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
(
da
ys
,
seriesDa
ta
)
{
this
.
chart
=
echarts
.
init
(
this
.
$refs
.
myEchart
);
this
.
chart
=
echarts
.
init
(
this
.
$refs
.
myEchart
);
const
xData
=
da
ta
.
map
(
item
=>
item
[
0
])
;
const
xData
=
da
ys
;
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
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment