I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Unverified Commit 33a07f81 authored by zzz's avatar zzz
Browse files

Console: Add build date to version info

parent 2dfe05d6
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,9 @@ import net.i2p.util.UIMessages; ...@@ -23,6 +23,9 @@ import net.i2p.util.UIMessages;
public class LogsHelper extends HelperBase { public class LogsHelper extends HelperBase {
// cache so we only load once
Attributes att;
private static final String _jstlVersion = jstlVersion(); private static final String _jstlVersion = jstlVersion();
private static final int MAX_WRAPPER_LINES = 250; private static final int MAX_WRAPPER_LINES = 250;
...@@ -206,23 +209,39 @@ public class LogsHelper extends HelperBase { ...@@ -206,23 +209,39 @@ public class LogsHelper extends HelperBase {
rv[2] = DataHelper.escapeHTML(f.getName()).replace(" ", "%20"); rv[2] = DataHelper.escapeHTML(f.getName()).replace(" ", "%20");
return rv; return rv;
} }
/** /**
* @since 0.9.35 * @since 0.9.35
*/ */
public String getBuiltBy() { public String getBuiltBy() {
File libDir = _context.getLibDir(); return getAtt("Built-By");
File f = new File(libDir, "i2p.jar"); }
Attributes att = FileDumpHelper.attributes(f);
/**
* @since 0.9.58
*/
public String getBuildDate() {
return getAtt("Build-Date");
}
/**
* @since 0.9.58 pulled out from above
*/
private String getAtt(String a) {
if (att == null) {
File libDir = _context.getLibDir();
File f = new File(libDir, "i2p.jar");
att = FileDumpHelper.attributes(f);
}
if (att != null) { if (att != null) {
String s = FileDumpHelper.getAtt(att, "Built-By"); String s = FileDumpHelper.getAtt(att, a);
if (s != null) { if (s != null) {
return s; return s;
} }
} }
return "Undefined"; return "Undefined";
} }
private final static String NL = System.getProperty("line.separator"); private final static String NL = System.getProperty("line.separator");
/** formats in forward order */ /** formats in forward order */
......
...@@ -54,7 +54,8 @@ ...@@ -54,7 +54,8 @@
%><tr><td><b>Encoding:</b></td><td><%=System.getProperty("file.encoding")%></td></tr> %><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>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>Service:</b></td><td><%=net.i2p.util.SystemVersion.isService()%></td></tr>
<tr><td><b>Built By:</b></td><td><jsp:getProperty name="logsHelper" property="builtBy" /></tbody></table> <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")%><% <h3 class="tabletitle"><%=intl._t("Critical Logs")%><%
String consoleNonce = net.i2p.router.web.CSSHelper.getNonce(); String consoleNonce = net.i2p.router.web.CSSHelper.getNonce();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment