From 11d8c67d1292d8724d59a00e58e78ee235955f3f Mon Sep 17 00:00:00 2001 From: jrandom <jrandom> Date: Fri, 30 Jul 2004 20:28:19 +0000 Subject: [PATCH] added some client info (e.g. 2 clients w/ 2 1 hop tunnels each expiring in 8m) --- .../src/net/i2p/router/web/SummaryHelper.java | 20 +++++++++++++++++-- apps/routerconsole/jsp/summary.jsp | 2 ++ 2 files changed, 20 insertions(+), 2 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 32ad3c2072..9583aaff0a 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -1,5 +1,7 @@ package net.i2p.router.web; +import java.io.ByteArrayOutputStream; +import java.io.IOException; import java.text.DecimalFormat; import net.i2p.data.DataHelper; @@ -301,11 +303,25 @@ public class SummaryHelper { } } + /** + * How many client destinations are connected locally. + * + * @return html section summary + */ + public String getDestinations() { + ByteArrayOutputStream baos = new ByteArrayOutputStream(1024); + try { + _context.clientManager().renderStatusHTML(baos); + return new String(baos.toByteArray()); + } catch (IOException ioe) { + _context.logManager().getLog(SummaryHelper.class).error("Error rendering client info", ioe); + return ""; + } + } + /** * How many free inbound tunnels we have. * - * @param contextId begging few characters of the routerHash, or null to pick - * the first one we come across. */ public int getInboundTunnels() { if (_context == null) diff --git a/apps/routerconsole/jsp/summary.jsp b/apps/routerconsole/jsp/summary.jsp index 3c70f31197..64cda9550a 100644 --- a/apps/routerconsole/jsp/summary.jsp +++ b/apps/routerconsole/jsp/summary.jsp @@ -25,6 +25,8 @@ <b>Used:</b> <jsp:getProperty name="helper" property="inboundTransferred" />/<jsp:getProperty name="helper" property="outboundTransferred" /><br /> <hr /> + <jsp:getProperty name="helper" property="destinations" /> + <u><b>Tunnels</b></u><br /> <b>Inbound:</b> <jsp:getProperty name="helper" property="inboundTunnels" /><br /> <b>Outbound:</b> <jsp:getProperty name="helper" property="outboundTunnels" /><br /> -- GitLab