[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:
@@ -71,9 +71,9 @@ import { environment } from '@env/environment';
|
||||
<setting-drawer *ngIf="showSettingDrawer"></setting-drawer>
|
||||
<theme-btn
|
||||
[types]="[
|
||||
{ key: 'default', text: '浅色主题' },
|
||||
{ key: 'dark', text: '深色主题' },
|
||||
{ key: 'compact', text: '紧凑主题' }
|
||||
{ key: 'default', text: 'app.theme.default' | i18n },
|
||||
{ key: 'dark', text: 'app.theme.dark' | i18n },
|
||||
{ key: 'compact', text: 'app.theme.compact' | i18n }
|
||||
]"
|
||||
></theme-btn>
|
||||
`
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
<img class="logo" src="./assets/logo.svg" alt="" />
|
||||
<span class="title">HertzBeat</span>
|
||||
</div>
|
||||
<div class="desc">TanCloud-易用友好的高性能监控云服务</div>
|
||||
<div class="desc">{{ 'app.passport.desc' | i18n }}</div>
|
||||
</div>
|
||||
<router-outlet></router-outlet>
|
||||
<global-footer [links]="links">
|
||||
Copyright
|
||||
<i nz-icon nzType="copyright" nzTheme="outline"></i>
|
||||
2022
|
||||
<a href="https://tancloud.cn" target="_blank">探云 tancloud.cn | </a>
|
||||
<a href="https://hertzbeat.com" target="_blank">赫兹跳动 hertzbeat.com</a>
|
||||
<a href="https://tancloud.cn" target="_blank">TanCloud tancloud.cn | </a>
|
||||
<a href="https://hertzbeat.com" target="_blank">HertzBeat hertzbeat.com</a>
|
||||
</global-footer>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { I18NService } from '@core';
|
||||
import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth';
|
||||
import { ALAIN_I18N_TOKEN } from '@delon/theme';
|
||||
|
||||
@Component({
|
||||
selector: 'layout-passport',
|
||||
@@ -9,12 +11,12 @@ import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth';
|
||||
export class LayoutPassportComponent implements OnInit {
|
||||
links = [
|
||||
{
|
||||
title: '欢迎使用TanCloud探云-监控云服务-tancloud.cn',
|
||||
title: this.i18nSvc.fanyi('app.passport.welcome'),
|
||||
href: 'https://tancloud.cn'
|
||||
}
|
||||
];
|
||||
|
||||
constructor(@Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService) {}
|
||||
constructor(@Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService, @Inject(ALAIN_I18N_TOKEN) private i18nSvc: I18NService) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.tokenService.clear();
|
||||
|
||||
Reference in New Issue
Block a user