Commit bd170e8c authored by wangqinghua's avatar wangqinghua

log

parent 87e0dd17
...@@ -87,7 +87,7 @@ export class BasiCheckComponent implements OnInit { ...@@ -87,7 +87,7 @@ export class BasiCheckComponent implements OnInit {
type: null, type: null,
data_type: null, data_type: null,
units: null, units: null,
history: null, history: '100',
trends: null, trends: null,
valuemapid: null, valuemapid: null,
delay: null, delay: null,
...@@ -157,7 +157,7 @@ export class BasiCheckComponent implements OnInit { ...@@ -157,7 +157,7 @@ export class BasiCheckComponent implements OnInit {
this.overAllSer.create(data).subscribe( this.overAllSer.create(data).subscribe(
(res) => { (res) => {
if (res == 10000) { if (res.errCode == 10000) {
this.isCheck = false; this.isCheck = false;
} }
this.message.info(res.errMsg); this.message.info(res.errMsg);
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<div nz-col [nzSpan]="8"> <div nz-col [nzSpan]="8">
类型 类型
<nz-select name="select-error" [(ngModel)]="keyType" (ngModelChange)="findList()"> <nz-select name="select-error" [(ngModel)]="keyType" (ngModelChange)="findList()">
<nz-option nzValue="1" nzLabel="zabbix客户端"></nz-option> <nz-option nzValue="1" nzLabel="Agent客户端"></nz-option>
<nz-option nzValue="2" nzLabel="zabbix客户端(主动)"></nz-option> <nz-option nzValue="2" nzLabel="Agent客户端(主动)"></nz-option>
<nz-option nzValue="3" nzLabel="数据库监控"></nz-option> <nz-option nzValue="3" nzLabel="数据库监控"></nz-option>
<nz-option nzValue="4" nzLabel="数据库监控 JMX_agent代理程序"></nz-option> <nz-option nzValue="4" nzLabel="数据库监控 JMX_agent代理程序"></nz-option>
<nz-option nzValue="5" nzLabel="简单检查"></nz-option> <nz-option nzValue="5" nzLabel="简单检查"></nz-option>
......
...@@ -28,11 +28,11 @@ ...@@ -28,11 +28,11 @@
<button nz-button nzType="default">删除</button> <button nz-button nzType="default">删除</button>
</div> </div>
<div class="releative"> <div class="releative">
<div class="checkTags"> <div class="checkTags tag-form">
<span> <nz-tag [nzColor]="'#64ad58'"></nz-tag>{{checkStatus.enable}}</span> <span> <nz-tag [nzColor]="'#64ad58'"></nz-tag>{{checkStatus.normal}}</span>
<span> <nz-tag [nzColor]="'#ed9e2e'"></nz-tag>{{checkStatus.warning}}</span> <span> <nz-tag [nzColor]="'#ed9e2e'"></nz-tag>{{checkStatus.warning}}</span>
<span> <nz-tag [nzColor]="'#dd4127'"></nz-tag>{{checkStatus.error}}</span> <span> <nz-tag [nzColor]="'#dd4127'"></nz-tag>{{checkStatus.high}}</span>
<span> <nz-tag [nzColor]="'#aaaaaa'"></nz-tag>{{checkStatus.disable}}</span> <span> <nz-tag [nzColor]="'#aaaaaa'"></nz-tag>{{checkStatus.disabled}}</span>
</div> </div>
<nz-tabset class="tabs-smart "> <nz-tabset class="tabs-smart ">
...@@ -46,14 +46,14 @@ ...@@ -46,14 +46,14 @@
[nzDisabled]="panel1.disabled"> [nzDisabled]="panel1.disabled">
<div nz-row> <div nz-row>
<div class="releative" nz-col nzSpan="12"> <div class="releative" nz-col nzSpan="12">
<div echarts [options]="chartOption1" style="height: 220px;width: 300px"></div> <div echarts [options]="chartOption1" style="height: 220px;width: 100%"></div>
<div class="posiabsolutStr"> <div class="posiabsolutStr">
<p>{{responseTimeStr}}</p> <p>{{responseTimeStr}}</p>
<p>ms</p> <p>ms</p>
</div> </div>
</div> </div>
<div class="releative" nz-col nzSpan="12"> <div class="releative" nz-col nzSpan="12">
<div echarts [options]="chartOption2" style="height: 220px;"></div> <div echarts [options]="chartOption2" style="height: 220px;width: 100%;"></div>
<div class="posiabsolutStr"> <div class="posiabsolutStr">
<p>{{losedStr}}</p> <p>{{losedStr}}</p>
<p>%</p> <p>%</p>
...@@ -69,14 +69,14 @@ ...@@ -69,14 +69,14 @@
[nzDisabled]="panel2.disabled"> [nzDisabled]="panel2.disabled">
<div nz-row> <div nz-row>
<div class="releative" nz-col nzSpan="12"> <div class="releative" nz-col nzSpan="12">
<div echarts [options]="chartOption3" style="height: 220px;"></div> <div echarts [options]="chartOption3" style="height: 220px;width: 100%;"></div>
<div class="posiabsolutStr"> <div class="posiabsolutStr">
<p>{{cpuUsedStr}}</p> <p>{{cpuUsedStr}}</p>
<p>%</p> <p>%</p>
</div> </div>
</div> </div>
<div class="releative" nz-col nzSpan="12"> <div class="releative" nz-col nzSpan="12">
<div echarts [options]="chartOption4" style="height: 220px;"></div> <div echarts [options]="chartOption4" style="height: 220px;width: 100%"></div>
<div class="posiabsolutStr"> <div class="posiabsolutStr">
<p>{{usedStr}}</p> <p>{{usedStr}}</p>
<p>%</p> <p>%</p>
...@@ -158,6 +158,7 @@ ...@@ -158,6 +158,7 @@
<span (click)="showImageModal(data)">图表</span> <span (click)="showImageModal(data)">图表</span>
</td> </td>
<td class="handle cursor"> <td class="handle cursor">
<span (click)="deleteCheckItem(data)">编辑</span>
<span (click)="deleteCheckItem(data)">删除</span> <span (click)="deleteCheckItem(data)">删除</span>
<span *ngIf="data.itemState == 0" (click)="updateItem(data.itemid,1)">停止</span> <span *ngIf="data.itemState == 0" (click)="updateItem(data.itemid,1)">停止</span>
<span *ngIf="data.itemState == 1" (click)="updateItem(data.itemid,0)">启用</span> <span *ngIf="data.itemState == 1" (click)="updateItem(data.itemid,0)">启用</span>
...@@ -183,5 +184,10 @@ ...@@ -183,5 +184,10 @@
<smart-basi-check #smartCheck></smart-basi-check> <smart-basi-check #smartCheck></smart-basi-check>
<nz-modal [nzFooter]="null" nzWidth="1080" [(nzVisible)]="isGrapha" nzTitle="" (nzOnCancel)="handleImageCancel()"> <nz-modal [nzFooter]="null" nzWidth="1080" [(nzVisible)]="isGrapha" nzTitle="" (nzOnCancel)="handleImageCancel()">
<div echarts [options]="chartOptionGrapha" style="height: 520px;width: 100%"></div> <div class="releative">
<div class="time-select">
<nz-date-picker [(ngModel)]="imageSelectDate" (ngModelChange)="getGraphDate()" [nzSize]="size"></nz-date-picker>
</div>
<div echarts [options]="chartOptionGrapha" style="height: 520px;width: 100%"></div>
</div>
</nz-modal> </nz-modal>
...@@ -7,6 +7,7 @@ import {BasiCheckComponent} from '../../../modal/basi-check/basi-check.component ...@@ -7,6 +7,7 @@ import {BasiCheckComponent} from '../../../modal/basi-check/basi-check.component
import {NzModalService} from 'ng-zorro-antd'; import {NzModalService} from 'ng-zorro-antd';
import {pageSize} from '../../../app.constants'; import {pageSize} from '../../../app.constants';
import {WarnListComponent} from '../../../modal/warn-list/warn-list.component'; import {WarnListComponent} from '../../../modal/warn-list/warn-list.component';
import {DatePipe} from '@angular/common';
@Component({ @Component({
selector: 'jhi-basic-detail', selector: 'jhi-basic-detail',
...@@ -18,6 +19,12 @@ import {WarnListComponent} from '../../../modal/warn-list/warn-list.component'; ...@@ -18,6 +19,12 @@ import {WarnListComponent} from '../../../modal/warn-list/warn-list.component';
top: 12px; top: 12px;
left: 233px; left: 233px;
} }
.time-select{
position: absolute;
top: 55px;
right: 15px;
z-index: 999;
}
:host ::ng-deep .tabs-smart .ant-tabs-nav-scroll div.ant-tabs-tab:nth-child(3){ :host ::ng-deep .tabs-smart .ant-tabs-nav-scroll div.ant-tabs-tab:nth-child(3){
margin-right: 150px; margin-right: 150px;
} }
...@@ -30,6 +37,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -30,6 +37,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
@ViewChild('warnList') warnList: WarnListComponent; @ViewChild('warnList') warnList: WarnListComponent;
loading = false; loading = false;
hostId: string; hostId: string;
size = 'default';
hostType: string; hostType: string;
chartOption1; chartOption1;
responseTimeStr; responseTimeStr;
...@@ -56,11 +64,10 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -56,11 +64,10 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
checkList: any[]; checkList: any[];
isCheck = false; isCheck = false;
checkStatus = { checkStatus = {
disable: '0',
enable: '0',
error: '0',
warning: '0', warning: '0',
hostid: '0' normal: '0',
disabled: '0',
high: '0'
}; };
isKey = false; isKey = false;
...@@ -69,7 +76,9 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -69,7 +76,9 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
//图表 //图表
isGrapha = false; isGrapha = false;
selectGraphadata;
chartOptionGrapha; chartOptionGrapha;
imageSelectDate = new Date();
pageSize = pageSize; pageSize = pageSize;
...@@ -78,6 +87,10 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -78,6 +87,10 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
totalNum; //总数据长度 totalNum; //总数据长度
applicationId; //分类ID applicationId; //分类ID
//进出口流量-分页
pageNum = 1;
totalNumInOut;
//分页--告警 //分页--告警
warn_totalNum; warn_totalNum;
warn_pageNum = 1; warn_pageNum = 1;
...@@ -86,7 +99,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -86,7 +99,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
constructor(private routerInfo: ActivatedRoute, private message: NzMessageService, constructor(private routerInfo: ActivatedRoute, private message: NzMessageService,
private overAllSer: OverAllService, private renderer: Renderer, private overAllSer: OverAllService, private renderer: Renderer,
private fb: FormBuilder, private modalService: NzModalService) { private fb: FormBuilder, private modalService: NzModalService,private datePipe:DatePipe) {
} }
ngOnInit() { ngOnInit() {
...@@ -139,7 +152,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -139,7 +152,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
title: { title: {
text: '平均响应时间', text: '平均响应时间',
top: '5%', top: '5%',
left: '38%', left: '35%',
textStyle: { textStyle: {
color: '#999', color: '#999',
fontSize: 12, fontSize: 12,
...@@ -460,7 +473,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -460,7 +473,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
}, },
}, },
data: res.data.disks.map((item) => { data: res.data.disks.map((item) => {
const pre = (item.used / item.total) * 100; //已使用百分比 const pre = ( (item.used / item.total) * 100 ).toFixed(2); //已使用百分比
return pre; return pre;
}) })
}, },
...@@ -485,9 +498,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -485,9 +498,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
}, },
}, },
data: res.data.disks.map((item) => { data: res.data.disks.map((item) => {
const pre = (item.total - item.used) / (item.total) * 100; //剩余百分比 const pre = ( (item.total - item.used) / (item.total) * 100 ).toFixed(2); //剩余百分比
// const use = (item.total - item.used)/(1024*1024*1024); //剩余空间
// const surplus = use.toFixed(2);
return pre; return pre;
}) })
}, },
...@@ -555,12 +566,21 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -555,12 +566,21 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
return (total / 1024 / 1024 / 1024).toFixed(2); return (total / 1024 / 1024 / 1024).toFixed(2);
} }
//进出口流量 //进出口流量-SNMP
inOutInfo() { inOutInfo() {
this.overAllSer.inOutInfosnmp(this.hostId).subscribe( const data = {
obj:{
hostid:Number(this.hostId)
},
pageNum:this.pageNum,
pageCount:this.pageSize
}
this.overAllSer.inOutInfoSnmp(data).subscribe(
(res) => { (res) => {
if (res.errCode == 10000) { if (res.errCode == 10000) {
this.dataSet = res.data.inOutInfo; this.dataSet = res.data.inOutInfo;
}else{
this.message.info(res.errMsg);
} }
} }
); );
...@@ -641,14 +661,17 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -641,14 +661,17 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
} }
//删除监测点 //删除监测点
deleteCheckItem(data) { deleteCheckItem(item) {
this.modalService.confirm({ this.modalService.confirm({
nzTitle: '删除', nzTitle: '删除',
nzContent: '<b style="color: red;">确认删除该监测点吗?</b>', nzContent: '<b style="color: red;">确认删除该监测点吗?</b>',
nzOkText: '确定', nzOkText: '确定',
nzOkType: 'danger', nzOkType: 'danger',
nzOnOk: () => { nzOnOk: () => {
this.overAllSer.deleteItem(data.hostid).subscribe( const data = {
params:[item.itemid]
};
this.overAllSer.deleteItem(data).subscribe(
(res) => { (res) => {
if (res.errCode == 10000) { if (res.errCode == 10000) {
this.message.info('删除成功'); this.message.info('删除成功');
...@@ -667,17 +690,23 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -667,17 +690,23 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
//图表 //图表
showImageModal(data) { showImageModal(data) {
this.isGrapha = true; this.isGrapha = true;
const data1 = { this.selectGraphadata = data;
date: '2018-10-20', this.getGraphDate();
itemid: data.itemid }
//获取图表数据
getGraphDate(){
const data = {
date: this.datePipe.transform(this.imageSelectDate,'yyyy-MM-dd'),
itemid: this.selectGraphadata.itemid
}; };
this.overAllSer.findGraphData(data1).subscribe( this.overAllSer.findGraphData(data).subscribe(
(res) => { (res) => {
if (res.errCode == 10000 && res.data.length > 0) { if (res.errCode == 10000 && res.data.length > 0) {
const result = res.data; const result = res.data;
this.chartOptionGrapha = { this.chartOptionGrapha = {
title: { title: {
text: data.itemName text: this.selectGraphadata.name
}, },
tooltip: { tooltip: {
trigger: 'axis' trigger: 'axis'
......
...@@ -74,9 +74,9 @@ export class OverAllService { ...@@ -74,9 +74,9 @@ export class OverAllService {
return this.http.get(SERVER_API_URL + '/host/disks/'+ data.hostId+ "/"+ data.hostType); return this.http.get(SERVER_API_URL + '/host/disks/'+ data.hostId+ "/"+ data.hostType);
} }
//进出口流量 --交换机 //进出口流量 --SNMP
inOutInfosnmp(data): Observable<any>{ inOutInfoSnmp(data): Observable<any>{
return this.http.get(SERVER_API_URL + '/host/inOutInfo/'+ data); return this.http.post(SERVER_API_URL + '/host/inOutInfo', data);
} }
//进出口流量 -- //进出口流量 --
...@@ -165,8 +165,8 @@ export class OverAllService { ...@@ -165,8 +165,8 @@ export class OverAllService {
} }
//监测点状态统计 //监测点状态统计
findItemCount(data): Observable<any>{ findItemCount(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/item/findItemCount/' +data); return this.http.get(SERVER_API_URL + '/item/findItemStatistics/' +params);
} }
//监测点图形数据 //监测点图形数据
......
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