Skip to content

Commit

Permalink
[web-app] fix redirect when monitors app is null (apache#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsun28 authored Sep 11, 2022
1 parent a277f35 commit 61496e8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions manager/src/main/resources/define/app/app-A-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 19,8 @@ category: custom
# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws...
app: example
name:
zh-CN: 模拟应用1
en-US: EXAMPLE1
zh-CN: 模拟应用
en-US: EXAMPLE APP
# 参数映射map. type是参数类型: 0-number数字, 1-string明文字符串, 2-secret加密字符串, 3-map映射的json串
# 强制固定必须参数 - host
configmap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 41,9 @@ export class MonitorListComponent implements OnInit {
ngOnInit(): void {
this.route.queryParamMap.subscribe(paramMap => {
this.app = paramMap.get('app') || '';
if (this.app == '') {
this.router.navigateByUrl('/monitors?app=website');
}
this.pageIndex = 1;
this.pageSize = 8;
this.checkedMonitorIds = new Set<number>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 50,9 @@ export class MonitorNewComponent implements OnInit {
.pipe(
switchMap((paramMap: ParamMap) => {
this.monitor.app = paramMap.get('app') || '';
if (this.monitor.app == '') {
this.router.navigateByUrl('/monitors/new?app=website');
}
this.titleSvc.setTitleByI18n(`monitor.app.${this.monitor.app}`);
this.detected = true;
this.passwordVisible = false;
Expand Down
1 change: 1 addition & 0 deletions web-app/src/app/routes/routes.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 1,5 @@
import { NgModule, Type } from '@angular/core';
// eslint-disable-next-line import/order
import { SharedModule } from '@shared';

// dashboard pages
Expand Down

0 comments on commit 61496e8

Please sign in to comment.