alert-center.component.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <nz-divider></nz-divider>
  2. <nz-breadcrumb>
  3. <nz-breadcrumb-item>
  4. <a [routerLink]="['/']">
  5. <i nz-icon nzType="home"></i>
  6. <span>{{ 'menu.dashboard' | i18n }}</span>
  7. </a>
  8. </nz-breadcrumb-item>
  9. <nz-breadcrumb-item>
  10. <i nz-icon nzType="alert"></i>
  11. <span>{{ 'menu.alert.center' | i18n }}</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. {{ 'alert.center.delete' | i18n }}
  19. </button>
  20. <button nz-button nzType="primary" (click)="onMarkReadAlerts()">
  21. <i nz-icon nzType="down-circle" nzTheme="outline"></i>
  22. {{ 'alert.center.deal' | i18n }}
  23. </button>
  24. <button nz-button nzType="primary" (click)="onMarkUnReadAlerts()">
  25. <i nz-icon nzType="up-circle" nzTheme="outline"></i>
  26. {{ 'alert.center.no-deal' | i18n }}
  27. </button>
  28. <button nz-button nzType="primary" (click)="sync()" nz-tooltip [nzTooltipTitle]="'common.refresh' | i18n">
  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()">
  32. {{ 'common.search' | i18n }}
  33. </button>
  34. <input
  35. style="margin-right: 5px; float: right; width: 150px; border-radius: 9px; text-align: center"
  36. nz-input
  37. type="text"
  38. [placeholder]="'alert.center.search' | i18n"
  39. nzSize="default"
  40. (keyup.enter)="onFilterSearchAlerts()"
  41. [(ngModel)]="filterContent"
  42. />
  43. <nz-select
  44. style="margin-right: 10px; float: right; width: 120px"
  45. nzAllowClear
  46. [nzPlaceHolder]="'alert.center.filter-status' | i18n"
  47. [(ngModel)]="filterStatus"
  48. >
  49. <nz-option [nzLabel]="'alert.status.all' | i18n" nzValue="9"></nz-option>
  50. <nz-option [nzLabel]="'alert.status.0' | i18n" nzValue="0"></nz-option>
  51. <nz-option [nzLabel]="'alert.status.2' | i18n" nzValue="2"></nz-option>
  52. <nz-option [nzLabel]="'alert.status.3' | i18n" nzValue="3"></nz-option>
  53. </nz-select>
  54. <nz-select
  55. style="margin-right: 10px; float: right; width: 120px"
  56. nzAllowClear
  57. [nzPlaceHolder]="'alert.center.filter-priority' | i18n"
  58. [(ngModel)]="filterPriority"
  59. >
  60. <nz-option [nzLabel]="'alert.priority.all' | i18n" nzValue="9"></nz-option>
  61. <nz-option [nzLabel]="'alert.priority.2' | i18n" nzValue="2"></nz-option>
  62. <nz-option [nzLabel]="'alert.priority.1' | i18n" nzValue="1"></nz-option>
  63. <nz-option [nzLabel]="'alert.priority.0' | i18n" nzValue="0"></nz-option>
  64. </nz-select>
  65. </div>
  66. <nz-table
  67. #fixedTable
  68. [nzData]="alerts"
  69. [nzPageIndex]="pageIndex"
  70. [nzPageSize]="pageSize"
  71. [nzTotal]="total"
  72. nzFrontPagination="false"
  73. [nzLoading]="tableLoading"
  74. nzShowSizeChanger
  75. [nzShowTotal]="rangeTemplate"
  76. [nzPageSizeOptions]="[8, 15, 25]"
  77. (nzQueryParams)="onTablePageChange($event)"
  78. nzShowPagination="true"
  79. [nzScroll]="{ x: '1150px', y: '1240px' }"
  80. >
  81. <thead>
  82. <tr>
  83. <th nzAlign="center" nzLeft nzWidth="4%" [(nzChecked)]="checkedAll" (nzCheckedChange)="onAllChecked($event)"></th>
  84. <th nzAlign="center" nzLeft>{{ 'alert.center.target' | i18n }}</th>
  85. <th nzAlign="center">{{ 'alert.center.monitor' | i18n }}</th>
  86. <th nzAlign="center">{{ 'alert.center.priority' | i18n }}</th>
  87. <th nzAlign="center">{{ 'alert.center.content' | i18n }}</th>
  88. <th nzAlign="center">{{ 'alert.center.status' | i18n }}</th>
  89. <th nzAlign="center">{{ 'alert.center.time' | i18n }}</th>
  90. <th nzAlign="center">{{ 'common.edit' | i18n }}</th>
  91. </tr>
  92. </thead>
  93. <tbody>
  94. <tr *ngFor="let data of fixedTable.data" [ngStyle]="{ 'background-color': data.status === 0 ? '#E1E7A89B' : 'inherit' }">
  95. <td nzAlign="center" nzLeft [nzChecked]="checkedAlertIds.has(data.id)" (nzCheckedChange)="onItemChecked(data.id, $event)"></td>
  96. <td nzAlign="center" nzLeft>{{ data.target }}</td>
  97. <td nzAlign="center">
  98. <a [routerLink]="['/monitors/' + data.monitorId]">
  99. <span>{{ data.monitorName }}</span>
  100. </a>
  101. </td>
  102. <td nzAlign="center">
  103. <nz-tag *ngIf="data.priority == 0" nzColor="red">
  104. <i nz-icon nzType="bell" nzTheme="outline"></i>
  105. <span>{{ 'alert.priority.0' | i18n }}</span>
  106. </nz-tag>
  107. <nz-tag *ngIf="data.priority == 1" nzColor="orange">
  108. <i nz-icon nzType="bell" nzTheme="outline"></i>
  109. <span>{{ 'alert.priority.1' | i18n }}</span>
  110. </nz-tag>
  111. <nz-tag *ngIf="data.priority == 2" nzColor="yellow">
  112. <i nz-icon nzType="bell" nzTheme="outline"></i>
  113. <span>{{ 'alert.priority.2' | i18n }}</span>
  114. </nz-tag>
  115. </td>
  116. <td nzAlign="center">{{ data.content }}</td>
  117. <td nzAlign="center">
  118. {{ 'alert.status.' + data.status | i18n }}
  119. </td>
  120. <td nzAlign="center">{{ data.gmtCreate | date: 'YYYY-MM-dd HH:mm:ss' }}</td>
  121. <td nzAlign="center">
  122. <button nz-button nzType="primary" (click)="onDeleteOneAlert(data.id)" nz-tooltip [nzTooltipTitle]="'alert.center.delete' | i18n">
  123. <i nz-icon nzType="delete" nzTheme="outline"></i>
  124. </button>
  125. <button nz-button nzType="primary" (click)="onMarkReadOneAlert(data.id)" nz-tooltip [nzTooltipTitle]="'alert.center.deal' | i18n">
  126. <i nz-icon nzType="down-circle" nzTheme="outline"></i>
  127. </button>
  128. <button
  129. nz-button
  130. nzType="primary"
  131. (click)="onMarkUnReadOneAlert(data.id)"
  132. nz-tooltip
  133. [nzTooltipTitle]="'alert.center.no-deal' | i18n"
  134. >
  135. <i nz-icon nzType="up-circle" nzTheme="outline"></i>
  136. </button>
  137. </td>
  138. </tr>
  139. </tbody>
  140. </nz-table>
  141. <ng-template #rangeTemplate> {{ 'common.total' | i18n }} {{ total }} </ng-template>