From af1cf375f5d4fe64fbf885529c043691369130da Mon Sep 17 00:00:00 2001 From: Tom Morris Date: Fri, 2 Oct 2020 03:41:37 -0400 Subject: [PATCH] Add Java runtime name & version to About page - fixes #3240 (#3244) * Visually center links box * Add the Java runtime info to the About page - fixes #3240 - Add the Java runtime name & version GetVersionCommand - Add the returned information to the About page --- .../refine/commands/GetVersionCommand.java | 31 ++++++++++++------- main/webapp/modules/core/about.html | 17 +++------- main/webapp/modules/core/scripts/index.js | 1 + main/webapp/modules/core/styles/index.less | 2 +- 4 files changed, 26 insertions(+), 25 deletions(-) diff --git a/main/src/com/google/refine/commands/GetVersionCommand.java b/main/src/com/google/refine/commands/GetVersionCommand.java index efdfd3925..26523f791 100644 --- a/main/src/com/google/refine/commands/GetVersionCommand.java +++ b/main/src/com/google/refine/commands/GetVersionCommand.java @@ -44,17 +44,26 @@ import com.google.refine.RefineServlet; public class GetVersionCommand extends Command { - protected class VersionResponse { - @JsonProperty("version") - public String version = RefineServlet.VERSION; - @JsonProperty("revision") - public String revision = RefineServlet.REVISION; - @JsonProperty("full_version") - public String full_version = RefineServlet.FULL_VERSION; - @JsonProperty("full_name") - public String full_name = RefineServlet.FULLNAME; - } - + protected class VersionResponse { + @JsonProperty("version") + public String version = RefineServlet.VERSION; + @JsonProperty("revision") + public String revision = RefineServlet.REVISION; + @JsonProperty("full_version") + public String full_version = RefineServlet.FULL_VERSION; + @JsonProperty("full_name") + public String full_name = RefineServlet.FULLNAME; + @JsonProperty("java_vm_name") + public String java_vm_name = System.getProperty("java.vm.name", "?"); + @JsonProperty("java_vm_version") + public String java_vm_version = System.getProperty("java.vm.version", "?"); + @JsonProperty("java_runtime_name") + public String java_runtime_name = System.getProperty("java.runtime.name", "?"); + @JsonProperty("java_runtime_version") + // public String java_runtime_version = Runtime.getRuntime().version(); // Java 9 or later + public String java_runtime_version = System.getProperty("java.runtime.version", "?"); + } + @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { respondJSON(response, new VersionResponse()); diff --git a/main/webapp/modules/core/about.html b/main/webapp/modules/core/about.html index bdc8347d2..08596b7a8 100644 --- a/main/webapp/modules/core/about.html +++ b/main/webapp/modules/core/about.html @@ -54,18 +54,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - +