From dcdfbbf64e5c487dc76d2ce05cc188e39ca5783e Mon Sep 17 00:00:00 2001 From: "michele.artini" Date: Tue, 29 Nov 2022 14:14:59 +0100 Subject: [PATCH] info ui --- .../dnetlib/is/info/InfoRestController.java | 18 ++--- .../src/main/resources/templates/info.html | 69 ++++++++++--------- 2 files changed, 44 insertions(+), 43 deletions(-) diff --git a/apps/dnet-is-application/src/main/java/eu/dnetlib/is/info/InfoRestController.java b/apps/dnet-is-application/src/main/java/eu/dnetlib/is/info/InfoRestController.java index aa87562c..fee734b7 100644 --- a/apps/dnet-is-application/src/main/java/eu/dnetlib/is/info/InfoRestController.java +++ b/apps/dnet-is-application/src/main/java/eu/dnetlib/is/info/InfoRestController.java @@ -11,6 +11,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.model.Model; @@ -41,14 +42,7 @@ public class InfoRestController { @GetMapping("/") public List> info() throws Exception { - return Arrays.asList(jvm(), env(), libs(), sysProps(), appProps(), modules()); - } - - private InfoSection appProps() { - final InfoSection appProps = new InfoSection<>("Application properties"); - configurableEnvironment.getPropertySources() - .forEach(ps -> appProps.getData().add(new KeyValue(ps.getName(), ps.getSource().toString()))); - return appProps; + return Arrays.asList(jvm(), env(), libs(), sysProps(), modules()); } private InfoSection sysProps() { @@ -59,10 +53,10 @@ public class InfoRestController { private InfoSection libs() { final InfoSection libs = new InfoSection<>("Libraries and arguments"); - libs.getData().add(new KeyValue("Classpath", mxbean.getClassPath().replaceAll(":", " : "))); - libs.getData().add(new KeyValue("Boot ClassPath", mxbean.getBootClassPath().replaceAll(":", " : "))); - libs.getData().add(new KeyValue("Input arguments", mxbean.getInputArguments().toString())); - libs.getData().add(new KeyValue("Library Path", mxbean.getLibraryPath().replaceAll(":", " : "))); + libs.getData().add(new KeyValue("Classpath", mxbean.getClassPath())); + libs.getData().add(new KeyValue("Boot ClassPath", mxbean.getBootClassPath())); + libs.getData().add(new KeyValue("Input arguments", StringUtils.join(mxbean.getInputArguments(), " "))); + libs.getData().add(new KeyValue("Library Path", mxbean.getLibraryPath())); return libs; } diff --git a/apps/dnet-is-application/src/main/resources/templates/info.html b/apps/dnet-is-application/src/main/resources/templates/info.html index eee7dea4..3712f26f 100644 --- a/apps/dnet-is-application/src/main/resources/templates/info.html +++ b/apps/dnet-is-application/src/main/resources/templates/info.html @@ -15,37 +15,35 @@

-
-
{{section.name}}
- - - - - - - - - - - - - - - - - - - - - - - - -
Group IDArtifact IDVersionPOM
No match
{{r.k}}{{r.v}}
{{r.group}}{{r.name}}{{v}}
{{f}}
- +
+ +
+
{{section.name}}
+ +
+ + + + + + + + + + + + + + + + + + + + +
Group IDArtifact IDVersionPOM
{{r.k}}
{{r.v}}
{{r.group}}{{r.name}}{{v}}
{{f}}
- - +
@@ -61,7 +59,16 @@ $scope.info = []; $scope.modules = {}; - $http.get('./api/info/?' + $.now()).then(function successCallback(res) { + $http.get('./api/info/?' + $.now()).then(function successCallback(res) { + angular.forEach(res.data, function(section) { + if (section.name != 'Modules') { + angular.forEach(section.data, function(r) { + if (r.k.toLowerCase().includes('path')) { + r.v = r.v.replaceAll(':', ':\n'); + } + }); + } + }); $scope.info = res.data; }, function errorCallback(res) { alert('ERROR: ' + res.data.message);