[monitor] 告警结构duration持续时间变更为times触发次数

This commit is contained in:
tomsun28
2021-12-13 15:22:16 +08:00
parent e22dcf30bc
commit caf3e9fef9
8 changed files with 51 additions and 49 deletions

View File

@@ -6,6 +6,6 @@ export class Alert {
priority: number = 2;
status!: number;
content!: string;
duration!: number;
times!: number;
gmtCreate!: number;
}

View File

@@ -7,7 +7,7 @@ export class AlertDefine {
expr!: string;
// 告警级别 0:高-emergency-紧急告警-红色 1:中-critical-严重告警-橙色 2:低-warning-警告告警-黄色
priority: number = 2;
duration: number = 600;
times: number = 3;
enable: boolean = true;
template!: string;
creator!: string;

View File

@@ -34,12 +34,11 @@
<thead>
<tr>
<th nzAlign="center" nzLeft nzWidth="60px" [(nzChecked)]="checkedAll" (nzCheckedChange)="onAllChecked($event)"></th>
<th nzAlign="center">告警对象</th>
<th nzAlign="center">告警指标</th>
<th nzAlign="center">所属监控</th>
<th nzAlign="center">级别</th>
<th nzAlign="center">告警内容</th>
<th nzAlign="center">触发时间</th>
<th nzAlign="center">持续时间</th>
<th nzAlign="center">告警时间</th>
<th nzAlign="center" nzRight>操作</th>
</tr>
</thead>
@@ -68,7 +67,6 @@
</td>
<td nzAlign="center">{{ data.content }}</td>
<td nzAlign="center">{{ data.gmtCreate }}</td>
<td nzAlign="center">{{ data.duration }}</td>
<td nzAlign="center" nzRight>
<button nz-button nzType="primary" (click)="onRestoreOneAlert(data.id)">
<i nz-icon nzType="up-circle" nzTheme="outline"></i>

View File

@@ -41,9 +41,9 @@
<th nzAlign="center">指标对象</th>
<th nzAlign="center">阈值触发表达式</th>
<th nzAlign="center">告警级别</th>
<th nzAlign="center">持续时间</th>
<th nzAlign="center">触发次数</th>
<th nzAlign="center">通知模版</th>
<th nzAlign="center">预置默认</th>
<th nzAlign="center">全局默认</th>
<th nzAlign="center">最新修改时间</th>
<th nzAlign="center" nzRight>操作</th>
</tr>
@@ -71,7 +71,7 @@
<span>警告告警</span>
</nz-tag>
</td>
<td nzAlign="center">{{ data.duration + 's' }}</td>
<td nzAlign="center">{{ data.times }}</td>
<td nzAlign="center">{{ data.template }}</td>
<td nzAlign="center">
<nz-tag *ngIf="data.preset" nzColor="green">
@@ -149,10 +149,10 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label nzSpan="7" nzRequired="true" nzFor= "duration">持续时间</nz-form-label>
<nz-form-label nzSpan="7" nzRequired="true" nzFor= "duration">触发次数</nz-form-label>
<nz-form-control nzSpan="8">
<nz-input-number [(ngModel)]="define.duration" [nzMin]="10" [nzMax]="10000" [nzStep]="10"
name="duration" id="duration" nzPlaceHolder="请输入告警的持续时间">
<nz-input-number [(ngModel)]="define.times" [nzMin]="1" [nzMax]="10" [nzStep]="1"
name="duration" id="duration" nzPlaceHolder="触发几次后告警">
</nz-input-number>
</nz-form-control>
</nz-form-item >
@@ -167,7 +167,7 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label nzSpan="7" nzRequired="true" nzFor= "preset">默认预置</nz-form-label>
<nz-form-label nzSpan="7" nzRequired="true" nzFor= "preset">全局默认</nz-form-label>
<nz-form-control nzSpan="8">
<nz-switch [(ngModel)]="define.preset" name="preset" id="preset"></nz-switch>
</nz-form-control>