From ee055dbdc000662bedff679021af62469f2e648a Mon Sep 17 00:00:00 2001 From: zzz <zzz@i2pmail.org> Date: Thu, 26 Jan 2023 10:03:14 -0500 Subject: [PATCH] Console: Add git rev to version info --- .../java/src/net/i2p/router/web/helpers/LogsHelper.java | 7 +++++++ apps/routerconsole/jsp/logs.jsp | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/LogsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/LogsHelper.java index f031b0e6fe..25021f61bc 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/LogsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/LogsHelper.java @@ -224,6 +224,13 @@ public class LogsHelper extends HelperBase { return getAtt("Build-Date"); } + /** + * @since 0.9.58 + */ + public String getRevision() { + return getAtt("Base-Revision"); + } + /** * @since 0.9.58 pulled out from above */ diff --git a/apps/routerconsole/jsp/logs.jsp b/apps/routerconsole/jsp/logs.jsp index 1d1d65b946..36b82fce34 100644 --- a/apps/routerconsole/jsp/logs.jsp +++ b/apps/routerconsole/jsp/logs.jsp @@ -54,7 +54,13 @@ %><tr><td><b>Encoding:</b></td><td><%=System.getProperty("file.encoding")%></td></tr> <tr><td><b>Charset:</b></td><td><%=java.nio.charset.Charset.defaultCharset().name()%></td></tr> <tr><td><b>Service:</b></td><td><%=net.i2p.util.SystemVersion.isService()%></td></tr> -<tr><td><b>Built:</b></td><td><jsp:getProperty name="logsHelper" property="buildDate" /></td></tr> +<% + String rev = logsHelper.getRevision(); + if (rev.length() == 40) { +%><tr><td><b>Revision:</b></td><td><%=rev%></td></tr> +<% + } +%><tr><td><b>Built:</b></td><td><jsp:getProperty name="logsHelper" property="buildDate" /></td></tr> <tr><td><b>Built By:</b></td><td><jsp:getProperty name="logsHelper" property="builtBy" /></td></tr></tbody></table> <h3 class="tabletitle"><%=intl._t("Critical Logs")%><% -- GitLab