From 7d08d69c95ce18f332cd676d31aa2e7cba072446 Mon Sep 17 00:00:00 2001 From: minwoo Date: Mon, 25 Apr 2022 17:46:23 +0900 Subject: [PATCH] [#8004] Returns whether the system metric menu is exposed. --- metric-module/collector-starter/pom.xml | 4 +- metric-module/metric/pom.xml | 3 +- .../pinpoint/metric/web/MetricWebApp.java | 5 +- .../metric/web/WebMetricPropertySources.java | 34 +++++++ ...pplicationContext-web-pinot-datasource.xml | 4 +- .../local}/jdbc-pinot.properties | 4 +- .../local/pinpoint-web-metric.properties | 1 + .../profiles/release/jdbc-pinot.properties | 4 + .../release/pinpoint-web-metric.properties | 1 + metric-module/pom.xml | 2 +- metric-module/web-starter/pom.xml | 7 +- .../metric-contents-container.component.css | 1 + .../metric-contents-container.component.ts | 1 - ...side-navigation-bar-container.component.ts | 69 ++++++++----- .../side-navigation-item.component.html | 96 ++++++++++--------- .../side-navigation-item.component.ts | 4 + .../src/app/routes/metric-page/index.ts | 2 + .../metric-page/metric-page.component.css | 30 +++++- .../metric-page/metric-page.component.html | 47 +++++---- .../metric-page/metric-page.component.ts | 19 +++- .../system-configuration-data.service.ts | 5 +- .../services/url-route-manager.service.ts | 20 +++- .../services/web-app-setting-data.service.ts | 3 + web/src/main/angular/src/globals.d.ts | 1 + .../pinpoint/web/config/ConfigProperties.java | 8 ++ .../web/controller/ConfigController.java | 2 + 26 files changed, 259 insertions(+), 118 deletions(-) create mode 100644 metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/web/WebMetricPropertySources.java rename metric-module/metric/src/main/resources/pinot-web/{ => profiles/local}/jdbc-pinot.properties (62%) create mode 100644 metric-module/metric/src/main/resources/pinot-web/profiles/local/pinpoint-web-metric.properties create mode 100644 metric-module/metric/src/main/resources/pinot-web/profiles/release/jdbc-pinot.properties create mode 100644 metric-module/metric/src/main/resources/pinot-web/profiles/release/pinpoint-web-metric.properties diff --git a/metric-module/collector-starter/pom.xml b/metric-module/collector-starter/pom.xml index 9ac33d1a8ab3..be88c2323be3 100644 --- a/metric-module/collector-starter/pom.xml +++ b/metric-module/collector-starter/pom.xml @@ -5,7 +5,7 @@ com.navercorp.pinpoint pinpoint-metric-module - 2.4.0-SNAPSHOT + 2.5.0-SNAPSHOT 4.0.0 @@ -17,8 +17,6 @@ 11 ${env.JAVA_11_HOME} true - - ${guava-jdk8.version} ${javax.servlet4.version} ${spring5.version} ${spring.security5.version} diff --git a/metric-module/metric/pom.xml b/metric-module/metric/pom.xml index 25057e92f083..c8997d05e89e 100644 --- a/metric-module/metric/pom.xml +++ b/metric-module/metric/pom.xml @@ -21,7 +21,7 @@ com.navercorp.pinpoint pinpoint-metric-module - 2.4.0-SNAPSHOT + 2.5.0-SNAPSHOT pinpoint-metric @@ -132,7 +132,6 @@ com.zaxxer HikariCP - 4.0.3 org.mybatis diff --git a/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/web/MetricWebApp.java b/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/web/MetricWebApp.java index 9ff7e636224b..871fcc6c3c2e 100644 --- a/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/web/MetricWebApp.java +++ b/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/web/MetricWebApp.java @@ -1,11 +1,12 @@ package com.navercorp.pinpoint.metric.web; +import org.springframework.context.annotation.Import; import org.springframework.context.annotation.ImportResource; import org.springframework.context.annotation.Profile; import org.springframework.context.annotation.PropertySource; -@ImportResource({"classpath:/pinot-web/applicationContext-web-pinot.xml"}) -@PropertySource({"classpath:pinot-web/jdbc-pinot.properties"}) +@ImportResource({"classpath:pinot-web/applicationContext-web-pinot.xml"}) +@Import(WebMetricPropertySources.class) @Profile("metric") public class MetricWebApp { } diff --git a/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/web/WebMetricPropertySources.java b/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/web/WebMetricPropertySources.java new file mode 100644 index 000000000000..5f7f4575b0e8 --- /dev/null +++ b/metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/web/WebMetricPropertySources.java @@ -0,0 +1,34 @@ +/* + * Copyright 2022 NAVER Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.navercorp.pinpoint.metric.web; + +/** + * @author minwoo.jung + */ + +import org.springframework.context.annotation.PropertySource; +import org.springframework.context.annotation.PropertySources; + +@PropertySources({ + @PropertySource(name = "WebMetricPropertySources", value = {WebMetricPropertySources.METRIC}), + @PropertySource(name = "WebMetricPropertySources-pinot", value = {WebMetricPropertySources.PINOT_JDBC}) +}) +public class WebMetricPropertySources { + public static final String METRIC= "classpath:pinot-web/profiles/${pinpoint.profiles.active:release}/pinpoint-web-metric.properties"; + + public static final String PINOT_JDBC= "classpath:pinot-web/profiles/${pinpoint.profiles.active:release}/jdbc-pinot.properties"; +} diff --git a/metric-module/metric/src/main/resources/pinot-web/applicationContext-web-pinot-datasource.xml b/metric-module/metric/src/main/resources/pinot-web/applicationContext-web-pinot-datasource.xml index 20fb6b502430..107b56741184 100644 --- a/metric-module/metric/src/main/resources/pinot-web/applicationContext-web-pinot-datasource.xml +++ b/metric-module/metric/src/main/resources/pinot-web/applicationContext-web-pinot-datasource.xml @@ -5,10 +5,10 @@ - + - diff --git a/metric-module/metric/src/main/resources/pinot-web/jdbc-pinot.properties b/metric-module/metric/src/main/resources/pinot-web/profiles/local/jdbc-pinot.properties similarity index 62% rename from metric-module/metric/src/main/resources/pinot-web/jdbc-pinot.properties rename to metric-module/metric/src/main/resources/pinot-web/profiles/local/jdbc-pinot.properties index a2a0eb6276c1..2eadb55a17cb 100644 --- a/metric-module/metric/src/main/resources/pinot-web/jdbc-pinot.properties +++ b/metric-module/metric/src/main/resources/pinot-web/profiles/local/jdbc-pinot.properties @@ -1,4 +1,4 @@ pinpoint.pinot.jdbc.driverClassName=org.apache.pinot.client.PinotDriver pinpoint.pinot.jdbc.url=jdbc:pinot://localhost:9000 -pinpoint.pinot.jdbc.username=admin -pinpoint.pinot.jdbc.password=admin \ No newline at end of file +pinpoint.pinot.jdbc.username=userId +pinpoint.pinot.jdbc.password=password \ No newline at end of file diff --git a/metric-module/metric/src/main/resources/pinot-web/profiles/local/pinpoint-web-metric.properties b/metric-module/metric/src/main/resources/pinot-web/profiles/local/pinpoint-web-metric.properties new file mode 100644 index 000000000000..57a602b708e8 --- /dev/null +++ b/metric-module/metric/src/main/resources/pinot-web/profiles/local/pinpoint-web-metric.properties @@ -0,0 +1 @@ +config.show.systemMetric=true \ No newline at end of file diff --git a/metric-module/metric/src/main/resources/pinot-web/profiles/release/jdbc-pinot.properties b/metric-module/metric/src/main/resources/pinot-web/profiles/release/jdbc-pinot.properties new file mode 100644 index 000000000000..2eadb55a17cb --- /dev/null +++ b/metric-module/metric/src/main/resources/pinot-web/profiles/release/jdbc-pinot.properties @@ -0,0 +1,4 @@ +pinpoint.pinot.jdbc.driverClassName=org.apache.pinot.client.PinotDriver +pinpoint.pinot.jdbc.url=jdbc:pinot://localhost:9000 +pinpoint.pinot.jdbc.username=userId +pinpoint.pinot.jdbc.password=password \ No newline at end of file diff --git a/metric-module/metric/src/main/resources/pinot-web/profiles/release/pinpoint-web-metric.properties b/metric-module/metric/src/main/resources/pinot-web/profiles/release/pinpoint-web-metric.properties new file mode 100644 index 000000000000..57a602b708e8 --- /dev/null +++ b/metric-module/metric/src/main/resources/pinot-web/profiles/release/pinpoint-web-metric.properties @@ -0,0 +1 @@ +config.show.systemMetric=true \ No newline at end of file diff --git a/metric-module/pom.xml b/metric-module/pom.xml index eebaa9172c12..f3d42236a357 100644 --- a/metric-module/pom.xml +++ b/metric-module/pom.xml @@ -21,7 +21,7 @@ com.navercorp.pinpoint pinpoint - 2.4.0-SNAPSHOT + 2.5.0-SNAPSHOT pinpoint-metric-module diff --git a/metric-module/web-starter/pom.xml b/metric-module/web-starter/pom.xml index bb9dc4939d42..533a4c97008b 100644 --- a/metric-module/web-starter/pom.xml +++ b/metric-module/web-starter/pom.xml @@ -5,7 +5,7 @@ com.navercorp.pinpoint pinpoint-metric-module - 2.4.0-SNAPSHOT + 2.5.0-SNAPSHOT 4.0.0 @@ -17,13 +17,12 @@ ${env.JAVA_11_HOME} java18 - ${guava-jdk8.version} ${javax.servlet4.version} ${spring5.version} ${spring.security5.version} ${log4j2-jdk8.version} - ${project.artifactId}-boot-${project.version} + ${project.artifactId}-boot-${project.version} @@ -47,7 +46,7 @@ target/deploy true false - ${pinpoint.collector.executable.name} + ${pinpoint.web.executable.name} diff --git a/web/src/main/angular/src/app/core/components/metric-contents/metric-contents-container.component.css b/web/src/main/angular/src/app/core/components/metric-contents/metric-contents-container.component.css index c1c6afd5387d..fb4b023bc2ee 100644 --- a/web/src/main/angular/src/app/core/components/metric-contents/metric-contents-container.component.css +++ b/web/src/main/angular/src/app/core/components/metric-contents/metric-contents-container.component.css @@ -2,6 +2,7 @@ display: block; width: 100%; height: 100%; + padding: 15px; } .l-main-contents { diff --git a/web/src/main/angular/src/app/core/components/metric-contents/metric-contents-container.component.ts b/web/src/main/angular/src/app/core/components/metric-contents/metric-contents-container.component.ts index 7db6a91c7812..6e982a9a83d8 100644 --- a/web/src/main/angular/src/app/core/components/metric-contents/metric-contents-container.component.ts +++ b/web/src/main/angular/src/app/core/components/metric-contents/metric-contents-container.component.ts @@ -35,7 +35,6 @@ export class MetricContentsContainerComponent implements OnInit, OnDestroy { ngOnInit() { this.guideMessage$ = this.translateService.get('COMMON.CHART_INTERACTION_GUIDE_MESSAGE'); - // merge( // of(this.webAppSettingDataService.getChartLayoutOption()), // this.messageQueueService.receiveMessage(this.unsubscribe, MESSAGE_TO.SET_CHART_LAYOUT) diff --git a/web/src/main/angular/src/app/core/components/side-navigation-bar/side-navigation-bar-container.component.ts b/web/src/main/angular/src/app/core/components/side-navigation-bar/side-navigation-bar-container.component.ts index e6a480d95f3a..b79cf4637051 100644 --- a/web/src/main/angular/src/app/core/components/side-navigation-bar/side-navigation-bar-container.component.ts +++ b/web/src/main/angular/src/app/core/components/side-navigation-bar/side-navigation-bar-container.component.ts @@ -16,6 +16,7 @@ export interface ISNBItem { disable?: () => boolean; onClick?: (item: ISNBItem) => void; childItems?: ISNBItem[]; + showItem?: boolean; } interface ISNBMeta { @@ -31,7 +32,7 @@ interface ISNBMeta { }) export class SideNavigationBarContainerComponent implements OnInit, OnDestroy { private unsubscribe = new Subject(); - + enableRealTime: boolean; logoPath: string; minimize = false; @@ -39,6 +40,8 @@ export class SideNavigationBarContainerComponent implements OnInit, OnDestroy { userId = ''; meta: ISNBMeta; + showMetric: boolean; + constructor( private cd: ChangeDetectorRef, private windowRefService: WindowRefService, @@ -51,7 +54,10 @@ export class SideNavigationBarContainerComponent implements OnInit, OnDestroy { ngOnInit() { this.minimize = this.webAppSettingDataService.getSideNavBarScale(); - + this.webAppSettingDataService.showMetric().subscribe((showMetric: boolean) => { + this.showMetric = showMetric; + }); + this.webAppSettingDataService.getUserId().subscribe(userId => { this.userId = userId || 'dev'; this.meta = this.generatNavItemMeta(); @@ -83,11 +89,15 @@ export class SideNavigationBarContainerComponent implements OnInit, OnDestroy { onClickInspector(): void { this.urlRouteManagerService.moveByApplicationCondition(UrlPath.INSPECTOR); } - - onClickServermap() { + + onClickServermap(): void { this.urlRouteManagerService.moveByApplicationCondition(UrlPath.MAIN); } + onClickMetric(): void { + this.urlRouteManagerService.moveToMetricPage(); + } + onClickGithubLink() { this.windowRefService.nativeWindow.open('http://github.com/naver/pinpoint'); } @@ -100,30 +110,37 @@ export class SideNavigationBarContainerComponent implements OnInit, OnDestroy { return this.userId; } - - generatNavItemMeta() { + generatNavItemMeta(): ISNBMeta { return { topItems: [ - { - title: 'Servermap', - id: 'servermap', - path: '/main', - iconClass: 'fa fa-network-wired', + { + id: 'servermap', + title: 'Servermap', + path: '/main', + iconClass: 'fa fa-network-wired', onClick: () => this.onClickServermap(), }, - { - id: 'inspector', - title: 'Inspector', - path: '/inspector', - iconClass: 'fas fa-chart-line', + { + id: 'inspector', + title: 'Inspector', + path: '/inspector', + iconClass: 'fas fa-chart-line', onClick: () => this.onClickInspector(), }, + { + id: 'infrastructure', + title: 'Infrastructure', + path: '/metric', + iconClass: 'fas fa-server', + showItem: this.showMetric, + onClick: () => this.onClickMetric(), + } ], bottomItems: [ - { + { id: 'configuration', - title: 'Configuration', - iconClass: 'fas fa-cog', + title: 'Configuration', + iconClass: 'fas fa-cog', childItems: [ { title: 'User Group', id: 'userGroup', path: '/config/userGroup', }, { title: 'Alarm', id: 'alarm', path: '/config/alarm', }, @@ -138,19 +155,19 @@ export class SideNavigationBarContainerComponent implements OnInit, OnDestroy { { title: 'Experimental', id: 'experimental', path: '/config/experimental', }, ], }, - { + { id: 'administration', - title: 'Administration', - iconClass: 'fas fa-user-cog', + title: 'Administration', + iconClass: 'fas fa-user-cog', childItems: [ { title: 'Agent Statistic', id: 'agentStatistic', path: '/config/agentStatistic', onClick: () => ''}, { title: 'Agent management', id: 'agentmanagement', path: '/config/agentManagement', }, ] }, - { + { id: 'user', - title: this.userId, - iconClass: 'fas fa-user-circle', + title: this.userId, + iconClass: 'fas fa-user-circle', childItems: [ { title: 'General', id: 'general', path: '/config/general', }, { title: 'Favorite List', id: 'favoriteList', path: '/config/favorite', }, @@ -160,6 +177,6 @@ export class SideNavigationBarContainerComponent implements OnInit, OnDestroy { ] }, ] - } + }; } } diff --git a/web/src/main/angular/src/app/core/components/side-navigation-bar/side-navigation-item.component.html b/web/src/main/angular/src/app/core/components/side-navigation-bar/side-navigation-item.component.html index 493bc08a012d..af0a9e6ead39 100644 --- a/web/src/main/angular/src/app/core/components/side-navigation-bar/side-navigation-item.component.html +++ b/web/src/main/angular/src/app/core/components/side-navigation-bar/side-navigation-item.component.html @@ -1,53 +1,55 @@ - \ No newline at end of file + diff --git a/web/src/main/angular/src/app/core/components/side-navigation-bar/side-navigation-item.component.ts b/web/src/main/angular/src/app/core/components/side-navigation-bar/side-navigation-item.component.ts index 23bf3ce7477b..59bcd951617c 100644 --- a/web/src/main/angular/src/app/core/components/side-navigation-bar/side-navigation-item.component.ts +++ b/web/src/main/angular/src/app/core/components/side-navigation-bar/side-navigation-item.component.ts @@ -71,4 +71,8 @@ export class SideNavigationItemComponent implements OnInit, AfterViewInit, After item.onClick(item); } } + + showItem({showItem}: ISNBItem): boolean { + return showItem === undefined || showItem === true; + } } diff --git a/web/src/main/angular/src/app/routes/metric-page/index.ts b/web/src/main/angular/src/app/routes/metric-page/index.ts index 5e1eb1696473..d3a1c10bd8b6 100644 --- a/web/src/main/angular/src/app/routes/metric-page/index.ts +++ b/web/src/main/angular/src/app/routes/metric-page/index.ts @@ -10,6 +10,7 @@ import { PeriodSelectorModule } from 'app/core/components/period-selector'; import { HostGroupAndHostListModule } from 'app/core/components/host-group-and-host-list'; import { HostGroupListModule } from 'app/core/components/host-group-list'; import { MetricContentsModule } from 'app/core/components/metric-contents'; +import { SideNavigationBarModule } from 'app/core/components/side-navigation-bar'; @NgModule({ declarations: [ @@ -17,6 +18,7 @@ import { MetricContentsModule } from 'app/core/components/metric-contents'; ], imports: [ SharedModule, + SideNavigationBarModule, NoticeModule, HostGroupListModule, PeriodSelectorModule, diff --git a/web/src/main/angular/src/app/routes/metric-page/metric-page.component.css b/web/src/main/angular/src/app/routes/metric-page/metric-page.component.css index 0c0d511f9261..05e72e867247 100644 --- a/web/src/main/angular/src/app/routes/metric-page/metric-page.component.css +++ b/web/src/main/angular/src/app/routes/metric-page/metric-page.component.css @@ -4,6 +4,15 @@ height: 100%; } +.container { + display: flex; + flex-flow: row wrap; +} + +.container.sideNavigationUI { + flex-flow: unset; +} + .l-widget-group { display: flex; flex-flow: row wrap; @@ -13,6 +22,13 @@ align-items: center; } +.l-widget-group.sideNavigationUI { + height: 50px; + width: 100%; + border-bottom: 1px solid var(--border-primary); + flex: unset; +} + .l-main-container { display: flex; flex-flow: row wrap; @@ -21,11 +37,19 @@ overflow-y: hidden; } +.l-main-container.sideNavigationUI { + height: 100vh; +} + .l-sidemenu-wrap { position: relative; height: 100%; } +.l-sidemenu-wrap.sideNavigationUI { + height: calc(100% - 50px); +} + .l-sidemenu-left { width: 250px; overflow: visible; @@ -42,11 +66,15 @@ width: calc(100% - 250px); /* padding: 20px 15px; */ - padding: 15px; + /* padding: 15px; */ /* max-height: 100%; overflow-y: auto; */ } +.l-main-section.sideNavigationUI { + height: calc(100% - 50px); +} + .fa-question-circle { color: white; font-size: 18px; diff --git a/web/src/main/angular/src/app/routes/metric-page/metric-page.component.html b/web/src/main/angular/src/app/routes/metric-page/metric-page.component.html index 873416d3b544..41b4aa04b372 100644 --- a/web/src/main/angular/src/app/routes/metric-page/metric-page.component.html +++ b/web/src/main/angular/src/app/routes/metric-page/metric-page.component.html @@ -1,20 +1,29 @@ - - -
-
-
- + + +
+ + +
+
+ + +
+
+
+ +
+
+
+ +
-
-
- -
-
+ + diff --git a/web/src/main/angular/src/app/routes/metric-page/metric-page.component.ts b/web/src/main/angular/src/app/routes/metric-page/metric-page.component.ts index 07033bcc452b..c259a81c1256 100644 --- a/web/src/main/angular/src/app/routes/metric-page/metric-page.component.ts +++ b/web/src/main/angular/src/app/routes/metric-page/metric-page.component.ts @@ -1,8 +1,8 @@ import { Component, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; -import { map } from 'rxjs/operators'; +import { map, tap } from 'rxjs/operators'; -import { NewUrlStateNotificationService } from 'app/shared/services'; +import { NewUrlStateNotificationService, UrlRouteManagerService, WebAppSettingDataService } from 'app/shared/services'; import { UrlPathId } from 'app/shared/models'; @Component({ @@ -13,12 +13,27 @@ import { UrlPathId } from 'app/shared/models'; export class MetricPageComponent implements OnInit { showSideMenu$: Observable; + sideNavigationUI: boolean; + + showMetric$: Observable; constructor( private newUrlStateNotificationService: NewUrlStateNotificationService, + private webAppSettingDataService: WebAppSettingDataService, + private urlRouteManagerService: UrlRouteManagerService ) {} ngOnInit() { + // * Take this approach because Angular triggers guard before resolver + this.showMetric$ = this.webAppSettingDataService.showMetric().pipe( + tap((showMetric) => { + if (!showMetric) { + this.urlRouteManagerService.moveToMain(); + } + }) + ); + + this.sideNavigationUI = this.webAppSettingDataService.getExperimentalOption('sideNavigationUI'); this.showSideMenu$ = this.newUrlStateNotificationService.onUrlStateChange$.pipe( map((urlService: NewUrlStateNotificationService) => { return urlService.isRealTimeMode() || urlService.hasValue(UrlPathId.END_TIME); diff --git a/web/src/main/angular/src/app/shared/services/system-configuration-data.service.ts b/web/src/main/angular/src/app/shared/services/system-configuration-data.service.ts index 21ebd0b283a9..dddf69131345 100644 --- a/web/src/main/angular/src/app/shared/services/system-configuration-data.service.ts +++ b/web/src/main/angular/src/app/shared/services/system-configuration-data.service.ts @@ -41,7 +41,8 @@ export class SystemConfigurationDataService { version: '', userId: '', userName: '', - userDepartment: '' + userDepartment: '', + showSystemMetric: false, }; constructor( @@ -54,7 +55,7 @@ export class SystemConfigurationDataService { description: 'Use a new side navigation UI.', value: false, } - } + }; } getConfiguration(): Observable { diff --git a/web/src/main/angular/src/app/shared/services/url-route-manager.service.ts b/web/src/main/angular/src/app/shared/services/url-route-manager.service.ts index 1b64b3922e7b..21aa37663981 100644 --- a/web/src/main/angular/src/app/shared/services/url-route-manager.service.ts +++ b/web/src/main/angular/src/app/shared/services/url-route-manager.service.ts @@ -60,19 +60,31 @@ export class UrlRouteManagerService { ]); } + moveToMain(): void { + this.router.navigate([ + UrlPath.MAIN + ]); + } + + moveToMetricPage(): void { + this.router.navigate([ + UrlPath.METRIC + ]); + } + moveByApplicationCondition(rootRoute: UrlPath): void { if (this.newUrlStateNotificationService.hasValue(UrlPathId.APPLICATION)) { - const isRealTimeMode = this.newUrlStateNotificationService.isRealTimeMode() + const isRealTimeMode = this.newUrlStateNotificationService.isRealTimeMode(); const applicationName = this.newUrlStateNotificationService.getPathValue(UrlPathId.APPLICATION).applicationName; const serviceType = this.newUrlStateNotificationService.getPathValue(UrlPathId.APPLICATION).serviceType; const selectedApp = `${applicationName}@${serviceType}`; - + if (isRealTimeMode) { this.router.navigate([ rootRoute, UrlPath.REAL_TIME, selectedApp, - ]) + ]); } else if ( this.newUrlStateNotificationService.hasValue(UrlPathId.PERIOD) && this.newUrlStateNotificationService.hasValue(UrlPathId.END_TIME) @@ -87,7 +99,7 @@ export class UrlRouteManagerService { } else { this.router.navigate([ rootRoute, - ]) + ]); } } diff --git a/web/src/main/angular/src/app/shared/services/web-app-setting-data.service.ts b/web/src/main/angular/src/app/shared/services/web-app-setting-data.service.ts index d6b3e4044348..78c830e277ff 100644 --- a/web/src/main/angular/src/app/shared/services/web-app-setting-data.service.ts +++ b/web/src/main/angular/src/app/shared/services/web-app-setting-data.service.ts @@ -77,6 +77,9 @@ export class WebAppSettingDataService { isWebhookEnable(): Observable { return this.newUrlStateNotificationService.getConfiguration('webhookEnable'); } + showMetric(): Observable { + return this.newUrlStateNotificationService.getConfiguration('showSystemMetric'); + } getImagePath(): string { return this.IMAGE_PATH; } diff --git a/web/src/main/angular/src/globals.d.ts b/web/src/main/angular/src/globals.d.ts index 983c20228daf..4512966c348b 100644 --- a/web/src/main/angular/src/globals.d.ts +++ b/web/src/main/angular/src/globals.d.ts @@ -394,6 +394,7 @@ interface ISystemConfiguration { userId?: string; userName?: string; userDepartment?: string; + showSystemMetric: boolean; } interface IFormFieldErrorType { diff --git a/web/src/main/java/com/navercorp/pinpoint/web/config/ConfigProperties.java b/web/src/main/java/com/navercorp/pinpoint/web/config/ConfigProperties.java index 737d73212e58..3d0f1f68af01 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/config/ConfigProperties.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/config/ConfigProperties.java @@ -64,6 +64,10 @@ public class ConfigProperties { @Value("${config.show.stackTraceOnError:true}") private boolean showStackTraceOnError; + @Value("${config.show.systemMetric:false}") + private boolean showSystemMetric; + + @Value("${websocket.allowedOrigins:#{null}}") private String webSocketAllowedOrigins; @@ -110,6 +114,10 @@ public boolean isShowStackTraceOnError() { return showStackTraceOnError; } + public boolean isShowSystemMetric() { + return showSystemMetric; + } + public String getWebSocketAllowedOrigins() { return webSocketAllowedOrigins; } diff --git a/web/src/main/java/com/navercorp/pinpoint/web/controller/ConfigController.java b/web/src/main/java/com/navercorp/pinpoint/web/controller/ConfigController.java index 590da544e72e..11a5561f0f70 100644 --- a/web/src/main/java/com/navercorp/pinpoint/web/controller/ConfigController.java +++ b/web/src/main/java/com/navercorp/pinpoint/web/controller/ConfigController.java @@ -62,8 +62,10 @@ public Map getProperties() { result.put("enableServerMapRealTime", webProperties.isEnableServerMapRealTime()); result.put("showApplicationStat", webProperties.isShowApplicationStat()); result.put("showStackTraceOnError", webProperties.isShowStackTraceOnError()); + result.put("showSystemMetric", webProperties.isShowSystemMetric()); result.put("openSource", webProperties.isOpenSource()); result.put("webhookEnable", webProperties.isWebhookEnable()); + result.put("version", Version.VERSION); result.putAll(experimentalConfig.getProperties());