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

Skip to content
Snippets Groups Projects
Commit c3af134a authored by zzz's avatar zzz
Browse files

- Remove UTC time from summary bar

      - Increase skew warning threshold to 3s (was 100ms)
parent 7986f564
No related branches found
No related tags found
No related merge requests found
...@@ -64,24 +64,15 @@ public class SummaryHelper extends HelperBase { ...@@ -64,24 +64,15 @@ public class SummaryHelper extends HelperBase {
return DataHelper.formatDuration(router.getUptime()); return DataHelper.formatDuration(router.getUptime());
} }
private static final DateFormat _fmt = new java.text.SimpleDateFormat("HH:mm:ss", Locale.UK); private String timeSkew() {
public String getTime() {
if (_context == null) return ""; if (_context == null) return "";
//if (!_context.clock().getUpdatedSuccessfully())
String now = null; // return " (Unknown skew)";
synchronized (_fmt) {
now = _fmt.format(new Date(_context.clock().now()));
}
if (!_context.clock().getUpdatedSuccessfully())
return now + " (Unknown skew)";
long ms = _context.clock().getOffset(); long ms = _context.clock().getOffset();
long diff = Math.abs(ms); long diff = Math.abs(ms);
if (diff < 100) if (diff < 3000)
return now; return "";
return now + " (" + DataHelper.formatDuration(diff) + " skew)"; return " (" + DataHelper.formatDuration(diff) + " skew)";
} }
public boolean allowReseed() { public boolean allowReseed() {
...@@ -94,6 +85,10 @@ public class SummaryHelper extends HelperBase { ...@@ -94,6 +85,10 @@ public class SummaryHelper extends HelperBase {
public int getAllPeers() { return Math.max(_context.netDb().getKnownRouters() - 1, 0); } public int getAllPeers() { return Math.max(_context.netDb().getKnownRouters() - 1, 0); }
public String getReachability() { public String getReachability() {
return reachability() + timeSkew();
}
private String reachability() {
if (_context.router().getUptime() > 60*1000 && (!_context.router().gracefulShutdownInProgress()) && if (_context.router().getUptime() > 60*1000 && (!_context.router().gracefulShutdownInProgress()) &&
!_context.clientManager().isAlive()) !_context.clientManager().isAlive())
return "ERR-Client Manager I2CP Error - check logs"; // not a router problem but the user should know return "ERR-Client Manager I2CP Error - check logs"; // not a router problem but the user should know
......
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
<b>Ident:</b> (<a title="Your router identity is <jsp:getProperty name="helper" property="ident" />, never reveal it to anyone" href="netdb.jsp?r=." target="_top">view</a>)<br /> <b>Ident:</b> (<a title="Your router identity is <jsp:getProperty name="helper" property="ident" />, never reveal it to anyone" href="netdb.jsp?r=." target="_top">view</a>)<br />
<b>Version:</b> <jsp:getProperty name="helper" property="version" /><br /> <b>Version:</b> <jsp:getProperty name="helper" property="version" /><br />
<b>Uptime:</b> <jsp:getProperty name="helper" property="uptime" /><br /> <b>Uptime:</b> <jsp:getProperty name="helper" property="uptime" /><br />
<b>Now:</b> <jsp:getProperty name="helper" property="time" /><br />
<b>Reachability:</b> <a href="config.jsp#help" target="_top"><jsp:getProperty name="helper" property="reachability" /></a> <b>Reachability:</b> <a href="config.jsp#help" target="_top"><jsp:getProperty name="helper" property="reachability" /></a>
<% <%
if (helper.updateAvailable()) { if (helper.updateAvailable()) {
......
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