From f58424fa825153ba938f4bf8b1ed3144263e6645 Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Sat, 3 Sep 2022 09:24:40 +0800 Subject: [PATCH 1/2] [web-app] update layout ui --- .../app/{app-ssl.yml => app-ssl_cert.yml} | 0 .../{param-ssl.yml => param-ssl_cert.yml} | 0 .../src/app/layout/basic/basic.component.ts | 2 +- .../layout/passport/passport.component.html | 2 +- .../alert-center/alert-center.component.html | 2 +- .../alert-center/alert-center.component.ts | 18 +-------- .../alert-notice/alert-notice.component.html | 37 ++++++++++--------- .../alert-setting.component.html | 24 ++++++------ .../monitor-list/monitor-list.component.html | 3 +- .../monitor-list/monitor-list.component.ts | 5 +++ .../routes/setting/tags/tags.component.html | 2 +- web-app/src/assets/i18n/en-US.json | 1 + web-app/src/assets/i18n/zh-CN.json | 1 + web-app/src/assets/i18n/zh-TW.json | 1 + web-app/src/styles/theme.less | 12 ++++-- 15 files changed, 58 insertions(+), 52 deletions(-) rename manager/src/main/resources/define/app/{app-ssl.yml => app-ssl_cert.yml} (100%) rename manager/src/main/resources/define/param/{param-ssl.yml => param-ssl_cert.yml} (100%) diff --git a/manager/src/main/resources/define/app/app-ssl.yml b/manager/src/main/resources/define/app/app-ssl_cert.yml similarity index 100% rename from manager/src/main/resources/define/app/app-ssl.yml rename to manager/src/main/resources/define/app/app-ssl_cert.yml diff --git a/manager/src/main/resources/define/param/param-ssl.yml b/manager/src/main/resources/define/param/param-ssl_cert.yml similarity index 100% rename from manager/src/main/resources/define/param/param-ssl.yml rename to manager/src/main/resources/define/param/param-ssl_cert.yml diff --git a/web-app/src/app/layout/basic/basic.component.ts b/web-app/src/app/layout/basic/basic.component.ts index b6cef56df41..0d6519da258 100644 --- a/web-app/src/app/layout/basic/basic.component.ts +++ b/web-app/src/app/layout/basic/basic.component.ts @@ -78,7 +78,7 @@ import { CONSTS } from 'src/app/shared/consts'; HertzBeat {{ version }}
Copyright 2022 - https://www.hertzbeat.com + hertzbeat.com
Licensed under the Apache License, Version 2.0 diff --git a/web-app/src/app/layout/passport/passport.component.html b/web-app/src/app/layout/passport/passport.component.html index 37fcc6701d0..eabd014de93 100644 --- a/web-app/src/app/layout/passport/passport.component.html +++ b/web-app/src/app/layout/passport/passport.component.html @@ -15,7 +15,7 @@ Copyright 2022 - https://www.hertzbeat.com + hertzbeat.com
Licensed under the Apache License, Version 2.0 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 ab2afcdfa91..c1c1ae0b428 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 @@ -13,7 +13,7 @@ -
+
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 efcaa36687a..47ed765bcce 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 @@ -141,27 +141,13 @@ export class AlertCenterComponent implements OnInit { onMarkReadOneAlert(alertId: number) { let alerts = new Set(); alerts.add(alertId); - this.modal.confirm({ - 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) - }); + this.updateAlertsStatus(alerts, 3); } onMarkUnReadOneAlert(alertId: number) { let alerts = new Set(); alerts.add(alertId); - this.modal.confirm({ - 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) - }); + this.updateAlertsStatus(alerts, 0); } deleteAlerts(alertIds: Set) { diff --git a/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html b/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html index 5b6cfa9c93a..51b13ec5acb 100644 --- a/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html +++ b/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html @@ -19,16 +19,17 @@ - - - +
+ + +
- +
+ - + +
- - - +
+ + + +
-
+
@@ -124,6 +124,7 @@ [cdkCopyToClipboard]="data.host" nz-tooltip [nzTooltipTitle]="'common.copy' | i18n" + (click)="notifyCopySuccess()" > {{ data.host }} diff --git a/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.ts b/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.ts index 432a2798e4b..db1322ae012 100644 --- a/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.ts +++ b/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.ts @@ -23,6 +23,7 @@ export class MonitorListComponent implements OnInit { private notifySvc: NzNotificationService, private msg: NzMessageService, private monitorSvc: MonitorService, + private messageSvc: NzMessageService, @Inject(ALAIN_I18N_TOKEN) private i18nSvc: I18NService ) {} @@ -297,6 +298,10 @@ export class MonitorListComponent implements OnInit { } // end: 列表多选逻辑 + notifyCopySuccess() { + this.messageSvc.success(this.i18nSvc.fanyi('common.notify.copy-success'), { nzDuration: 800 }); + } + /** * 分页回调 * diff --git a/web-app/src/app/routes/setting/tags/tags.component.html b/web-app/src/app/routes/setting/tags/tags.component.html index 8f839a9adef..eed3a6f8ec0 100644 --- a/web-app/src/app/routes/setting/tags/tags.component.html +++ b/web-app/src/app/routes/setting/tags/tags.component.html @@ -17,7 +17,7 @@ -
+
diff --git a/web-app/src/assets/i18n/en-US.json b/web-app/src/assets/i18n/en-US.json index 2c70be7d125..b5a3d4a93ef 100644 --- a/web-app/src/assets/i18n/en-US.json +++ b/web-app/src/assets/i18n/en-US.json @@ -277,6 +277,7 @@ "common.notify.enable-fail": "Enable Failed!", "common.confirm.clear-cache": "Please confirm whether to clear cache!", "common.notify.clear-success": "Clear Success!", + "common.notify.copy-success": "Copy Success!", "common.button.ok": "OK", "common.button.cancel": "Cancel", "common.button.help": "Help", diff --git a/web-app/src/assets/i18n/zh-CN.json b/web-app/src/assets/i18n/zh-CN.json index e82710d9c07..33c9879b1fc 100644 --- a/web-app/src/assets/i18n/zh-CN.json +++ b/web-app/src/assets/i18n/zh-CN.json @@ -277,6 +277,7 @@ "common.notify.enable-fail": "启用监控失败!", "common.confirm.clear-cache": "请确认是否清理缓存!", "common.notify.clear-success": "清理成功!", + "common.notify.copy-success": "复制成功!", "common.button.ok": "确定", "common.button.detect": "测试", "common.button.cancel": "取消", diff --git a/web-app/src/assets/i18n/zh-TW.json b/web-app/src/assets/i18n/zh-TW.json index 3d297dfded9..a0c2d9e8a1e 100644 --- a/web-app/src/assets/i18n/zh-TW.json +++ b/web-app/src/assets/i18n/zh-TW.json @@ -277,6 +277,7 @@ "common.notify.enable-fail": "啓用監控失敗!", "common.confirm.clear-cache": "請確認是否清理緩存!", "common.notify.clear-success": "清理成功!", + "common.notify.copy-success": "複製成功!", "common.button.ok": "確定", "common.button.detect": "測試", "common.button.cancel": "取消", diff --git a/web-app/src/styles/theme.less b/web-app/src/styles/theme.less index c271e109748..c1116a1e285 100644 --- a/web-app/src/styles/theme.less +++ b/web-app/src/styles/theme.less @@ -8,18 +8,24 @@ // The theme parameters can be generated at https://ng-alain.github.io/ng-alain/ // @primary-color: #f50; @primary-color: #3f51b5; -@font-size-base: 12px; -@nz-table-rep-padding-vertical: 2px; -@nz-table-rep-padding-horizontal: 2px; +@font-size-base: 14px; +@nz-table-rep-padding-vertical: 3px; +@nz-table-rep-padding-horizontal: 3px; @alain-default-header-hg: 52px; @alain-default-header-bg: #3f51b5; @alain-default-header-padding: 8px; @alain-default-aside-nav-text-hover-color: #3f51b5; @alain-default-aside-nav-selected-text-color: #3f51b5; +@scrollbar-table-enabled: true; + .ant-switch-checked{ background-color: #ff4081; } +.ant-btn { + border-radius: 4px; +} + .ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) { color: #fff; background: #ff4081; From 2d89e805e9dc07f8ade0fb793cb6a6c761438b49 Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Sat, 3 Sep 2022 13:45:00 +0800 Subject: [PATCH 2/2] [web-app] update layout ui - help button, nav menu --- web-app/src/app/core/startup/startup.service.ts | 4 ++-- web-app/src/app/layout/basic/basic.component.ts | 5 ++++- .../alert/alert-notice/alert-notice.component.html | 6 ++++-- .../alert-setting/alert-setting.component.html | 6 ++++-- .../app/routes/dashboard/dashboard.component.html | 12 ++++++------ .../src/app/routes/dashboard/dashboard.component.ts | 9 +++++++++ .../monitor-detail/monitor-detail.component.html | 13 +++++++++---- .../monitor-edit/monitor-edit.component.html | 12 +++++++++--- .../monitor-list/monitor-list.component.html | 11 ++++++++++- .../monitor/monitor-new/monitor-new.component.html | 12 +++++++++--- .../src/app/routes/setting/tags/tags.component.html | 6 ++++-- web-app/src/styles/theme.less | 2 +- 12 files changed, 71 insertions(+), 27 deletions(-) diff --git a/web-app/src/app/core/startup/startup.service.ts b/web-app/src/app/core/startup/startup.service.ts index 5ef15a7fcf9..a9d4351eb30 100644 --- a/web-app/src/app/core/startup/startup.service.ts +++ b/web-app/src/app/core/startup/startup.service.ts @@ -54,8 +54,8 @@ export class StartupService { // Application data // Application information: including site name, description, year this.settingService.setApp(appData.app); - // User information: including name, avatar, email address - // this.settingService.setUser(appData.user); + // https://ng-alain.com/theme/settings/zh + this.settingService.setLayout('collapsed', true); // ACL: Set the permissions to full, https://ng-alain.com/acl/getting-started this.aclService.setFull(true); // Menu data, https://ng-alain.com/theme/menu diff --git a/web-app/src/app/layout/basic/basic.component.ts b/web-app/src/app/layout/basic/basic.component.ts index 0d6519da258..90db80fa055 100644 --- a/web-app/src/app/layout/basic/basic.component.ts +++ b/web-app/src/app/layout/basic/basic.component.ts @@ -7,7 +7,7 @@ import { CONSTS } from 'src/app/shared/consts'; @Component({ selector: 'layout-basic', template: ` - + @@ -69,6 +69,9 @@ import { CONSTS } from 'src/app/shared/consts';
+ + + diff --git a/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html b/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html index 51b13ec5acb..1b8c704b772 100644 --- a/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html +++ b/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html @@ -10,8 +10,10 @@ {{ 'menu.alert.dispatch' | i18n }} - {{ 'common.button.help' | i18n }}  - + diff --git a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html index 5ee9e0f3e39..9a24116d6eb 100644 --- a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html +++ b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html @@ -10,8 +10,10 @@ {{ 'menu.alert.setting' | i18n }} - {{ 'common.button.help' | i18n }}  - + diff --git a/web-app/src/app/routes/dashboard/dashboard.component.html b/web-app/src/app/routes/dashboard/dashboard.component.html index 54f800ab199..ff298fc453f 100644 --- a/web-app/src/app/routes/dashboard/dashboard.component.html +++ b/web-app/src/app/routes/dashboard/dashboard.component.html @@ -79,26 +79,26 @@
-
{{ appCountCustom.size }}
+
{{ appCountMid.size }}

- {{ 'monitor.category.custom' | i18n }} + {{ 'monitor.category.mid' | i18n }}

- {{ 'monitor.status.available' | i18n }} {{ appCountCustom.availableSize }} + {{ 'monitor.status.available' | i18n }} {{ appCountMid.availableSize }} {{ 'monitor.status.unavailable' | i18n }} {{ appCountCustom.unAvailableSize }} + >{{ appCountMid.unAvailableSize }} {{ 'monitor.status.unreachable' | i18n }} {{ appCountCustom.unReachableSize }} + >{{ appCountMid.unReachableSize }} - {{ 'monitor.status.un-manage' | i18n }} {{ appCountCustom.unManageSize }} + {{ 'monitor.status.un-manage' | i18n }} {{ appCountMid.unManageSize }}
diff --git a/web-app/src/app/routes/dashboard/dashboard.component.ts b/web-app/src/app/routes/dashboard/dashboard.component.ts index 73b45883fe2..7c354623baf 100644 --- a/web-app/src/app/routes/dashboard/dashboard.component.ts +++ b/web-app/src/app/routes/dashboard/dashboard.component.ts @@ -31,6 +31,7 @@ export class DashboardComponent implements OnInit, OnDestroy { appCountService: AppCount = new AppCount(); appCountOs: AppCount = new AppCount(); appCountDb: AppCount = new AppCount(); + appCountMid: AppCount = new AppCount(); appCountCustom: AppCount = new AppCount(); // start 数量全局概览 @@ -228,6 +229,7 @@ export class DashboardComponent implements OnInit, OnDestroy { this.appCountService = new AppCount(); this.appCountOs = new AppCount(); this.appCountDb = new AppCount(); + this.appCountMid = new AppCount(); this.appCountCustom = new AppCount(); let dashboard$ = this.monitorSvc.getAppsMonitorSummary().subscribe( message => { @@ -269,6 +271,13 @@ export class DashboardComponent implements OnInit, OnDestroy { this.appCountOs.unManageSize += app.unManageSize; this.appCountOs.unReachableSize += app.unReachableSize; break; + case 'mid': + this.appCountMid.size += app.size; + this.appCountMid.availableSize += app.availableSize; + this.appCountMid.unAvailableSize += app.unAvailableSize; + this.appCountMid.unManageSize += app.unManageSize; + this.appCountMid.unReachableSize += app.unReachableSize; + break; case 'custom': this.appCountCustom.size += app.size; this.appCountCustom.availableSize += app.availableSize; diff --git a/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.html b/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.html index 0ed8fef3186..ca134f5dee8 100644 --- a/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.html +++ b/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.html @@ -13,11 +13,16 @@ - - {{ 'monitor.app.' + app | i18n }} {{ 'monitors.detail' | i18n }} + + {{ 'monitors.detail' | i18n }} + + {{ 'monitor.app.' + app | i18n }} + - {{ 'common.button.help' | i18n }} - + diff --git a/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html b/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html index 2c34e77b5a8..1128e08966f 100644 --- a/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html +++ b/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html @@ -14,10 +14,16 @@ - {{ 'monitors.edit' | i18n }} {{ 'monitor.app.' + monitor.app | i18n }} {{ 'monitor' | i18n }} + {{ 'monitors.edit' | i18n }} + + {{ 'monitor.app.' + monitor.app | i18n }} + + {{ 'monitor' | i18n }} - {{ 'common.button.help' | i18n }} - + 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 a4b7ea7854a..6a5183ab14f 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 @@ -8,7 +8,16 @@ - {{ 'monitor.app.' + app | i18n }} {{ 'monitors.list' | i18n }} + {{ 'monitors.list' | i18n }} + + {{ 'monitor.app.' + app | i18n }} + + + + diff --git a/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html b/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html index 8830234c119..bbe027fc4c2 100644 --- a/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html +++ b/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html @@ -14,10 +14,16 @@ - {{ 'monitors.new' | i18n }} {{ 'monitor.app.' + monitor.app | i18n }} {{ 'monitor' | i18n }} + {{ 'monitors.new' | i18n }} + + {{ 'monitor.app.' + monitor.app | i18n }} + + {{ 'monitor' | i18n }} - {{ 'common.button.help' | i18n }} - + diff --git a/web-app/src/app/routes/setting/tags/tags.component.html b/web-app/src/app/routes/setting/tags/tags.component.html index eed3a6f8ec0..fd3cbb1c360 100644 --- a/web-app/src/app/routes/setting/tags/tags.component.html +++ b/web-app/src/app/routes/setting/tags/tags.component.html @@ -10,8 +10,10 @@ {{ 'menu.extras.tags' | i18n }} - {{ 'common.button.help' | i18n }}  - + diff --git a/web-app/src/styles/theme.less b/web-app/src/styles/theme.less index c1116a1e285..593a92fd375 100644 --- a/web-app/src/styles/theme.less +++ b/web-app/src/styles/theme.less @@ -16,7 +16,7 @@ @alain-default-header-padding: 8px; @alain-default-aside-nav-text-hover-color: #3f51b5; @alain-default-aside-nav-selected-text-color: #3f51b5; -@scrollbar-table-enabled: true; +//@scrollbar-table-enabled: true; .ant-switch-checked{ background-color: #ff4081;