fixes #3
This commit is contained in:
parent
e4b18294a4
commit
ba15ced71d
|
|
@ -183,6 +183,10 @@ Tail Logs
|
|||
|
||||

|
||||
|
||||
## Test
|
||||
```bash
|
||||
$ npm test
|
||||
```
|
||||
|
||||
## License
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
|
|
|||
|
|
@ -493,12 +493,12 @@ END OF REPO && VER
|
|||
******************/
|
||||
.graph svg {
|
||||
font-size: 10px;
|
||||
margin: 5px 20px;
|
||||
margin: 20px auto 0 20px;
|
||||
}
|
||||
|
||||
.graph .line {
|
||||
fill: none;
|
||||
stroke-width: 1px;
|
||||
stroke-width: 2px;
|
||||
}
|
||||
|
||||
.graph .axis path,
|
||||
|
|
@ -520,14 +520,16 @@ END OF REPO && VER
|
|||
|
||||
.graph ul {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
right: 10px;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.graph ul li {
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
list-style-type: square;
|
||||
font-size: 10px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.graph ul li span {
|
||||
|
|
|
|||
|
|
@ -839,7 +839,7 @@ function appendData(proc){
|
|||
return;
|
||||
}
|
||||
var loadEl = $('#monitor>.load');
|
||||
if(lineChart.data.length == 0){
|
||||
if (lineChart.data.length == 0) {
|
||||
var now = proc.time,
|
||||
len = lineChart.settings.queueLength;
|
||||
|
||||
|
|
@ -862,9 +862,7 @@ function destroyMonitor(){
|
|||
return;
|
||||
}
|
||||
sockets.proc.disconnect();
|
||||
|
||||
lineChart.data = [];
|
||||
lineChart.eles = {};
|
||||
lineChart.destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1001,8 +999,19 @@ var lineChart = {
|
|||
},
|
||||
data : [],
|
||||
eles : {},
|
||||
next : function(){
|
||||
destroy : function(){
|
||||
this.eles.path && this.eles.path.interrupt().transition();
|
||||
this.eles.xAxis && this.eles.xAxis.interrupt().transition();
|
||||
d3.timer.flush();
|
||||
this.data = [];
|
||||
this.eles = {};
|
||||
},
|
||||
next : function(forceQuit){
|
||||
var ng = !this.eles.svg;
|
||||
if (ng && forceQuit) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ng) {
|
||||
this._graph();
|
||||
}
|
||||
|
|
@ -1024,7 +1033,9 @@ var lineChart = {
|
|||
});
|
||||
|
||||
if (ng) {
|
||||
return this.next();
|
||||
return setTimeout(function(ctx){
|
||||
ctx.next(true);
|
||||
}, 10, this);
|
||||
}
|
||||
|
||||
this.eles.path
|
||||
|
|
@ -1033,7 +1044,7 @@ var lineChart = {
|
|||
.ease('linear')
|
||||
.attr('transform', 'translate(' + this.eles.x(this.data[0].time) + ', ' + st.padding + ')')
|
||||
.each('end', function(){
|
||||
lineChart.next();
|
||||
lineChart.next(true);
|
||||
});
|
||||
|
||||
this.eles.xAxis.transition()
|
||||
|
|
|
|||
Loading…
Reference in New Issue