[webapp, docs]support en readme and webapp (#83)
* [docs]support en docs * [docs]support en webapp * [web-app]dashboard and monitor list i18n * [web-app]i18n for monitor list * [web-app]i18n for add edit monitor * [web-app]i18n for monitor detail * [web-app]i18n for login * [web-app]i18n for alert center * [web-app]i18n for alert notice * [web-app]i18n for alert setting * [web-app]i18n for notify
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { ChangeDetectionStrategy, Component, HostListener } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, HostListener, Inject } from '@angular/core';
|
||||
import { I18NService } from '@core';
|
||||
import { ALAIN_I18N_TOKEN } from '@delon/theme';
|
||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
|
||||
@@ -14,15 +16,19 @@ import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class HeaderClearStorageComponent {
|
||||
constructor(private modalSrv: NzModalService, private messageSrv: NzMessageService) {}
|
||||
constructor(
|
||||
private modalSrv: NzModalService,
|
||||
private messageSrv: NzMessageService,
|
||||
@Inject(ALAIN_I18N_TOKEN) private i18nSvc: I18NService
|
||||
) {}
|
||||
|
||||
@HostListener('click')
|
||||
_click(): void {
|
||||
this.modalSrv.confirm({
|
||||
nzTitle: '请确认是否清理缓存?',
|
||||
nzTitle: this.i18nSvc.fanyi('common.confirm.clear-cache'),
|
||||
nzOnOk: () => {
|
||||
localStorage.clear();
|
||||
this.messageSrv.success('清理成功!');
|
||||
this.messageSrv.success(this.i18nSvc.fanyi('common.notify.clear-success'));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -26,11 +26,11 @@ import { AlertService } from '../../../service/alert.service';
|
||||
export class HeaderNotifyComponent implements OnInit {
|
||||
data: NoticeItem[] = [
|
||||
{
|
||||
title: '近期未处理告警',
|
||||
title: this.i18nSvc.fanyi('dashboard.alerts.title-no'),
|
||||
list: [],
|
||||
emptyText: '暂无未处理告警',
|
||||
emptyText: this.i18nSvc.fanyi('dashboard.alerts.no'),
|
||||
emptyImage: 'https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg',
|
||||
clearText: '进入告警中心'
|
||||
clearText: this.i18nSvc.fanyi('dashboard.alerts.enter')
|
||||
}
|
||||
];
|
||||
count = 0;
|
||||
@@ -69,10 +69,10 @@ export class HeaderNotifyComponent implements OnInit {
|
||||
let item = {
|
||||
id: alert.id,
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
|
||||
title: `监控-${alert.monitorName}-发出${this.i18nSvc.fanyi(`alert.priority.${alert.priority}`)}`,
|
||||
title: `${alert.monitorName}--${this.i18nSvc.fanyi(`alert.priority.${alert.priority}`)}`,
|
||||
datetime: alert.gmtCreate,
|
||||
color: 'blue',
|
||||
type: '近期未处理告警'
|
||||
type: this.i18nSvc.fanyi('dashboard.alerts.title-no')
|
||||
};
|
||||
this.data[0].list.push(item);
|
||||
});
|
||||
|
||||
@@ -40,8 +40,8 @@ import { MonitorService } from '../../../service/monitor.service';
|
||||
<nz-autocomplete nzBackfill="false" nzDefaultActiveFirstOption #auto>
|
||||
<nz-auto-option *ngFor="let option of options" [nzValue]="option.id" [nzLabel]="option.name">
|
||||
<a [routerLink]="['/monitors/' + option.id]">
|
||||
监控名称: {{ option.name }}
|
||||
<span style="left:50% ; position: absolute;">监控Host: {{ option.host }}</span>
|
||||
{{ 'monitor.name' | i18n }} : {{ option.name }}
|
||||
<span style="left:50% ; position: absolute;">{{ 'monitor.host' | i18n }} : {{ option.host }}</span>
|
||||
<span style="right: 10px; position: absolute;"><i nz-icon nzType="arrow-right" nzTheme="outline"></i></span>
|
||||
</a>
|
||||
</nz-auto-option>
|
||||
|
||||
Reference in New Issue
Block a user