Commit a075be7e authored by wangqinghua's avatar wangqinghua

business

parent b4d7a00b
...@@ -48,9 +48,11 @@ ...@@ -48,9 +48,11 @@
<td [nzIndentSize]="item.level*20" [nzShowExpand]="!!item.children" [(nzExpand)]="item.expand" (nzExpandChange)="getChildren(item)"> <td [nzIndentSize]="item.level*20" [nzShowExpand]="!!item.children" [(nzExpand)]="item.expand" (nzExpandChange)="getChildren(item)">
<span (click)="showEditModal(item)" class="main-color cursor">{{item.name}}</span> <span (click)="showEditModal(item)" class="main-color cursor">{{item.name}}</span>
</td> </td>
<td class="round-tag tag-form"> <td class="round-tag tag-form" (mouseenter)="getTime(item)">
<ng-container *ngIf="item.status == 0"> <ng-container *ngIf="item.status == 0">
<nz-tag class="tag-green" [nzColor]="color.green"></nz-tag> <nz-tooltip [nzTitle]="item.info">
<nz-tag class="tag-green" [nzColor]="color.green"></nz-tag>
</nz-tooltip>
</ng-container> </ng-container>
<ng-container *ngIf="item.status == 2 || item.status == 3"> <ng-container *ngIf="item.status == 2 || item.status == 3">
<nz-tag class="tag-yellow" [nzColor]="color.yellow"></nz-tag> <nz-tag class="tag-yellow" [nzColor]="color.yellow"></nz-tag>
......
...@@ -148,6 +148,22 @@ export class BConfigComponent implements OnInit { ...@@ -148,6 +148,22 @@ export class BConfigComponent implements OnInit {
} }
//告警时间
getTime(item){
console.log(item);
this.busineSer.selectAlarmsClock(item.serviceid).subscribe(
(res)=>{
if(res.errCode == 10000){
let info = "告警时间:"+res.data.last.time + "<br>" +"上次告警时间:"+res.data.now.time;
item.info = info;
console.log(this.dataSet);
}else{
this.message.error(res.errMsg);
}
}
)
}
//添加业务 //添加业务
showAddModal() { showAddModal() {
this.smartBusiness.showModal('添加业务'); this.smartBusiness.showModal('添加业务');
......
<p> <div nz-row class="breadcrumbs">
b-overview works! <div nz-col nzSpan="12">
</p> <nz-breadcrumb class="padding-8-0">
<nz-breadcrumb-item>
首页
</nz-breadcrumb-item>
<nz-breadcrumb-item>
业务监管
</nz-breadcrumb-item>
<nz-breadcrumb-item>
业务概览
</nz-breadcrumb-item>
</nz-breadcrumb>
</div>
<div nz-col nzSpan="12" class="text-right">
<button (click)="ngOnInit()" nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
<smart-full-screen></smart-full-screen>
</div>
</div>
<div nz-row class="search-form tag-form">
<div nz-col nzSpan="12">
<span>业务概览:
<span style="margin-right: 8px" (click)="search('0')"> <nz-tag class="tag-green" [nzColor]="color.green"></nz-tag>
<i *ngIf="!green && green !=0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
正常
</span>
<span (click)="search('2')" style="margin-right: 8px"> <nz-tag class="tag-yellow" [nzColor]="color.yellow"></nz-tag>
<i *ngIf="!yellow && yellow != 0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
告警
</span>
<span (click)="search('3')" style="margin-right: 8px"> <nz-tag class="tag-red" [nzColor]="color.red"></nz-tag>
<i *ngIf="!red && red != 0" class="anticon anticon-spin anticon-loading" style="font-size: 15px;"></i>
严重
</span>
</span>
</div>
</div>
<div nz-row>
<ng-container *ngFor="let item of list;let i = index;">
<div nz-col nzSpan="12" class="follow">
<span (click)="cancel(i,item)" class="cursor calcle-follow"><i
class="anticon anticon-close-circle"></i></span>
<div class="follow-container">
<div class="follow-title">
<div>
<p>{{item.name}} <span>类型:{{item.extendName}}</span> <span style="margin-left: 10px">IP:{{item.host}}</span>
</p>
<p>所在分组:<span style="margin-right: 5px;" *ngFor="let groups of item.groupName">{{groups}}</span></p>
</div>
</div>
<div nz-row>
<div nz-col nzSpan="12" class="height-150 releative">
<div class="container-top">
<p>监测点</p>
<p class="round-tag tag-form">
<nz-tag class="tag-red" [nzColor]="color.red"></nz-tag>
<span style="margin-right: 10px">{{item.item.high}}</span>
<nz-tag class="tag-yellow" [nzColor]="color.yellow"></nz-tag>
<span style="margin-right: 10px"> {{item.item.warning}}</span>
</p>
</div>
<div class="container-bottom">
<p>PING值:{{item.lose}}</p>
</div>
</div>
<div nz-col nzSpan="12" class="height-150" echarts [options]="item.option"></div>
<div class="chart-font">
<p>
<nz-tag nzColor="#f09363"></nz-tag>
CPU使用率 {{item.cpu}}%
</p>
<p>
<nz-tag nzColor="#80ba78"></nz-tag>
内存使用率 {{(item.memory).toFixed(2)}}%
</p>
<!--<p>-->
<!--<nz-tag nzColor="#73b6e4"></nz-tag>-->
<!--带宽使用率 {{item.lose}}%-->
<!--</p>-->
</div>
</div>
</div>
</div>
</ng-container>
</div>
<!--业务-->
<smart-business #smartBusiness></smart-business>
\ No newline at end of file
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import {BusinessService} from '../business.service';
import {NzMessageService} from 'ng-zorro-antd';
import {color} from '../../app.constants';
@Component({ @Component({
selector: 'smart-b-overview', selector: 'smart-b-overview',
...@@ -7,9 +10,24 @@ import { Component, OnInit } from '@angular/core'; ...@@ -7,9 +10,24 @@ import { Component, OnInit } from '@angular/core';
}) })
export class BOverviewComponent implements OnInit { export class BOverviewComponent implements OnInit {
constructor() { } color = color;
list;
constructor(private busineSer:BusinessService,private message:NzMessageService) { }
ngOnInit() { ngOnInit() {
this.getList();
}
getList(){
this.busineSer.itserviceOverview().subscribe(
(res)=>{
if(res.errCode == 10000){
this.list = res.data;
}else{
this.message.error(res.errMsg);
}
}
)
} }
} }
...@@ -39,4 +39,9 @@ export class BusinessService { ...@@ -39,4 +39,9 @@ export class BusinessService {
selectAlarmsClock(params): Observable<any> { selectAlarmsClock(params): Observable<any> {
return this.http.get(SERVER_API_URL + '/itservice/selectAlarmsClock/'+params); return this.http.get(SERVER_API_URL + '/itservice/selectAlarmsClock/'+params);
} }
//查询业务概览统计
itserviceOverview(): Observable<any> {
return this.http.get(SERVER_API_URL + '/itserviceOverview/count');
}
} }
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="7" nzRequired nzFor="parentid">上层服务</nz-form-label> <nz-form-label [nzSpan]="7" nzRequired nzFor="parentid">上层服务</nz-form-label>
<nz-form-control [nzSpan]="12"> <nz-form-control [nzSpan]="12">
<nz-select id="parentid" formControlName="parentid" nzPlaceHolder="上层服务"> <nz-select id="parentid" [nzShowSearch]="true" formControlName="parentid" nzPlaceHolder="上层服务">
<nz-option nzValue="1" nzLabel="问题,至少有一个问题"></nz-option> <nz-option nzValue="1" nzLabel="问题,至少有一个问题"></nz-option>
<nz-option nzValue="2" nzLabel="问题,都有问题"></nz-option> <nz-option nzValue="2" nzLabel="问题,都有问题"></nz-option>
<nz-option nzValue="0" nzLabel="不计算"></nz-option> <nz-option nzValue="0" nzLabel="不计算"></nz-option>
......
...@@ -45,7 +45,7 @@ export class BusinessComponent implements OnInit { ...@@ -45,7 +45,7 @@ export class BusinessComponent implements OnInit {
this.checked = false; this.checked = false;
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
name: ['', [Validators.required]], name: ['', [Validators.required]],
algorithm: [''], algorithm: [null],
showsla: ['99.9000'], showsla: ['99.9000'],
sortorder: ['1',[Validators.maxLength(3)]], sortorder: ['1',[Validators.maxLength(3)]],
parentid: ['1'], parentid: ['1'],
......
...@@ -75,7 +75,6 @@ ...@@ -75,7 +75,6 @@
<th>名称</th> <th>名称</th>
<th>状态</th> <th>状态</th>
<th>关联资产</th> <th>关联资产</th>
<!--<th nzWidth="20%">主机启用状态</th>-->
<th>可用性</th> <th>可用性</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
......
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