Commit 5eb150bc authored by wangqinghua's avatar wangqinghua

网站监测

parent 6ecd7267
...@@ -35,7 +35,7 @@ export class AlarmListComponent implements OnInit { ...@@ -35,7 +35,7 @@ export class AlarmListComponent implements OnInit {
pageCount = pageSize; pageCount = pageSize;
//条件 //条件
timeType; timeType = '1';
obj = { obj = {
priorityName:null, priorityName:null,
groupid:null, groupid:null,
...@@ -50,10 +50,10 @@ export class AlarmListComponent implements OnInit { ...@@ -50,10 +50,10 @@ export class AlarmListComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
const obj = {};
this.getType(); this.getType();
this.getWarnGroup(); this.getWarnGroup();
this.warnList.getList(obj); this.changeType();
this.searchValue();
} }
//获取分组 //获取分组
......
...@@ -21,7 +21,10 @@ ...@@ -21,7 +21,10 @@
<div nz-row class="search-form"> <div nz-row class="search-form">
<div nz-col nzSpan="16"> <div nz-col nzSpan="16">
<span>当前告警数:{{alarmTotal}}</span> <span>当前告警数:
<i *ngIf="!alarmTotal && alarmTotal !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
{{alarmTotal}}
</span>
</div> </div>
</div> </div>
<div class="tag-warn tag-form"> <div class="tag-warn tag-form">
......
...@@ -105,7 +105,8 @@ export class BasicEditComponent implements OnInit { ...@@ -105,7 +105,8 @@ export class BasicEditComponent implements OnInit {
this.validateForm.groups = data.groups; this.validateForm.groups = data.groups;
if(data.parentTemplates){ if(data.parentTemplates){
const tempArr = data.parentTemplates.map(res=>{ let tempArr = [];
tempArr = data.parentTemplates.map(res=>{
return res.templateid; return res.templateid;
}); });
this.validateForm.templates = tempArr; this.validateForm.templates = tempArr;
...@@ -247,7 +248,7 @@ export class BasicEditComponent implements OnInit { ...@@ -247,7 +248,7 @@ export class BasicEditComponent implements OnInit {
getTemplate() { getTemplate() {
this.overAllSer.templates().subscribe( this.overAllSer.templates().subscribe(
(res) => { (res) => {
this.tempList = res.apiResponse.data; this.tempList = res.apiResponse.data.result;
} }
); );
} }
...@@ -372,7 +373,7 @@ export class BasicEditComponent implements OnInit { ...@@ -372,7 +373,7 @@ export class BasicEditComponent implements OnInit {
name: null, name: null,
serialno_a: null serialno_a: null
}, },
templates: [], templates: null,
name: null, name: null,
host: null, host: null,
ipmi_authtype: null, ipmi_authtype: null,
......
...@@ -30,10 +30,22 @@ ...@@ -30,10 +30,22 @@
</div> </div>
<div class="releative"> <div class="releative">
<div class="checkTags tag-form"> <div class="checkTags tag-form">
<span> <nz-tag [nzColor]="color.green"></nz-tag>{{checkStatus.normal}}</span> <span> <nz-tag [nzColor]="color.green"></nz-tag>
<span> <nz-tag [nzColor]="color.yellow"></nz-tag>{{checkStatus.warning}}</span> <i *ngIf="!checkStatus.normal && checkStatus.normal !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
<span> <nz-tag [nzColor]="color.red"></nz-tag>{{checkStatus.high}}</span> {{checkStatus.normal}}
<span> <nz-tag [nzColor]="color.gray"></nz-tag>{{checkStatus.disabled}}</span> </span>
<span> <nz-tag [nzColor]="color.yellow"></nz-tag>
<i *ngIf="!checkStatus.warning && checkStatus.warning !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
{{checkStatus.warning}}
</span>
<span> <nz-tag [nzColor]="color.red"></nz-tag>
<i *ngIf="!checkStatus.high && checkStatus.high !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
{{checkStatus.high}}
</span>
<span> <nz-tag [nzColor]="color.gray"></nz-tag>
<i *ngIf="!checkStatus.disabled && checkStatus.disabled !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
{{checkStatus.disabled}}
</span>
</div> </div>
<nz-tabset class="tabs-smart "> <nz-tabset class="tabs-smart ">
......
...@@ -66,10 +66,10 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -66,10 +66,10 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
checkList: any[]; checkList: any[];
isCheck = false; isCheck = false;
checkStatus = { checkStatus = {
warning: '0', warning: null,
normal: '0', normal: null,
disabled: '0', disabled: null,
high: '0' high: null
}; };
isKey = false; isKey = false;
......
...@@ -31,10 +31,22 @@ ...@@ -31,10 +31,22 @@
<div nz-col nzSpan="12"> <div nz-col nzSpan="12">
<span>监控设备数:{{deviceNo}}</span> <span>监控设备数:{{deviceNo}}</span>
<span>设备状态: <span>设备状态:
<span style="margin-right: 8px"> <nz-tag [nzColor]="color.green"></nz-tag>{{green}} </span> <span style="margin-right: 8px"> <nz-tag [nzColor]="color.green"></nz-tag>
<span style="margin-right: 8px"> <nz-tag [nzColor]="color.yellow"></nz-tag>{{yellow}} </span> <i *ngIf="!green && green !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
<span style="margin-right: 8px"> <nz-tag [nzColor]="color.red"></nz-tag>{{red}} </span> {{green}}
<span> <nz-tag [nzColor]="color.gray"></nz-tag>{{gray}} </span> </span>
<span style="margin-right: 8px"> <nz-tag [nzColor]="color.yellow"></nz-tag>
<i *ngIf="!yellow && yellow != 0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
{{yellow}}
</span>
<span style="margin-right: 8px"> <nz-tag [nzColor]="color.red"></nz-tag>
<i *ngIf="!red && red != 0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
{{red}}
</span>
<span> <nz-tag [nzColor]="color.gray"></nz-tag>
<i *ngIf="!gray && gray!=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
{{gray}}
</span>
</span> </span>
<nz-select style="width: 200px;" nzPlaceHolder="按组分开" [(ngModel)]="selectedValue" <nz-select style="width: 200px;" nzPlaceHolder="按组分开" [(ngModel)]="selectedValue"
(ngModelChange)="select()"> (ngModelChange)="select()">
...@@ -76,7 +88,8 @@ ...@@ -76,7 +88,8 @@
<tr *ngIf="(item.parent&&item.parent.expand)||!(item.parent)"> <tr *ngIf="(item.parent&&item.parent.expand)||!(item.parent)">
<td nzShowCheckbox [(nzChecked)]="item.checked"></td> <td nzShowCheckbox [(nzChecked)]="item.checked"></td>
<td class="cursor" [nzIndentSize]="item.level*20" [nzShowExpand]="!!item.list" <td class="cursor" [nzIndentSize]="item.level*20" [nzShowExpand]="!!item.list"
[(nzExpand)]="item.expand" (nzExpandChange)="collapse(expandDataCache[data.host],item,$event)"> [(nzExpand)]="item.expand"
(nzExpandChange)="collapse(expandDataCache[data.host],item,$event)">
<span *ngIf="!item.level" (click)="getChildrenType(item)">{{item.equipmentType}}</span> <span *ngIf="!item.level" (click)="getChildrenType(item)">{{item.equipmentType}}</span>
<span *ngIf="item.level" (click)="goDetail(item)">{{item.name}}</span> <span *ngIf="item.level" (click)="goDetail(item)">{{item.name}}</span>
</td> </td>
...@@ -121,7 +134,7 @@ ...@@ -121,7 +134,7 @@
<!--父级--> <!--父级-->
<ng-container *ngIf="!item.level"> <ng-container *ngIf="!item.level">
<td></td> <td></td>
<td class="cursor" [nzIndentSize]="item.level*20" nzShowExpand [nzExpand] ='item.expand' <td class="cursor" [nzIndentSize]="item.level*20" nzShowExpand [nzExpand]='item.expand'
(nzExpandChange)="getChildren(item)"> (nzExpandChange)="getChildren(item)">
<span>{{item.name}}</span> <span>{{item.name}}</span>
</td> </td>
...@@ -222,7 +235,8 @@ ...@@ -222,7 +235,8 @@
<ng-container *ngIf="searchStatus"> <ng-container *ngIf="searchStatus">
<ng-container *ngFor="let item of searchData"> <ng-container *ngFor="let item of searchData">
<tr> <tr>
<td nzShowCheckbox [nzIndeterminate]="indeterminate" (nzCheckedChange)="selectChecked($event,item)" [(nzChecked)]="item.checked"></td> <td nzShowCheckbox [nzIndeterminate]="indeterminate" (nzCheckedChange)="selectChecked($event,item)"
[(nzChecked)]="item.checked"></td>
<td class="cursor"> <td class="cursor">
<span (click)="goDetail(item)">{{item.name}}</span> <span (click)="goDetail(item)">{{item.name}}</span>
</td> </td>
...@@ -303,6 +317,7 @@ ...@@ -303,6 +317,7 @@
</tbody> </tbody>
</nz-table> </nz-table>
<i class="anticon anticon-spin anticon-loading"></i>
<!-- 添加资源--> <!-- 添加资源-->
<smart-basic-edit #basicEdit (done)="handleOk($event)"></smart-basic-edit> <smart-basic-edit #basicEdit (done)="handleOk($event)"></smart-basic-edit>
<!--添加监测点--> <!--添加监测点-->
......
...@@ -26,12 +26,24 @@ ...@@ -26,12 +26,24 @@
<div nz-row class="search-form tag-form"> <div nz-row class="search-form tag-form">
<div nz-col nzSpan="12"> <div nz-col nzSpan="12">
<span>网站监测数:{{deviceNo}}</span> <span>网站监测数:{{checkStatus.total}}</span>
<span>监测状态: <span>监测状态:
<span style="margin-right: 8px"> <nz-tag [nzColor]="color.green"></nz-tag>{{checkStatus.green}} </span> <span style="margin-right: 8px"> <nz-tag [nzColor]="color.green"></nz-tag>
<span style="margin-right: 8px"> <nz-tag [nzColor]="color.yellow"></nz-tag>{{checkStatus.yellow}} </span> <i *ngIf="!checkStatus.type.normalNum && checkStatus.type.normalNum !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
<span style="margin-right: 8px"> <nz-tag [nzColor]="color.red"></nz-tag>{{checkStatus.red}} </span> {{checkStatus.type.normalNum}}
<span> <nz-tag [nzColor]="color.gray"></nz-tag>{{checkStatus.gray}} </span> </span>
<span style="margin-right: 8px"> <nz-tag [nzColor]="color.yellow"></nz-tag>
<i *ngIf="!checkStatus.type.warnNum && checkStatus.type.warnNum !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
{{checkStatus.type.warnNum}}
</span>
<span style="margin-right: 8px"> <nz-tag [nzColor]="color.red"></nz-tag>
<i *ngIf="!checkStatus.type.seriousNum && checkStatus.type.seriousNum !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
{{checkStatus.type.seriousNum}}
</span>
<span> <nz-tag [nzColor]="color.gray"></nz-tag>
<i *ngIf="!checkStatus.type.notNum && checkStatus.type.notNum !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
{{checkStatus.type.notNum}}
</span>
</span> </span>
</div> </div>
<div nz-col nzSpan="12" class="text-right"> <div nz-col nzSpan="12" class="text-right">
......
...@@ -32,10 +32,13 @@ export class NetworkCheckComponent implements OnInit { ...@@ -32,10 +32,13 @@ export class NetworkCheckComponent implements OnInit {
totalNum; totalNum;
checkStatus = { checkStatus = {
green: '', type:{
yellow: '', seriousNum:null,
red: '', notNum:null,
gray: '' warnNum:null,
normalNum:null
},
total:null
}; };
batchSelectList = []; batchSelectList = [];
...@@ -80,7 +83,15 @@ export class NetworkCheckComponent implements OnInit { ...@@ -80,7 +83,15 @@ export class NetworkCheckComponent implements OnInit {
//监测状态 //监测状态
getCheckStatus() { getCheckStatus() {
this.overAllSer.countStatus().subscribe(
(res)=>{
if(res.errCode == 10000){
this.checkStatus = res.data;
}else{
this.message.info(res.errMsg);
}
}
)
} }
//选中 //选中
......
...@@ -284,4 +284,9 @@ export class OverAllService { ...@@ -284,4 +284,9 @@ export class OverAllService {
findAlert(data): Observable<any>{ findAlert(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/webscenario/findAlert' ,data); return this.http.post(SERVER_API_URL + '/webscenario/findAlert' ,data);
} }
//统计网站监测告警种类
countStatus(): Observable<any>{
return this.http.get(SERVER_API_URL + '/webscenario/countStatus');
}
} }
\ No newline at end of file
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