Commit bbdde67c authored by wangqinghua's avatar wangqinghua

update

parent 0bf573b1
......@@ -12,7 +12,7 @@ export class AppComponent {
constructor(private router: Router,private overAll:OverAllService,
private titleSer:Title){
console.log("monitor:v20191119");
console.log("monitor:v201911191512");
//火狐拖动图片会打开新tab
document.body.ondrop = (event)=> {
event.preventDefault();
......
export const VERSION = process.env.VERSION;
export const DEBUG_INFO_ENABLED: boolean = !!process.env.DEBUG_INFO_ENABLED;
export const SERVER_API_URL_COMS = '/coms';
// export const SERVER_API_URL = '/anke';
export const SERVER_API_URL = '/anke';
// export const SERVER_API_URL = '/zhouxi';
export const SERVER_API_URL = '/zabbixBox';
// export const SERVER_API_URL = '/zabbixBox';
export const SERVER_API_URL_MONITOR = '/api';
export const BUILD_TIMESTAMP = process.env.BUILD_TIMESTAMP;
export const pageSize = 10;
......
......@@ -27,7 +27,7 @@
</p>
<p>
<nz-tag class="tag-yellow" [nzColor]="color.yellow"></nz-tag>
<span class="margin-0-10">告警 {{leftOneData.warning}}个,{{leftOneDataPre.warningPer}}% </span>
<span class="margin-0-10">告警 {{leftOneData.waring}}个,{{leftOneDataPre.warningPer}}% </span>
</p>
<p>
<nz-tag class="tag-green" [nzColor]="color.green"></nz-tag>
......@@ -50,7 +50,7 @@
</p>
<p>
<nz-tag class="tag-yellow" [nzColor]="color.yellow"></nz-tag>
<span class="margin-0-10">告警 {{leftTwoData.warning}}个,{{leftTwoDataPre.warningPer}}% </span>
<span class="margin-0-10">告警 {{leftTwoData.waring}}个,{{leftTwoDataPre.warningPer}}% </span>
</p>
<p>
<nz-tag class="tag-green" [nzColor]="color.green"></nz-tag>
......@@ -91,23 +91,29 @@
<tr>
<th nzShowSort>产生时间</th>
<th>级别</th>
<th>资源名称</th>
<th>告警信息</th>
<th>持续时间</th>
<th>名称</th>
<th nzWidth="15%">告警信息</th>
<th>状态</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of nzTable.data">
<tr *ngFor="let data of warnList">
<td>
{{data.clock | date:"yyyy-MM-dd HH:mm:ss"}}
{{data.createTime}}
</td>
<td class="round-tag tag-form">
<nz-tag *ngIf="data.priority == 4 || data.priority == 5" class="tag-red" [nzColor]="color.red"></nz-tag>
<nz-tag *ngIf="data.priority == 2 || data.priority == 3" class="tag-yellow" [nzColor]="color.yellow"></nz-tag>
<nz-tag class="tag-green" *ngIf="data.level == 0 " [nzColor]="'#58ca13'"></nz-tag>
<nz-tag class="tag-red" *ngIf="data.level == 2 " [nzColor]="'#fc0d1b'"></nz-tag>
<nz-tag class="tag-yellow" *ngIf="data.level == 1 " [nzColor]="'#fd9827'"></nz-tag>
</td>
<td class="cursor main-color" (click)="goToDetail(data)">{{data.hostname}}</td>
<td>{{data.name}}</td>
<td>{{data.description}}</td>
<td>{{data.continuedTime}}</td>
<td>
<ng-container *ngIf="data.r_clock"><span class="color-green"><i class="anticon anticon-check-square-o"></i></span>
</ng-container>
<ng-container *ngIf="!data.r_clock"><span class="color-red"> <i class="anticon anticon-warning"></i></span>
</ng-container>
</td>
</tr>
</tbody>
</nz-table>
......@@ -43,7 +43,7 @@ export class HomeComponent implements OnInit,AfterViewInit {
leftOneData = {
serious:0,
warning:0,
waring:0,
normal:0,
disable:0,
};
......@@ -57,7 +57,7 @@ export class HomeComponent implements OnInit,AfterViewInit {
leftOneTotal = 0;
leftTwoData ={
serious:0,
warning:0,
waring:0,
normal:0,
disable:0,
};
......@@ -151,8 +151,8 @@ export class HomeComponent implements OnInit,AfterViewInit {
this.leftOneDataPre.seriousPer = a.toFixed(2);
}
if(this.leftOneData.warning > 0){
let b:any = ( (this.leftOneData.warning / this.leftOneTotal)* 100 );
if(this.leftOneData.waring > 0){
let b:any = ( (this.leftOneData.waring / this.leftOneTotal)* 100 );
this.leftOneDataPre.warningPer = b .toFixed(2);
}
......@@ -238,8 +238,8 @@ export class HomeComponent implements OnInit,AfterViewInit {
this.leftTwoDataPre.seriousPer = w.toFixed(2);
}
if(this.leftTwoData.warning > 0){
let x:any = ( (this.leftTwoData.warning / this.leftTwoTotal)*100 );
if(this.leftTwoData.waring > 0){
let x:any = ( (this.leftTwoData.waring / this.leftTwoTotal)*100 );
this.leftTwoDataPre.warningPer = x .toFixed(2);
}
......
......@@ -13,13 +13,13 @@
</thead>
<tbody>
<tr *ngFor="let data of warnList">
<td class="table-timeline">
<nz-timeline-item>{{data.createTime | date:"yyyy-MM-dd HH:mm:ss"}}</nz-timeline-item>
<td>
{{data.createTime}}
</td>
<td class="round-tag tag-form">
<nz-tag *ngIf="data.level == 0 " [nzColor]="'#58ca13'"></nz-tag>
<nz-tag *ngIf="data.level == 2 " [nzColor]="'#fc0d1b'"></nz-tag>
<nz-tag *ngIf="data.level == 1 " [nzColor]="'#fd9827'"></nz-tag>
<nz-tag class="tag-green" *ngIf="data.level == 0 " [nzColor]="'#58ca13'"></nz-tag>
<nz-tag class="tag-red" *ngIf="data.level == 2 " [nzColor]="'#fc0d1b'"></nz-tag>
<nz-tag class="tag-yellow" *ngIf="data.level == 1 " [nzColor]="'#fd9827'"></nz-tag>
</td>
<td>{{data.name}}</td>
<td>{{data.description}}</td>
......
......@@ -55,7 +55,9 @@ export class WarnListComponent implements OnInit {
if (res.data) {
res.data.data.forEach(e => {
if (e.endTime && e.createTime) {
const continuedTime = (new Date(e.endTime).getTime() - new Date(e.createTime).getTime());
const endTime = e.endTime.replace(/-/g, '/');
const createTime = e.createTime.replace(/-/g, '/');
const continuedTime = (new Date(endTime).getTime()) - (new Date(createTime).getTime());
e.continuedTime = this.commonSer.unitTime(continuedTime);
}
});
......
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