alert-center.component.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <nz-divider></nz-divider>
  2. <nz-breadcrumb>
  3. <nz-breadcrumb-item>
  4. <a [routerLink]="['/']">
  5. <i nz-icon nzType="home"></i>
  6. <span>仪表盘</span>
  7. </a>
  8. </nz-breadcrumb-item>
  9. <nz-breadcrumb-item>
  10. <i nz-icon nzType="alert"></i>
  11. <span>告警中心</span>
  12. </nz-breadcrumb-item>
  13. </nz-breadcrumb>
  14. <nz-divider></nz-divider>
  15. <div>
  16. <button nz-button nzType="primary" (click)="onDeleteAlerts()">
  17. <i nz-icon nzType="delete" nzTheme="outline"></i>
  18. 删除告警
  19. </button>
  20. <button nz-button nzType="primary" (click)="onMarkReadAlerts()">
  21. <i nz-icon nzType="down-circle" nzTheme="outline"></i>
  22. 标记已处理
  23. </button>
  24. <button nz-button nzType="primary" (click)="onMarkUnReadAlerts()">
  25. <i nz-icon nzType="up-circle" nzTheme="outline"></i>
  26. 标记未处理
  27. </button>
  28. <button nz-button nzType="primary" (click)="sync()" nz-tooltip nzTooltipTitle="刷新">
  29. <i nz-icon nzType="sync" nzTheme="outline"></i>
  30. </button>
  31. <button style="margin-right: 25px; float: right" nz-button nzType="primary" (click)="onFilterSearchAlerts()"> 搜索 </button>
  32. <input
  33. style="margin-right: 5px; float: right; width: 150px; border-radius: 9px; text-align: center"
  34. nz-input
  35. type="text"
  36. placeholder="搜索告警内容"
  37. nzSize="default"
  38. [(ngModel)]="filterContent"
  39. />
  40. <nz-select
  41. style="margin-right: 10px; float: right; width: 120px"
  42. nzAllowClear
  43. [nzPlaceHolder]="'告警状态过滤'"
  44. [(ngModel)]="filterStatus"
  45. >
  46. <nz-option nzLabel="全部状态" nzValue="9"></nz-option>
  47. <nz-option nzLabel="未处理" nzValue="0"></nz-option>
  48. <nz-option nzLabel="已处理" nzValue="3"></nz-option>
  49. </nz-select>
  50. <nz-select
  51. style="margin-right: 10px; float: right; width: 120px"
  52. nzAllowClear
  53. [nzPlaceHolder]="'告警级别过滤'"
  54. [(ngModel)]="filterPriority"
  55. >
  56. <nz-option nzLabel="全部级别" nzValue="9"></nz-option>
  57. <nz-option nzLabel="警告级别" nzValue="2"></nz-option>
  58. <nz-option nzLabel="严重级别" nzValue="1"></nz-option>
  59. <nz-option nzLabel="紧急级别" nzValue="0"></nz-option>
  60. </nz-select>
  61. </div>
  62. <nz-table
  63. #fixedTable
  64. [nzData]="alerts"
  65. [nzPageIndex]="pageIndex"
  66. [nzPageSize]="pageSize"
  67. [nzTotal]="total"
  68. nzFrontPagination="false"
  69. [nzLoading]="tableLoading"
  70. nzShowSizeChanger
  71. [nzShowTotal]="rangeTemplate"
  72. [nzPageSizeOptions]="[8, 15, 25]"
  73. (nzQueryParams)="onTablePageChange($event)"
  74. nzShowPagination="true"
  75. [nzScroll]="{ x: '1150px', y: '1240px' }"
  76. >
  77. <thead>
  78. <tr>
  79. <th nzAlign="center" nzLeft nzWidth="4%" [(nzChecked)]="checkedAll" (nzCheckedChange)="onAllChecked($event)"></th>
  80. <th nzAlign="center" nzLeft>告警指标</th>
  81. <th nzAlign="center">所属监控</th>
  82. <th nzAlign="center">级别</th>
  83. <th nzAlign="center">告警内容</th>
  84. <th nzAlign="center">状态</th>
  85. <th nzAlign="center">告警时间</th>
  86. <th nzAlign="center">操作</th>
  87. </tr>
  88. </thead>
  89. <tbody>
  90. <tr *ngFor="let data of fixedTable.data" [ngStyle]="{ 'background-color': data.status === 0 ? '#E1E7A89B' : 'inherit' }">
  91. <td nzAlign="center" nzLeft [nzChecked]="checkedAlertIds.has(data.id)" (nzCheckedChange)="onItemChecked(data.id, $event)"></td>
  92. <td nzAlign="center" nzLeft>{{ data.target }}</td>
  93. <td nzAlign="center">
  94. <a [routerLink]="['/monitors/' + data.monitorId]">
  95. <span>{{ data.monitorName }}</span>
  96. </a>
  97. </td>
  98. <td nzAlign="center">
  99. <nz-tag *ngIf="data.priority == 0" nzColor="red">
  100. <i nz-icon nzType="bell" nzTheme="outline"></i>
  101. <span>紧急告警</span>
  102. </nz-tag>
  103. <nz-tag *ngIf="data.priority == 1" nzColor="orange">
  104. <i nz-icon nzType="bell" nzTheme="outline"></i>
  105. <span>严重告警</span>
  106. </nz-tag>
  107. <nz-tag *ngIf="data.priority == 2" nzColor="yellow">
  108. <i nz-icon nzType="bell" nzTheme="outline"></i>
  109. <span>警告告警</span>
  110. </nz-tag>
  111. </td>
  112. <td nzAlign="center">{{ data.content }}</td>
  113. <td nzAlign="center">
  114. {{ data.status === 0 ? '未处理' : '已处理' }}
  115. </td>
  116. <td nzAlign="center">{{ data.gmtCreate }}</td>
  117. <td nzAlign="center">
  118. <button nz-button nzType="primary" (click)="onDeleteOneAlert(data.id)" nz-tooltip nzTooltipTitle="删除告警">
  119. <i nz-icon nzType="delete" nzTheme="outline"></i>
  120. </button>
  121. <button nz-button nzType="primary" (click)="onMarkReadOneAlert(data.id)" nz-tooltip nzTooltipTitle="标记已处理">
  122. <i nz-icon nzType="down-circle" nzTheme="outline"></i>
  123. </button>
  124. <button nz-button nzType="primary" (click)="onMarkUnReadOneAlert(data.id)" nz-tooltip nzTooltipTitle="标记未处理">
  125. <i nz-icon nzType="up-circle" nzTheme="outline"></i>
  126. </button>
  127. </td>
  128. </tr>
  129. </tbody>
  130. </nz-table>
  131. <ng-template #rangeTemplate> 总量 {{ total }} </ng-template>