From f685298741b4cb92438d54742d1e0c19fcb2e4be Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Sun, 10 Apr 2022 22:14:20 +0800 Subject: [PATCH] [web-app]dashboard and monitor list i18n --- .../routes/dashboard/dashboard.component.html | 42 ++++----- .../routes/dashboard/dashboard.component.ts | 28 +++--- .../monitor-list/monitor-list.component.html | 86 +++++++++++-------- web-app/src/assets/i18n/en-US.json | 48 +++++++++-- web-app/src/assets/i18n/zh-CN.json | 40 ++++++++- 5 files changed, 162 insertions(+), 82 deletions(-) diff --git a/web-app/src/app/routes/dashboard/dashboard.component.html b/web-app/src/app/routes/dashboard/dashboard.component.html index 5f9f41b..722c568 100644 --- a/web-app/src/app/routes/dashboard/dashboard.component.html +++ b/web-app/src/app/routes/dashboard/dashboard.component.html @@ -10,19 +10,19 @@
- {{ 'dashboard.status.available' | i18n }} {{ 'monitor.status.available' | i18n }} {{ appCountService.availableSize }} - {{ 'dashboard.status.unavailable' | i18n }} {{ 'monitor.status.unavailable' | i18n }} {{ appCountService.unAvailableSize }} - {{ 'dashboard.status.unreachable' | i18n }} {{ 'monitor.status.unreachable' | i18n }} {{ appCountService.unReachableSize }} - {{ 'dashboard.status.un-manage' | i18n }} {{ appCountService.unManageSize }} + {{ 'monitor.status.un-manage' | i18n }} {{ appCountService.unManageSize }}
@@ -38,16 +38,16 @@
- 正常 {{ appCountDb.availableSize }} + {{ 'monitor.status.available' | i18n }} {{ appCountDb.availableSize }} - 不可用 {{ appCountDb.unAvailableSize }} + {{ 'monitor.status.unavailable' | i18n }} {{ appCountDb.unAvailableSize }} - 不可达 {{ appCountDb.unReachableSize }} + {{ 'monitor.status.unreachable' | i18n }} {{ appCountDb.unReachableSize }} - 未监控 {{ appCountDb.unManageSize }} + {{ 'monitor.status.un-manage' | i18n }} {{ appCountDb.unManageSize }}
@@ -63,16 +63,16 @@
- 正常 {{ appCountOs.availableSize }} + {{ 'monitor.status.available' | i18n }} {{ appCountOs.availableSize }} - 不可用 {{ appCountOs.unAvailableSize }} + {{ 'monitor.status.unavailable' | i18n }} {{ appCountOs.unAvailableSize }} - 不可达 {{ appCountOs.unReachableSize }} + {{ 'monitor.status.unreachable' | i18n }} {{ appCountOs.unReachableSize }} - 未监控 {{ appCountOs.unManageSize }} + {{ 'monitor.status.un-manage' | i18n }} {{ appCountOs.unManageSize }}
@@ -88,16 +88,16 @@
- 正常 {{ appCountCustom.availableSize }} + {{ 'monitor.status.available' | i18n }} {{ appCountCustom.availableSize }} - 不可用 {{ appCountCustom.unAvailableSize }} + {{ 'monitor.status.unavailable' | i18n }} {{ appCountCustom.unAvailableSize }} - 不可达 {{ appCountCustom.unReachableSize }} + {{ 'monitor.status.unreachable' | i18n }} {{ appCountCustom.unReachableSize }} - 未监控 {{ appCountCustom.unManageSize }} + {{ 'monitor.status.un-manage' | i18n }} {{ appCountCustom.unManageSize }}
@@ -117,21 +117,21 @@
- +

- 紧急告警 + {{ 'alert.priority.0' | i18n }} - 严重告警 + {{ 'alert.priority.1' | i18n }} - 警告告警 + {{ 'alert.priority.2' | i18n }} [{{ alert.monitorName }}] {{ alert.content }} @@ -165,5 +165,5 @@

