Commit fffd7722 authored by wangqinghua's avatar wangqinghua

Merge remote-tracking branch 'origin/master'

parents 67ad5acc 3ce873e1
...@@ -68,7 +68,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -68,7 +68,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
if(this.obj.hostid){ if(this.obj.hostid){
this.findByTime(); this.findByTime();
} }
},5000) },1000*60*4)
} }
...@@ -128,6 +128,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -128,6 +128,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
if (this.hostList) { if (this.hostList) {
this.obj.hostid = this.hostList[0].hostid + ''; this.obj.hostid = this.hostList[0].hostid + '';
this.getEcharts(null); this.getEcharts(null);
this.findByTime();
this.setNowEchart(); this.setNowEchart();
} else { } else {
this.message.warning('当前资源组无资源'); this.message.warning('当前资源组无资源');
...@@ -208,7 +209,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -208,7 +209,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
stack: 'one', stack: 'one',
itemStyle: itemStyle, itemStyle: itemStyle,
data: this.inNowEchartData.map(e => { data: this.inNowEchartData.map(e => {
return e.avg; return e.sumValue;
}) })
}, },
{ {
...@@ -217,7 +218,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -217,7 +218,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
stack: 'one', stack: 'one',
itemStyle: itemStyle, itemStyle: itemStyle,
data: this.outNowEchartData.map(e => { data: this.outNowEchartData.map(e => {
return -e.avg; return -e.sumValue;
}) })
} }
] ]
...@@ -229,16 +230,16 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -229,16 +230,16 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
this.topologySer.findByTime(this.obj.hostid).subscribe( this.topologySer.findByTime(this.obj.hostid).subscribe(
(res) => { (res) => {
if (res.errCode == 10000) { if (res.errCode == 10000) {
const inData = { // const inData = {
clock:this.datePipe.transform(res.data.time,"HH:mm:ss"), // clock:this.datePipe.transform(res.data.time,"HH:mm:ss"),
avg:(res.data.in) // avg:(res.data.in)
}; // };
this.inNowEchartData.push(inData); this.inNowEchartData=res.data.in;
const outData = { // const outData = {
clock:this.datePipe.transform(res.data.time,"HH:mm:ss"), // clock:this.datePipe.transform(res.data.time,"HH:mm:ss"),
avg:(res.data.out) // avg:(res.data.out)
}; // };
this.outNowEchartData.push(outData); this.outNowEchartData=res.data.out;
this.flashEcharts(); this.flashEcharts();
} else { } else {
this.message.warning(res.errMsg); this.message.warning(res.errMsg);
...@@ -329,7 +330,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -329,7 +330,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
stack: 'one', stack: 'one',
itemStyle: itemStyle, itemStyle: itemStyle,
data: this.inNowEchartData.map(e => { data: this.inNowEchartData.map(e => {
return e.avg; return e.sumValue;
}) })
}, },
{ {
...@@ -338,7 +339,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -338,7 +339,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
stack: 'one', stack: 'one',
itemStyle: itemStyle, itemStyle: itemStyle,
data: this.outNowEchartData.map(e => { data: this.outNowEchartData.map(e => {
return -e.avg; return -e.sumValue;
}) })
} }
] ]
......
...@@ -88,13 +88,34 @@ TopologyPanel.prototype.loadTopologyByJson = function (topologyJson, backImg) { ...@@ -88,13 +88,34 @@ TopologyPanel.prototype.loadTopologyByJson = function (topologyJson, backImg) {
var alarmList = editor.utils.getAllNodes(); var alarmList = editor.utils.getAllNodes();
for(var i = 0;i < alarmList.length;i++){ for(var i = 0;i < alarmList.length;i++){
(function (i) { (function (i) {
setInterval(function(){ if (alarmList[i].alarm == '危险'){
if(alarmList[i].alarm == '危险'){ setInterval(function(){
alarmList[i].alarm = ''; if(alarmList[i].alarm == '危险'){
}else if(alarmList[i].alarm == ''){ alarmList[i].alarm = '';
alarmList[i].alarm = '危险' }else if(alarmList[i].alarm == ''){
} alarmList[i].alarm = '危险'
}, 2000); }
}, 2000);
}
if (alarmList[i].alarm == '主机被删除,请及时清理'){
setInterval(function(){
if(alarmList[i].alarm == '主机被删除,请及时清理'){
alarmList[i].alarm = '';
}else if(alarmList[i].alarm == ''){
alarmList[i].alarm = '主机被删除,请及时清理'
}
}, 2000);
}
if (alarmList[i].alarm == '故障'){
setInterval(function(){
if(alarmList[i].alarm == '故障'){
alarmList[i].alarm = '';
}else if(alarmList[i].alarm == ''){
alarmList[i].alarm = '故障'
}
}, 1000);
}
})(i); })(i);
} }
......
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