Commit 3ec6fce3 authored by xiaowenjie's avatar xiaowenjie

修改

parent 8a4b8da1
...@@ -274,6 +274,19 @@ export class NeTopologyComponent implements OnInit, DoCheck, AfterViewInit, OnDe ...@@ -274,6 +274,19 @@ export class NeTopologyComponent implements OnInit, DoCheck, AfterViewInit, OnDe
editor.loadTopology('','', 'img/backimg.png'); editor.loadTopology('','', 'img/backimg.png');
} }
interval(arr,str){
arr.forEach(e2=>{
setInterval(function(){
if(e2.alarm == str){
e2.alarm = null;
}else{
e2.alarm = str
}
}, 600);
})
}
//查询单个 //查询单个
getDetail(id) { getDetail(id) {
this.isLoading = true; this.isLoading = true;
...@@ -323,27 +336,42 @@ export class NeTopologyComponent implements OnInit, DoCheck, AfterViewInit, OnDe ...@@ -323,27 +336,42 @@ export class NeTopologyComponent implements OnInit, DoCheck, AfterViewInit, OnDe
hostIds.push(e.hostId); hostIds.push(e.hostId);
} }
}); });
//危险对象
const wlist = [];
//故障对象
const glist = [];
//删除对象
const dlist = [];
if(hostIds.length > 0){ if(hostIds.length > 0){
const res = { const res = {
hostIds : hostIds hostIds : hostIds
}; };
this.topologySer.findElementStatus(res).subscribe( this.topologySer.findElementStatus(res).subscribe(
(res)=>{ (res)=>{
//status -1=未监控, 0=正常, 1=告警, 2=严重, 3=未分类 //status -1=未监控, 0=正常, 1=危险, 2=故障, 3=未分类
const resData = res.data; const resData = res.data;
resData.forEach(e1=>{ resData.forEach(e1=>{
arr.forEach(e2=>{ arr.forEach(e2=>{
if(e1.elementId == e2.hostId){ if(e1.elementId == e2.hostId){
if(e1.status == 0){ console.log("e1.status="+e1.status)
if(e1.status == -2){
e2.alarm = "主机被删除,请及时清理";
e2.fontColor='0,0,0';
e2.alarmAlpha=0.9;
dlist.push(e2)
} }
if(e1.status == 1){ if(e1.status == 1){
e2.alarm = e1.description; e2.alarm = "危险";
e2.fontColor='0,0,0'; e2.fontColor='0,0,0';
e2.alarmColor='255,153,18';
e2.alarmAlpha=0.9; e2.alarmAlpha=0.9;
wlist.push(e2);
} }
if(e1.status == 2){ if(e1.status == 2){
// e2.alarm = "严重"; e2.alarm = "故障";
e2.fontColor='255,97,0';
e2.alarmAlpha=0.9;
glist.push(e2);
} }
} }
}) })
...@@ -351,6 +379,9 @@ export class NeTopologyComponent implements OnInit, DoCheck, AfterViewInit, OnDe ...@@ -351,6 +379,9 @@ export class NeTopologyComponent implements OnInit, DoCheck, AfterViewInit, OnDe
editor.loadTopologyByJson(topologyJson, 'img/backimg.png'); editor.loadTopologyByJson(topologyJson, 'img/backimg.png');
} }
) )
this.interval(wlist,"危险");
this.interval(glist,"故障");
this.interval(dlist,"已删除");
} }
if(list.length > 0){ //有流量监控-->查询流量监控 if(list.length > 0){ //有流量监控-->查询流量监控
......
...@@ -158,7 +158,7 @@ function TopologyEditor() { ...@@ -158,7 +158,7 @@ function TopologyEditor() {
linkFillColor: '123,165,241', linkFillColor: '123,165,241',
linkShadow: false, // 是否显示连线阴影 linkShadow: false, // 是否显示连线阴影
linkShadowColor: 'rgba(0,0,0,0.5)', linkShadowColor: 'rgba(0,0,0,0.5)',
linkFont: '12px Consolas', // 节点字体 linkFont: '25px Consolas', // 节点字体
linkFontColor: 'red', // 连线文字颜色,如"255,255,0" linkFontColor: 'red', // 连线文字颜色,如"255,255,0"
linkArrowsRadius: 0, // 线条箭头半径 linkArrowsRadius: 0, // 线条箭头半径
linkDefaultWidth: 2, // 连线宽度 linkDefaultWidth: 2, // 连线宽度
......
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