- 进入告警中心 + {{ 'dashboard.alerts.enter' | i18n }} diff --git a/web-app/src/app/routes/dashboard/dashboard.component.ts b/web-app/src/app/routes/dashboard/dashboard.component.ts index 626821b..c8c9be8 100644 --- a/web-app/src/app/routes/dashboard/dashboard.component.ts +++ b/web-app/src/app/routes/dashboard/dashboard.component.ts @@ -48,13 +48,13 @@ export class DashboardComponent implements OnInit, OnDestroy { ngOnInit(): void { this.appsCountTheme = { title: { - text: '监控总览', - subtext: '监控类型纳管数量分布', + text: this.i18nSvc.fanyi('dashboard.monitors.title'), + subtext: this.i18nSvc.fanyi('dashboard.monitors.sub-title'), left: 'center' }, tooltip: { trigger: 'item', - formatter: '{a}
{b} : {c}个监控 占比({d}%)' + formatter: `{a}
{b} : {c}${this.i18nSvc.fanyi('dashboard.monitors.formatter')}({d}%)` }, legend: { show: false, @@ -66,7 +66,7 @@ export class DashboardComponent implements OnInit, OnDestroy { calculable: true, series: [ { - name: '总量', + name: this.i18nSvc.fanyi('dashboard.monitors.total'), type: 'pie', selectedMode: 'single', color: '#722ED1', @@ -81,10 +81,10 @@ export class DashboardComponent implements OnInit, OnDestroy { labelLine: { show: false }, - data: [{ value: 0, name: '监控总量' }] + data: [{ value: 0, name: this.i18nSvc.fanyi('dashboard.monitors.total') }] }, { - name: '纳管数量分布', + name: this.i18nSvc.fanyi('dashboard.monitors.distribute'), type: 'pie', radius: ['45%', '65%'], labelLine: { @@ -127,7 +127,7 @@ export class DashboardComponent implements OnInit, OnDestroy { }; this.alertsTheme = { title: { - subtext: '告警分布', + subtext: this.i18nSvc.fanyi('dashboard.alerts.distribute'), left: 'center' }, tooltip: { @@ -138,14 +138,14 @@ export class DashboardComponent implements OnInit, OnDestroy { }, xAxis: { type: 'category', - data: ['警告告警', '严重告警', '紧急告警'] + data: [this.i18nSvc.fanyi('alert.priority.2'), this.i18nSvc.fanyi('alert.priority.1'), this.i18nSvc.fanyi('alert.priority.0')] }, yAxis: { type: 'value' }, series: [ { - name: '告警数量', + name: this.i18nSvc.fanyi('dashboard.alerts.num'), type: 'bar', data: [ { @@ -176,7 +176,7 @@ export class DashboardComponent implements OnInit, OnDestroy { }; this.alertsDealTheme = { title: { - subtext: '告警处理', + subtext: this.i18nSvc.fanyi('dashboard.alerts.deal'), left: 'center' }, tooltip: { @@ -184,7 +184,7 @@ export class DashboardComponent implements OnInit, OnDestroy { }, series: [ { - name: '告警处理率', + name: this.i18nSvc.fanyi('dashboard.alerts.deal-percent'), type: 'gauge', progress: { show: true @@ -196,7 +196,7 @@ export class DashboardComponent implements OnInit, OnDestroy { data: [ { value: 100, - name: '告警处理率' + name: this.i18nSvc.fanyi('dashboard.alerts.deal-percent') } ] } @@ -279,7 +279,7 @@ export class DashboardComponent implements OnInit, OnDestroy { } }); // @ts-ignore - this.appsCountTheme.series[0].data = [{ value: total, name: '监控总量' }]; + this.appsCountTheme.series[0].data = [{ value: total, name: this.i18nSvc.fanyi('dashboard.monitors.total') }]; // @ts-ignore this.appsCountTheme.series[1].data = this.appsCountTableData; this.appsCountEChartOption = this.appsCountTheme; @@ -397,7 +397,7 @@ export class DashboardComponent implements OnInit, OnDestroy { this.alertsDealTheme.series[0].data = [ { value: summary.rate, - name: '告警处理率' + name: this.i18nSvc.fanyi('dashboard.alerts.deal-percent') } ]; this.alertsEChartOption = this.alertsTheme; 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 74dd314..b89485b 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 @@ -3,12 +3,12 @@ - 仪表盘 + {{ 'menu.dashboard' | i18n }} - {{ 'monitor.app.' + app | i18n }} 监控列表 + {{ 'monitor.app.' + app | i18n }} {{ 'monitors.list' | i18n }} @@ -17,35 +17,37 @@ - - + - - - - - + + + + +
@@ -82,12 +84,12 @@ - 监控名称 - 监控状态 - 监控Host - 监控类型 - 最新修改时间 - 操作 + {{ 'monitor.name' | i18n }} + {{ 'monitor.status' | i18n }} + {{ 'monitor.host' | i18n }} + {{ 'monitor.app' | i18n }} + {{ 'common.edit-time' | i18n }} + {{ 'common.edit' | i18n }} @@ -101,23 +103,19 @@ - 未监控 + {{ 'monitor.status.un-manage' | i18n }} - 正常监控 + {{ 'monitor.status.available' | i18n }} - 监控不可用 + {{ 'monitor.status.unavailable' | i18n }} - 监控不可达 - - - - 监控已挂起 + {{ 'monitor.status.unreachable' | i18n }} {{ data.host }} @@ -129,16 +127,34 @@ {{ (data.gmtUpdate ? data.gmtUpdate : data.gmtCreate) | date: 'YYYY-MM-dd HH:mm:ss' }} - - - - @@ -146,4 +162,4 @@ - 总量 {{ total }} + {{ 'monitors.total' | i18n }} {{ total }} diff --git a/web-app/src/assets/i18n/en-US.json b/web-app/src/assets/i18n/en-US.json index bf1c53d..bb51262 100644 --- a/web-app/src/assets/i18n/en-US.json +++ b/web-app/src/assets/i18n/en-US.json @@ -2,7 +2,7 @@ "menu": { "main": "Main", "lang": "Language", - "dashboard": "Dashboard", + "dashboard": "DashBoard", "search.placeholder": "Search:Monitor Name、IP", "fullscreen": "Full Screen", "fullscreen.exit": "Exit", @@ -39,6 +39,8 @@ }, "monitor": { "": "Monitor", + "name": "Monitor Name", + "host": "Monitor Host", "category": { "": "Category", "service": "Service", @@ -58,6 +60,14 @@ "oracle": "Oracle", "redis": "Redis", "fullsite": "SiteMap Monitor" + }, + "status": { + "": "Monitor Status", + "all": "All Status", + "available": "Available", + "unavailable": "UnAvailable", + "unreachable": "UnReachable", + "un-manage": "UnManaged" } }, "alert": { @@ -70,15 +80,37 @@ }, "priority": { "": "Alarm Level", - "0": "Emergency Alert", - "1": "Serious Alert", - "2": "Warning Alert" + "0": "Emergency", + "1": "Critical", + "2": "Warning" } }, - "dashboard.status.available": "Available", - "dashboard.status.unavailable": "Unavailable", - "dashboard.status.unreachable": "Unreachable", - "dashboard.status.un-manage": "UnManaged", + "dashboard.alerts.title": "Recently Alerts List", + "dashboard.alerts.enter": "Go Alert Center", + "dashboard.alerts.distribute": "The Distribution Of Alerts", + "dashboard.alerts.num": "Alerts Num", + "dashboard.alerts.deal": "Alerts Dealing", + "dashboard.alerts.deal-percent": "Dealing Rate", + "dashboard.monitors.total": "Monitor Total", + "dashboard.monitors.title": "Monitoring Overview", + "dashboard.monitors.sub-title": "The Distribution Of Monitors", + "dashboard.monitors.formatter": " Monitors ", + "dashboard.monitors.distribute": "Monitor Distribution", + "monitors.list": "Monitor List", + "monitors.new": "New", + "monitors.edit": "Edit", + "monitors.delete": "Delete", + "monitors.edit-monitor": "Edit Monitor", + "monitors.delete-monitor": "Delete Monitor", + "monitors.enable": "Enable Monitor", + "monitors.cancel": "Cancel Monitor", + "monitors.search.placeholder": "Search Monitor", + "monitors.search.filter": "Filter Monitor Status", + "monitors.total": "Total", + "common.search": "Search", + "common.refresh": "Refresh", + "common.edit-time": "Last Update Time", + "common.edit": "Operate", "app.login.message-need-identifier": "Please enter your email or mobile number", "app.login.message-need-credential": "Please enter password", "app.password.forgot": "Forgot password", diff --git a/web-app/src/assets/i18n/zh-CN.json b/web-app/src/assets/i18n/zh-CN.json index 37603f6..d97c3c8 100644 --- a/web-app/src/assets/i18n/zh-CN.json +++ b/web-app/src/assets/i18n/zh-CN.json @@ -39,6 +39,8 @@ }, "monitor": { "": "监控", + "name": "监控名称", + "host": "监控Host", "category": { "": "监控类别", "service": "应用服务", @@ -58,6 +60,14 @@ "oracle": "Oracle", "redis": "Redis", "fullsite": "全站监控" + }, + "status": { + "": "监控状态", + "all": "全部状态", + "available": "正常监控", + "unavailable": "不可用", + "unreachable": "不可达", + "un-manage": "未管理" } }, "alert": { @@ -75,10 +85,32 @@ "2": "警告告警" } }, - "dashboard.status.available": "正常", - "dashboard.status.unavailable": "不可用", - "dashboard.status.unreachable": "不可达", - "dashboard.status.un-manage": "未管理", + "dashboard.alerts.title": "最近告警列表", + "dashboard.alerts.enter": "进入告警中心", + "dashboard.alerts.distribute": "告警分布", + "dashboard.alerts.num": "告警数量", + "dashboard.alerts.deal": "告警处理", + "dashboard.alerts.deal-percent": "告警处理率", + "dashboard.monitors.total": "监控总量", + "dashboard.monitors.title": "监控总览", + "dashboard.monitors.sub-title": "监控类型纳管数量分布", + "dashboard.monitors.formatter": "个监控 占比", + "dashboard.monitors.distribute": "纳管数量分布", + "monitors.list": "监控列表", + "monitors.new": "新增", + "monitors.edit": "编辑", + "monitors.delete": "删除", + "monitors.edit-monitor": "编辑监控", + "monitors.delete-monitor": "删除监控", + "monitors.enable": "启用监控", + "monitors.cancel": "取消监控", + "monitors.search.placeholder": "搜索监控", + "monitors.search.filter": "监控状态过滤", + "monitors.total": "总量", + "common.search": "搜索", + "common.refresh": "刷新", + "common.edit-time": "最新修改时间", + "common.edit": "操作", "app.lock": "锁屏", "app.passport.desc": "TanCloud-易用友好的高性能监控云服务", "app.passport.welcome": "欢迎使用TanCloud探云-监控云服务-tancloud.cn",