From c3af134a5b78dc543b96b14b926270f62ae86004 Mon Sep 17 00:00:00 2001 From: zzz Date: Mon, 3 Aug 2009 20:02:28 +0000 Subject: [PATCH] - Remove UTC time from summary bar - Increase skew warning threshold to 3s (was 100ms) --- .../src/net/i2p/router/web/SummaryHelper.java | 25 ++++++++----------- apps/routerconsole/jsp/summarynoframe.jsp | 1 - 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index ea6d0f4e4..10169ac9f 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -64,24 +64,15 @@ public class SummaryHelper extends HelperBase { return DataHelper.formatDuration(router.getUptime()); } - private static final DateFormat _fmt = new java.text.SimpleDateFormat("HH:mm:ss", Locale.UK); - public String getTime() { + private String timeSkew() { if (_context == null) return ""; - - String now = null; - synchronized (_fmt) { - now = _fmt.format(new Date(_context.clock().now())); - } - - if (!_context.clock().getUpdatedSuccessfully()) - return now + " (Unknown skew)"; - + //if (!_context.clock().getUpdatedSuccessfully()) + // return " (Unknown skew)"; long ms = _context.clock().getOffset(); - long diff = Math.abs(ms); - if (diff < 100) - return now; - return now + " (" + DataHelper.formatDuration(diff) + " skew)"; + if (diff < 3000) + return ""; + return " (" + DataHelper.formatDuration(diff) + " skew)"; } public boolean allowReseed() { @@ -94,6 +85,10 @@ public class SummaryHelper extends HelperBase { public int getAllPeers() { return Math.max(_context.netDb().getKnownRouters() - 1, 0); } public String getReachability() { + return reachability() + timeSkew(); + } + + private String reachability() { if (_context.router().getUptime() > 60*1000 && (!_context.router().gracefulShutdownInProgress()) && !_context.clientManager().isAlive()) return "ERR-Client Manager I2CP Error - check logs"; // not a router problem but the user should know diff --git a/apps/routerconsole/jsp/summarynoframe.jsp b/apps/routerconsole/jsp/summarynoframe.jsp index 633794bb6..2a6252cc4 100644 --- a/apps/routerconsole/jsp/summarynoframe.jsp +++ b/apps/routerconsole/jsp/summarynoframe.jsp @@ -48,7 +48,6 @@ Ident: (, never reveal it to anyone" href="netdb.jsp?r=." target="_top">view)
Version:
Uptime:
-Now:
Reachability: <% if (helper.updateAvailable()) {