diff --git a/web-app/src/app/routes/alert/alert-center/alert-center.component.html b/web-app/src/app/routes/alert/alert-center/alert-center.component.html index ec34603..482aab1 100644 --- a/web-app/src/app/routes/alert/alert-center/alert-center.component.html +++ b/web-app/src/app/routes/alert/alert-center/alert-center.component.html @@ -3,12 +3,12 @@ - 仪表盘 + {{ 'menu.dashboard' | i18n }} - 告警中心 + {{ 'menu.alert.center' | i18n }} @@ -16,26 +16,28 @@
- - + - - - + + + + - - - - + + + +
@@ -81,13 +84,13 @@ - 告警指标 - 所属监控 - 级别 - 告警内容 - 状态 - 告警时间 - 操作 + {{ 'alert.center.target' | i18n }} + {{ 'alert.center.monitor' | i18n }} + {{ 'alert.center.priority' | i18n }} + {{ 'alert.center.content' | i18n }} + {{ 'alert.center.status' | i18n }} + {{ 'alert.center.time' | i18n }} + {{ 'common.edit' | i18n }} @@ -102,30 +105,36 @@ - 紧急告警 + {{ 'alert.priority.0' | i18n }} - 严重告警 + {{ 'alert.priority.1' | i18n }} - 警告告警 + {{ 'alert.priority.2' | i18n }} {{ data.content }} - {{ data.status === 0 ? '未处理' : '已处理' }} + {{ 'alert.status.' + data.status | i18n }} {{ data.gmtCreate | date: 'YYYY-MM-dd HH:mm:ss' }} - - - @@ -133,4 +142,4 @@ - 总量 {{ total }} + {{ 'common.total' | i18n }} {{ total }} diff --git a/web-app/src/app/routes/alert/alert-center/alert-center.component.ts b/web-app/src/app/routes/alert/alert-center/alert-center.component.ts index 83e7100..f666d7b 100644 --- a/web-app/src/app/routes/alert/alert-center/alert-center.component.ts +++ b/web-app/src/app/routes/alert/alert-center/alert-center.component.ts @@ -1,4 +1,6 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Inject, OnInit } from '@angular/core'; +import { I18NService } from '@core'; +import { ALAIN_I18N_TOKEN } from '@delon/theme'; import { NzModalService } from 'ng-zorro-antd/modal'; import { NzNotificationService } from 'ng-zorro-antd/notification'; import { NzTableQueryParams } from 'ng-zorro-antd/table'; @@ -12,7 +14,12 @@ import { AlertService } from '../../../service/alert.service'; styles: [] }) export class AlertCenterComponent implements OnInit { - constructor(private notifySvc: NzNotificationService, private modal: NzModalService, private alertSvc: AlertService) {} + constructor( + private notifySvc: NzNotificationService, + private modal: NzModalService, + private alertSvc: AlertService, + @Inject(ALAIN_I18N_TOKEN) private i18nSvc: I18NService + ) {} pageIndex: number = 1; pageSize: number = 8; @@ -87,13 +94,13 @@ export class AlertCenterComponent implements OnInit { onDeleteAlerts() { if (this.checkedAlertIds == null || this.checkedAlertIds.size === 0) { - this.notifySvc.warning('未选中任何待删除项!', ''); + this.notifySvc.warning(this.i18nSvc.fanyi('alert.center.notify.no-delete'), ''); return; } this.modal.confirm({ - nzTitle: '请确认是否批量删除!', - nzOkText: '确定', - nzCancelText: '取消', + nzTitle: this.i18nSvc.fanyi('alert.center.confirm.delete-batch'), + nzOkText: this.i18nSvc.fanyi('common.button.ok'), + nzCancelText: this.i18nSvc.fanyi('common.button.cancel'), nzOkDanger: true, nzOkType: 'primary', nzOnOk: () => this.deleteAlerts(this.checkedAlertIds) @@ -102,13 +109,13 @@ export class AlertCenterComponent implements OnInit { onMarkReadAlerts() { if (this.checkedAlertIds == null || this.checkedAlertIds.size === 0) { - this.notifySvc.warning('未选中任何待标记项!', ''); + this.notifySvc.warning(this.i18nSvc.fanyi('alert.center.notify.no-mark'), ''); return; } this.modal.confirm({ - nzTitle: '请确认是否批量标记已处理!', - nzOkText: '确定', - nzCancelText: '取消', + nzTitle: this.i18nSvc.fanyi('alert.center.confirm.mark-done-batch'), + nzOkText: this.i18nSvc.fanyi('common.button.ok'), + nzCancelText: this.i18nSvc.fanyi('common.button.cancel'), nzOkDanger: true, nzOkType: 'primary', nzOnOk: () => this.updateAlertsStatus(this.checkedAlertIds, 3) @@ -116,13 +123,13 @@ export class AlertCenterComponent implements OnInit { } onMarkUnReadAlerts() { if (this.checkedAlertIds == null || this.checkedAlertIds.size === 0) { - this.notifySvc.warning('未选中任何待标记项!', ''); + this.notifySvc.warning(this.i18nSvc.fanyi('alert.center.notify.no-mark'), ''); return; } this.modal.confirm({ - nzTitle: '请确认是否批量标记未处理!', - nzOkText: '确定', - nzCancelText: '取消', + nzTitle: this.i18nSvc.fanyi('alert.center.confirm.mark-no-batch'), + nzOkText: this.i18nSvc.fanyi('common.button.ok'), + nzCancelText: this.i18nSvc.fanyi('common.button.cancel'), nzOkDanger: true, nzOkType: 'primary', nzOnOk: () => this.updateAlertsStatus(this.checkedAlertIds, 0) @@ -133,9 +140,9 @@ export class AlertCenterComponent implements OnInit { let alerts = new Set(); alerts.add(alertId); this.modal.confirm({ - nzTitle: '请确认是否删除!', - nzOkText: '确定', - nzCancelText: '取消', + nzTitle: this.i18nSvc.fanyi('common.confirm.delete'), + nzOkText: this.i18nSvc.fanyi('common.button.ok'), + nzCancelText: this.i18nSvc.fanyi('common.button.cancel'), nzOkDanger: true, nzOkType: 'primary', nzOnOk: () => this.deleteAlerts(alerts) @@ -146,9 +153,9 @@ export class AlertCenterComponent implements OnInit { let alerts = new Set(); alerts.add(alertId); this.modal.confirm({ - nzTitle: '请确认是否标记已处理!', - nzOkText: '确定', - nzCancelText: '取消', + nzTitle: this.i18nSvc.fanyi('alert.center.confirm.mark-done'), + nzOkText: this.i18nSvc.fanyi('common.button.ok'), + nzCancelText: this.i18nSvc.fanyi('common.button.cancel'), nzOkDanger: true, nzOkType: 'primary', nzOnOk: () => this.updateAlertsStatus(alerts, 3) @@ -159,9 +166,9 @@ export class AlertCenterComponent implements OnInit { let alerts = new Set(); alerts.add(alertId); this.modal.confirm({ - nzTitle: '请确认是否标记未处理!', - nzOkText: '确定', - nzCancelText: '取消', + nzTitle: this.i18nSvc.fanyi('alert.center.confirm.mark-no'), + nzOkText: this.i18nSvc.fanyi('common.button.ok'), + nzCancelText: this.i18nSvc.fanyi('common.button.cancel'), nzOkDanger: true, nzOkType: 'primary', nzOnOk: () => this.updateAlertsStatus(alerts, 0) @@ -174,17 +181,17 @@ export class AlertCenterComponent implements OnInit { message => { deleteAlerts$.unsubscribe(); if (message.code === 0) { - this.notifySvc.success('删除成功!', ''); + this.notifySvc.success(this.i18nSvc.fanyi('common.notify.delete-success'), ''); this.loadAlertsTable(); } else { this.tableLoading = false; - this.notifySvc.error('删除失败!', message.msg); + this.notifySvc.error(this.i18nSvc.fanyi('common.notify.delete-fail'), message.msg); } }, error => { this.tableLoading = false; deleteAlerts$.unsubscribe(); - this.notifySvc.error('删除失败!', error.msg); + this.notifySvc.error(this.i18nSvc.fanyi('common.notify.delete-fail'), error.msg); } ); } @@ -195,17 +202,17 @@ export class AlertCenterComponent implements OnInit { message => { markAlertsStatus$.unsubscribe(); if (message.code === 0) { - this.notifySvc.success('标记成功!', ''); + this.notifySvc.success(this.i18nSvc.fanyi('common.notify.mark-success'), ''); this.loadAlertsTable(); } else { this.tableLoading = false; - this.notifySvc.error('标记失败!', message.msg); + this.notifySvc.error(this.i18nSvc.fanyi('common.notify.mark-fail'), message.msg); } }, error => { this.tableLoading = false; markAlertsStatus$.unsubscribe(); - this.notifySvc.error('标记失败!', error.msg); + this.notifySvc.error(this.i18nSvc.fanyi('common.notify.mark-fail'), error.msg); } ); } diff --git a/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.html b/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.html index b89485b..56506d0 100644 --- a/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.html +++ b/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.html @@ -162,4 +162,4 @@ - {{ 'monitors.total' | i18n }} {{ total }} + {{ 'common.total' | i18n }} {{ total }} diff --git a/web-app/src/assets/i18n/en-US.json b/web-app/src/assets/i18n/en-US.json index 196fa1b..deda3e2 100644 --- a/web-app/src/assets/i18n/en-US.json +++ b/web-app/src/assets/i18n/en-US.json @@ -80,17 +80,39 @@ "": "Alert", "status": { "": "Alert Status", + "all": "All Status", "0": "Pending", "2": "Restored", "3": "Processed" }, "priority": { - "": "Alarm Level", + "": "Alarm Priority", + "all": "All Priority", "0": "Emergency", "1": "Critical", "2": "Warning" } }, + "alert.center.delete": "Delete Alerts", + "alert.center.deal": "Mark Processed", + "alert.center.no-deal": "Mark Pending", + "alert.center.search": "Search Alert Content", + "alert.center.filter-status": "Filter Alert Status", + "alert.center.filter-priority": "Filter Alert Priority", + "alert.center.target": "Metric Target", + "alert.center.monitor": "Belong Monitor", + "alert.center.priority": "Priority", + "alert.center.content": "Alert Content", + "alert.center.status": "Status", + "alert.center.time": "Alert Time", + "alert.center.notify.no-delete": "No items selected for deletion!", + "alert.center.confirm.delete": "Please confirm whether to delete!", + "alert.center.confirm.delete-batch": "Please confirm whether to delete in batch!", + "alert.center.notify.no-mark": "No items selected for mark!", + "alert.center.confirm.mark-done-batch": "Please confirm whether to mark processed in batch!", + "alert.center.confirm.mark-done": "Please confirm whether to mark processed!", + "alert.center.confirm.mark-no-batch": "Please confirm whether to mark Pending in batch!", + "alert.center.confirm.mark-no": "Please confirm whether to mark Pending!", "dashboard.alerts.title": "Recently Alerts List", "dashboard.alerts.enter": "Go Alert Center", "dashboard.alerts.distribute": "The Distribution Of Alerts", @@ -151,6 +173,7 @@ "common.edit-time": "Last Update Time", "common.new-time": "Create Time", "common.edit": "Operate", + "common.total": "Total", "common.notify.no-select-edit": "No items selected for editing!", "common.notify.one-select-edit": "Only one selection can be edited!", "common.confirm.delete": "Please confirm whether to delete!", @@ -163,6 +186,8 @@ "common.confirm.cancel": "Please confirm whether to cancel monitor!", "common.notify.cancel-success": "Cancel Success!", "common.notify.cancel-fail": "Cancel Failed!", + "common.notify.mark-success": "Mark Success!", + "common.notify.mark-fail": "Mark Failed!", "common.notify.no-select-enable": "No items selected for enable!", "common.confirm.enable-batch": "Please confirm whether to enable monitor in batches!", "common.confirm.enable": "Please confirm whether to enable monitor!", diff --git a/web-app/src/assets/i18n/zh-CN.json b/web-app/src/assets/i18n/zh-CN.json index a1229af..49ad7c4 100644 --- a/web-app/src/assets/i18n/zh-CN.json +++ b/web-app/src/assets/i18n/zh-CN.json @@ -80,17 +80,39 @@ "": "告警", "status": { "": "告警状态", - "0": "待处理", + "all": "全部状态", + "0": "未处理", "2": "已恢复", "3": "已处理" }, "priority": { "": "告警级别", + "all": "全部级别", "0": "紧急告警", "1": "严重告警", "2": "警告告警" } }, + "alert.center.delete": "删除告警", + "alert.center.deal": "标记已处理", + "alert.center.no-deal": "标记未处理", + "alert.center.search": "搜索告警内容", + "alert.center.filter-status": "告警状态过滤", + "alert.center.filter-priority": "告警级别过滤", + "alert.center.target": "告警指标", + "alert.center.monitor": "所属监控", + "alert.center.priority": "级别", + "alert.center.content": "告警内容", + "alert.center.status": "状态", + "alert.center.time": "告警时间", + "alert.center.notify.no-delete": "未选中任何待删除项!", + "alert.center.confirm.delete": "请确认是否删除!", + "alert.center.confirm.delete-batch": "请确认是否批量删除!", + "alert.center.notify.no-mark": "未选中任何待标记项!", + "alert.center.confirm.mark-done-batch": "请确认是否批量标记已处理!", + "alert.center.confirm.mark-done": "请确认是否标记已处理!", + "alert.center.confirm.mark-no-batch": "请确认是否批量标记未处理!", + "alert.center.confirm.mark-no": "请确认是否标记未处理!", "dashboard.alerts.title": "最近告警列表", "dashboard.alerts.enter": "进入告警中心", "dashboard.alerts.distribute": "告警分布", @@ -151,6 +173,7 @@ "common.edit-time": "更新时间", "common.new-time": "创建时间", "common.edit": "操作", + "common.total": "总量", "common.notify.no-select-edit": "未选中任何待编辑项!", "common.notify.one-select-edit": "只能对一个选中项进行编辑!", "common.confirm.delete": "请确认是否删除!", @@ -158,6 +181,8 @@ "common.confirm.delete-batch": "请确认是否批量删除!", "common.notify.delete-success": "删除成功!", "common.notify.delete-fail": "删除失败!", + "common.notify.mark-success": "标记成功!", + "common.notify.mark-fail": "标记失败!", "common.notify.no-select-cancel": "未选中任何待取消项!", "common.confirm.cancel-batch": "请确认是否批量取消监控!", "common.confirm.cancel": "请确认是否取消监控!",