[web-app] 增加同步按钮
This commit is contained in:
@@ -17,6 +17,9 @@
|
|||||||
<i nz-icon nzType="delete" nzTheme="outline"></i>
|
<i nz-icon nzType="delete" nzTheme="outline"></i>
|
||||||
删除告警
|
删除告警
|
||||||
</button>
|
</button>
|
||||||
|
<button nz-button nzType="primary" (click)="sync()">
|
||||||
|
<i nz-icon nzType="sync" nzTheme="outline"></i>
|
||||||
|
</button>
|
||||||
|
|
||||||
<nz-table #fixedTable [nzData]="alerts"
|
<nz-table #fixedTable [nzData]="alerts"
|
||||||
[nzPageIndex]="pageIndex" [nzPageSize]="pageSize" [nzTotal]="total"
|
[nzPageIndex]="pageIndex" [nzPageSize]="pageSize" [nzTotal]="total"
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ export class AlertCenterComponent implements OnInit {
|
|||||||
this.loadAlertsTable();
|
this.loadAlertsTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sync() {
|
||||||
|
this.loadAlertsTable();
|
||||||
|
}
|
||||||
|
|
||||||
loadAlertsTable() {
|
loadAlertsTable() {
|
||||||
this.tableLoading = true;
|
this.tableLoading = true;
|
||||||
let alertsInit$ = this.alertSvc.getAlerts(this.pageIndex - 1, this.pageSize)
|
let alertsInit$ = this.alertSvc.getAlerts(this.pageIndex - 1, this.pageSize)
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
<i nz-icon nzType="appstore-add" nzTheme="outline"></i>
|
<i nz-icon nzType="appstore-add" nzTheme="outline"></i>
|
||||||
新增接收人
|
新增接收人
|
||||||
</button>
|
</button>
|
||||||
|
<button nz-button nzType="primary" (click)="syncReceiver()">
|
||||||
|
<i nz-icon nzType="sync" nzTheme="outline"></i>
|
||||||
|
</button>
|
||||||
<nz-table #fixedTable [nzData]="receivers"
|
<nz-table #fixedTable [nzData]="receivers"
|
||||||
nzFrontPagination ="false"
|
nzFrontPagination ="false"
|
||||||
[nzLoading] = "receiverTableLoading"
|
[nzLoading] = "receiverTableLoading"
|
||||||
@@ -38,7 +41,7 @@
|
|||||||
<span>{{ data.name}}</span>
|
<span>{{ data.name}}</span>
|
||||||
</td>
|
</td>
|
||||||
<td nzAlign="center">
|
<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>
|
<i nz-icon nzType="notification" nzTheme="outline"></i>
|
||||||
<span>短信</span>
|
<span>短信</span>
|
||||||
</nz-tag>
|
</nz-tag>
|
||||||
@@ -46,11 +49,11 @@
|
|||||||
<i nz-icon nzType="notification" nzTheme="outline"></i>
|
<i nz-icon nzType="notification" nzTheme="outline"></i>
|
||||||
<span>邮件</span>
|
<span>邮件</span>
|
||||||
</nz-tag>
|
</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>
|
<i nz-icon nzType="notification" nzTheme="outline"></i>
|
||||||
<span>WebHook</span>
|
<span>WebHook</span>
|
||||||
</nz-tag>
|
</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>
|
<i nz-icon nzType="notification" nzTheme="outline"></i>
|
||||||
<span>微信公众号</span>
|
<span>微信公众号</span>
|
||||||
</nz-tag>
|
</nz-tag>
|
||||||
@@ -79,6 +82,9 @@
|
|||||||
<i nz-icon nzType="appstore-add" nzTheme="outline"></i>
|
<i nz-icon nzType="appstore-add" nzTheme="outline"></i>
|
||||||
新增通知策略
|
新增通知策略
|
||||||
</button>
|
</button>
|
||||||
|
<button nz-button nzType="primary" (click)="syncRule()">
|
||||||
|
<i nz-icon nzType="sync" nzTheme="outline"></i>
|
||||||
|
</button>
|
||||||
<nz-table #ruleFixedTable [nzData]="rules"
|
<nz-table #ruleFixedTable [nzData]="rules"
|
||||||
nzFrontPagination ="false"
|
nzFrontPagination ="false"
|
||||||
[nzLoading] = "ruleTableLoading"
|
[nzLoading] = "ruleTableLoading"
|
||||||
|
|||||||
@@ -27,6 +27,12 @@ export class AlertNoticeComponent implements OnInit {
|
|||||||
this.loadReceiversTable();
|
this.loadReceiversTable();
|
||||||
this.loadRulesTable();
|
this.loadRulesTable();
|
||||||
}
|
}
|
||||||
|
syncReceiver() {
|
||||||
|
this.loadReceiversTable();
|
||||||
|
}
|
||||||
|
syncRule() {
|
||||||
|
this.loadRulesTable();
|
||||||
|
}
|
||||||
|
|
||||||
loadReceiversTable() {
|
loadReceiversTable() {
|
||||||
this.receiverTableLoading = true;
|
this.receiverTableLoading = true;
|
||||||
|
|||||||
@@ -25,6 +25,9 @@
|
|||||||
<i nz-icon nzType="delete" nzTheme="outline"></i>
|
<i nz-icon nzType="delete" nzTheme="outline"></i>
|
||||||
删除
|
删除
|
||||||
</button>
|
</button>
|
||||||
|
<button nz-button nzType="primary" (click)="sync()">
|
||||||
|
<i nz-icon nzType="sync" nzTheme="outline"></i>
|
||||||
|
</button>
|
||||||
|
|
||||||
<nz-table #fixedTable [nzData]="defines"
|
<nz-table #fixedTable [nzData]="defines"
|
||||||
[nzPageIndex]="pageIndex" [nzPageSize]="pageSize" [nzTotal]="total"
|
[nzPageIndex]="pageIndex" [nzPageSize]="pageSize" [nzTotal]="total"
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import {NzTableQueryParams} from "ng-zorro-antd/table";
|
import {NzTableQueryParams} from "ng-zorro-antd/table";
|
||||||
import {ActivatedRoute, Router} from "@angular/router";
|
|
||||||
import {NzModalService} from "ng-zorro-antd/modal";
|
import {NzModalService} from "ng-zorro-antd/modal";
|
||||||
import {NzNotificationService} from "ng-zorro-antd/notification";
|
import {NzNotificationService} from "ng-zorro-antd/notification";
|
||||||
import {NzMessageService} from "ng-zorro-antd/message";
|
|
||||||
import {AlertDefineService} from "../../../service/alert-define.service";
|
import {AlertDefineService} from "../../../service/alert-define.service";
|
||||||
import {AlertDefine} from "../../../pojo/AlertDefine";
|
import {AlertDefine} from "../../../pojo/AlertDefine";
|
||||||
import {finalize, map} from "rxjs/operators";
|
import {finalize, map} from "rxjs/operators";
|
||||||
@@ -23,11 +21,8 @@ import {Monitor} from "../../../pojo/Monitor";
|
|||||||
})
|
})
|
||||||
export class AlertSettingComponent implements OnInit {
|
export class AlertSettingComponent implements OnInit {
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private modal: NzModalService,
|
||||||
private router: Router,
|
|
||||||
private modal: NzModalService,
|
|
||||||
private notifySvc: NzNotificationService,
|
private notifySvc: NzNotificationService,
|
||||||
private msg: NzMessageService,
|
|
||||||
private appDefineSvc: AppDefineService,
|
private appDefineSvc: AppDefineService,
|
||||||
private monitorSvc: MonitorService,
|
private monitorSvc: MonitorService,
|
||||||
private alertDefineSvc: AlertDefineService) { }
|
private alertDefineSvc: AlertDefineService) { }
|
||||||
@@ -59,6 +54,10 @@ export class AlertSettingComponent implements OnInit {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sync() {
|
||||||
|
this.loadAlertDefineTable();
|
||||||
|
}
|
||||||
|
|
||||||
loadAlertDefineTable() {
|
loadAlertDefineTable() {
|
||||||
this.tableLoading = true;
|
this.tableLoading = true;
|
||||||
let alertDefineInit$ = this.alertDefineSvc.getAlertDefines(this.pageIndex - 1, this.pageSize)
|
let alertDefineInit$ = this.alertDefineSvc.getAlertDefines(this.pageIndex - 1, this.pageSize)
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
</nz-breadcrumb-item>
|
</nz-breadcrumb-item>
|
||||||
</nz-breadcrumb>
|
</nz-breadcrumb>
|
||||||
<nz-divider></nz-divider>
|
<nz-divider></nz-divider>
|
||||||
|
|
||||||
<button nz-button nzType="primary">
|
<button nz-button nzType="primary">
|
||||||
<a routerLink="/monitors/new" [queryParams]="{app: app}">
|
<a routerLink="/monitors/new" [queryParams]="{app: app}">
|
||||||
<i nz-icon nzType="appstore-add" nzTheme="outline"></i>
|
<i nz-icon nzType="appstore-add" nzTheme="outline"></i>
|
||||||
@@ -35,6 +34,9 @@
|
|||||||
<i nz-icon nzType="down-circle" nzTheme="outline"></i>
|
<i nz-icon nzType="down-circle" nzTheme="outline"></i>
|
||||||
取消纳管
|
取消纳管
|
||||||
</button>
|
</button>
|
||||||
|
<button nz-button nzType="primary" (click)="sync()">
|
||||||
|
<i nz-icon nzType="sync" nzTheme="outline"></i>
|
||||||
|
</button>
|
||||||
|
|
||||||
<nz-table #fixedTable [nzData]="monitors"
|
<nz-table #fixedTable [nzData]="monitors"
|
||||||
[nzPageIndex]="pageIndex" [nzPageSize]="pageSize" [nzTotal]="total"
|
[nzPageIndex]="pageIndex" [nzPageSize]="pageSize" [nzTotal]="total"
|
||||||
|
|||||||
@@ -42,7 +42,12 @@ export class MonitorListComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sync() {
|
||||||
|
this.loadMonitorTable();
|
||||||
|
}
|
||||||
|
|
||||||
loadMonitorTable() {
|
loadMonitorTable() {
|
||||||
|
this.tableLoading = true;
|
||||||
let monitorInit$ = this.monitorSvc.getMonitors(this.app, this.pageIndex - 1, this.pageSize)
|
let monitorInit$ = this.monitorSvc.getMonitors(this.app, this.pageIndex - 1, this.pageSize)
|
||||||
.subscribe(message => {
|
.subscribe(message => {
|
||||||
this.tableLoading = false;
|
this.tableLoading = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user