From f4a6cf200214ed6815650c11bc39f428cf328eec Mon Sep 17 00:00:00 2001 From: zzz Date: Sat, 3 Oct 2015 14:06:12 +0000 Subject: [PATCH] Show 'none' if no part. tunnels on /tunnels --- .../src/net/i2p/router/web/TunnelRenderer.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java index 3784e4a30..aab84c630 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java @@ -66,11 +66,13 @@ public class TunnelRenderer { } List participating = _context.tunnelDispatcher().listParticipatingTunnels(); - Collections.sort(participating, new TunnelComparator()); - out.write("

" + _t("Participating tunnels") + "

\n"); - out.write("
" + _t("Receive on") + "" + _t("From") + "" + out.write("

" + _t("Participating tunnels") + "

\n"); + if (!participating.isEmpty()) { + Collections.sort(participating, new TunnelComparator()); + out.write("" + "\n"); + } long processed = 0; RateStat rs = _context.statManager().getRate("tunnel.participatingMessageCount"); if (rs != null) @@ -125,10 +127,14 @@ public class TunnelRenderer { out.write(""); out.write("\n"); } - out.write("
" + _t("Receive on") + "" + _t("From") + "" + _t("Send on") + "" + _t("To") + "" + _t("Expiration") + "" + _t("Usage") + "" + _t("Rate") + "" + _t("Role") + "
" + _t("Participant") + "
\n"); + if (!participating.isEmpty()) + out.write("
\n"); if (displayed > DISPLAY_LIMIT) out.write("
" + _t("Limited display to the {0} tunnels with the highest usage", DISPLAY_LIMIT) + "
\n"); - out.write("
" + _t("Inactive participating tunnels") + ": " + inactive + "
\n"); + if (inactive > 0) + out.write("
" + _t("Inactive participating tunnels") + ": " + inactive + "
\n"); + else if (displayed <= 0) + out.write("
" + _t("none") + "
\n"); out.write("
" + _t("Lifetime bandwidth usage") + ": " + DataHelper.formatSize2(processed*1024) + "B
\n"); //renderPeers(out); out.write("");