Console: Hide dead tunnel pools on /tunnels

This commit is contained in:
zzz
2013-07-03 19:14:21 +00:00
parent 0db7e2873c
commit b9a5dd48f6
4 changed files with 8 additions and 3 deletions

View File

@ -14,7 +14,7 @@ public class ConfigTunnelsHelper extends HelperBase {
private static final String HOPS = ngettext("1 hop", "{0} hops");
private static final String TUNNELS = ngettext("1 tunnel", "{0} tunnels");
private static final String PROP_ADVANCED = "routerconsole.advanced";
static final String PROP_ADVANCED = "routerconsole.advanced";
public String getForm() {
StringBuilder buf = new StringBuilder(1024);

View File

@ -39,8 +39,12 @@ public class TunnelRenderer {
Map<Hash, TunnelPool> clientInboundPools = _context.tunnelManager().getInboundClientPools();
Map<Hash, TunnelPool> clientOutboundPools = _context.tunnelManager().getOutboundClientPools();
destinations = new ArrayList(clientInboundPools.keySet());
boolean debug = _context.getBooleanProperty(ConfigTunnelsHelper.PROP_ADVANCED);
for (int i = 0; i < destinations.size(); i++) {
Hash client = destinations.get(i);
boolean isLocal = _context.clientManager().isLocal(client);
if ((!isLocal) && (!debug))
continue;
TunnelPool in = null;
TunnelPool outPool = null;
in = clientInboundPools.get(client);
@ -53,7 +57,7 @@ public class TunnelRenderer {
name = client.toBase64().substring(0,4);
out.write("<h2><a name=\"" + client.toBase64().substring(0,4)
+ "\" ></a>" + _("Client tunnels for") + ' ' + _(name));
if (_context.clientManager().isLocal(client))
if (isLocal)
out.write(" (<a href=\"/configtunnels#" + client.toBase64().substring(0,4) +"\">" + _("configure") + "</a>)</h2>\n");
else
out.write(" (" + _("dead") + ")</h2>\n");

View File

@ -1,4 +1,5 @@
2013-07-03 zzz
* Console: Hide dead tunnel pools on /tunnels
* Updater: Fix plugin update checker (ticket #897)
* Utils: Reduce logging in wrapper log when extracting zip files

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 15;
public final static long BUILD = 16;
/** for example "-test" */
public final static String EXTRA = "-rc";