[web-app] 增加同步按钮

This commit is contained in:
tomsun28
2021-12-17 15:43:25 +08:00
parent faf25b557e
commit d4241e093f
8 changed files with 38 additions and 10 deletions

View File

@@ -17,6 +17,9 @@
<i nz-icon nzType="delete" nzTheme="outline"></i>
删除告警
</button>
<button nz-button nzType="primary" (click)="sync()">
<i nz-icon nzType="sync" nzTheme="outline"></i>
</button>
<nz-table #fixedTable [nzData]="alerts"
[nzPageIndex]="pageIndex" [nzPageSize]="pageSize" [nzTotal]="total"

View File

@@ -28,6 +28,10 @@ export class AlertCenterComponent implements OnInit {
this.loadAlertsTable();
}
sync() {
this.loadAlertsTable();
}
loadAlertsTable() {
this.tableLoading = true;
let alertsInit$ = this.alertSvc.getAlerts(this.pageIndex - 1, this.pageSize)

View File

@@ -19,6 +19,9 @@
<i nz-icon nzType="appstore-add" nzTheme="outline"></i>
新增接收人
</button>
<button nz-button nzType="primary" (click)="syncReceiver()">
<i nz-icon nzType="sync" nzTheme="outline"></i>
</button>
<nz-table #fixedTable [nzData]="receivers"
nzFrontPagination ="false"
[nzLoading] = "receiverTableLoading"
@@ -38,7 +41,7 @@
<span>{{ data.name}}</span>
</td>
<td nzAlign="center">
<nz-tag *ngIf="data.type == 0" nzColor="red">
<nz-tag *ngIf="data.type == 0" nzColor="orange">
<i nz-icon nzType="notification" nzTheme="outline"></i>
<span>短信</span>
</nz-tag>
@@ -46,11 +49,11 @@
<i nz-icon nzType="notification" nzTheme="outline"></i>
<span>邮件</span>
</nz-tag>
<nz-tag *ngIf="data.type == 2" nzColor="yellow">
<nz-tag *ngIf="data.type == 2" nzColor="orange">
<i nz-icon nzType="notification" nzTheme="outline"></i>
<span>WebHook</span>
</nz-tag>
<nz-tag *ngIf="data.type == 3" nzColor="yellow">
<nz-tag *ngIf="data.type == 3" nzColor="orange">
<i nz-icon nzType="notification" nzTheme="outline"></i>
<span>微信公众号</span>
</nz-tag>
@@ -79,6 +82,9 @@
<i nz-icon nzType="appstore-add" nzTheme="outline"></i>
新增通知策略
</button>
<button nz-button nzType="primary" (click)="syncRule()">
<i nz-icon nzType="sync" nzTheme="outline"></i>
</button>
<nz-table #ruleFixedTable [nzData]="rules"
nzFrontPagination ="false"
[nzLoading] = "ruleTableLoading"

View File

@@ -27,6 +27,12 @@ export class AlertNoticeComponent implements OnInit {
this.loadReceiversTable();
this.loadRulesTable();
}
syncReceiver() {
this.loadReceiversTable();
}
syncRule() {
this.loadRulesTable();
}
loadReceiversTable() {
this.receiverTableLoading = true;

View File

@@ -25,6 +25,9 @@
<i nz-icon nzType="delete" nzTheme="outline"></i>
删除
</button>
<button nz-button nzType="primary" (click)="sync()">
<i nz-icon nzType="sync" nzTheme="outline"></i>
</button>
<nz-table #fixedTable [nzData]="defines"
[nzPageIndex]="pageIndex" [nzPageSize]="pageSize" [nzTotal]="total"

View File

@@ -1,9 +1,7 @@
import { Component, OnInit } from '@angular/core';
import {NzTableQueryParams} from "ng-zorro-antd/table";
import {ActivatedRoute, Router} from "@angular/router";
import {NzModalService} from "ng-zorro-antd/modal";
import {NzNotificationService} from "ng-zorro-antd/notification";
import {NzMessageService} from "ng-zorro-antd/message";
import {AlertDefineService} from "../../../service/alert-define.service";
import {AlertDefine} from "../../../pojo/AlertDefine";
import {finalize, map} from "rxjs/operators";
@@ -23,11 +21,8 @@ import {Monitor} from "../../../pojo/Monitor";
})
export class AlertSettingComponent implements OnInit {
constructor(private route: ActivatedRoute,
private router: Router,
private modal: NzModalService,
constructor(private modal: NzModalService,
private notifySvc: NzNotificationService,
private msg: NzMessageService,
private appDefineSvc: AppDefineService,
private monitorSvc: MonitorService,
private alertDefineSvc: AlertDefineService) { }
@@ -59,6 +54,10 @@ export class AlertSettingComponent implements OnInit {
})
}
sync() {
this.loadAlertDefineTable();
}
loadAlertDefineTable() {
this.tableLoading = true;
let alertDefineInit$ = this.alertDefineSvc.getAlertDefines(this.pageIndex - 1, this.pageSize)

View File

@@ -12,7 +12,6 @@
</nz-breadcrumb-item>
</nz-breadcrumb>
<nz-divider></nz-divider>
<button nz-button nzType="primary">
<a routerLink="/monitors/new" [queryParams]="{app: app}">
<i nz-icon nzType="appstore-add" nzTheme="outline"></i>
@@ -35,6 +34,9 @@
<i nz-icon nzType="down-circle" nzTheme="outline"></i>
取消纳管
</button>
<button nz-button nzType="primary" (click)="sync()">
<i nz-icon nzType="sync" nzTheme="outline"></i>
</button>
<nz-table #fixedTable [nzData]="monitors"
[nzPageIndex]="pageIndex" [nzPageSize]="pageSize" [nzTotal]="total"

View File

@@ -42,7 +42,12 @@ export class MonitorListComponent implements OnInit {
});
}
sync() {
this.loadMonitorTable();
}
loadMonitorTable() {
this.tableLoading = true;
let monitorInit$ = this.monitorSvc.getMonitors(this.app, this.pageIndex - 1, this.pageSize)
.subscribe(message => {
this.tableLoading = false;