* Console:

- Use flags for shitlist and peers.jsp too
      - Tweak tunnels.jsp to show class letters
      - Hide in-progress details on tunnels.jsp
This commit is contained in:
zzz
2009-05-20 15:49:39 +00:00
parent 31cd726b7b
commit 846c5fcfc3
4 changed files with 19 additions and 40 deletions

View File

@ -263,8 +263,7 @@ public class Shitlist {
for (Map.Entry<Hash, Entry> e : entries.entrySet()) {
Hash key = e.getKey();
Entry entry = e.getValue();
buf.append("<li><b>").append(key.toBase64()).append("</b>");
buf.append(" (<a href=\"netdb.jsp?r=").append(key.toBase64().substring(0, 6)).append("\">netdb</a>)");
buf.append("<li>").append(_context.commSystem().renderPeerHTML(key));
buf.append(" expiring in ");
buf.append(DataHelper.formatDuration(entry.expireOn-_context.clock().now()));
Set transports = entry.transports;

View File

@ -657,8 +657,8 @@ public class NTCPTransport extends TransportImpl {
buf.setLength(0);
for (Iterator iter = peers.iterator(); iter.hasNext(); ) {
NTCPConnection con = (NTCPConnection)iter.next();
String name = con.getRemotePeer().calculateHash().toBase64().substring(0,6);
buf.append("<tr><td><code><a href=\"netdb.jsp?r=").append(name).append("\">").append(name).append("</a>");
buf.append("<tr><td>");
buf.append(_context.commSystem().renderPeerHTML(con.getRemotePeer().calculateHash()));
//byte[] ip = getIP(con.getRemotePeer().calculateHash());
//if (ip != null)
// buf.append(' ').append(_context.blocklist().toStr(ip));

View File

@ -1753,9 +1753,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
buf.append("</b><br />\n");
buf.append("<table border=\"1\">\n");
buf.append(" <tr><td><b><a href=\"#def.peer\">peer</a></b>");
if (sortFlags == FLAG_ALPHA)
buf.append(" V ");
else
if (sortFlags != FLAG_ALPHA)
buf.append(" <a href=\"").append(urlBase).append("?sort=0\">V</a> ");
buf.append("</td><td>dir/intro</td><td><b><a href=\"#def.idle\">idle</a></b>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by idle inbound", FLAG_IDLE_IN);
@ -1807,13 +1805,8 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
buf.append("<tr>");
String name = peer.getRemotePeer().toBase64().substring(0,6);
buf.append("<td valign=\"top\" nowrap=\"nowrap\"><code>");
buf.append("<a href=\"netdb.jsp?r=");
buf.append(name);
buf.append("\">");
buf.append(name);
buf.append("</a>");
buf.append("<td>");
buf.append(_context.commSystem().renderPeerHTML(peer.getRemotePeer()));
//byte ip[] = peer.getRemoteIP();
//if (ip != null)
// buf.append(' ').append(_context.blocklist().toStr(ip));

View File

@ -546,12 +546,13 @@ public class TunnelPoolManager implements TunnelManagerFacade {
out.write("<td align=right>" + info.getProcessedMessagesCount() + "KB</td>\n");
for (int j = 0; j < info.getLength(); j++) {
Hash peer = info.getPeer(j);
String cap = getCapacity(peer);
TunnelId id = (info.isInbound() ? info.getReceiveTunnelId(j) : info.getSendTunnelId(j));
if (_context.routerHash().equals(peer))
if (_context.routerHash().equals(peer)) {
out.write("<td>" + (id == null ? "" : "" + id) + "</td>");
else
out.write("<td>" + netDbLink(peer) + (id == null ? "" : ":" + id) + cap + "</td>");
} else {
String cap = getCapacity(peer);
out.write("<td>" + netDbLink(peer) + (id == null ? "" : " " + id) + cap + "</td>");
}
}
out.write("</tr>\n");
@ -563,18 +564,14 @@ public class TunnelPoolManager implements TunnelManagerFacade {
out.write("</table>\n");
if (in != null) {
List pending = in.listPending();
for (int i = 0; i < pending.size(); i++) {
TunnelInfo info = (TunnelInfo)pending.get(i);
out.write("In progress: <code>" + info.toString() + "</code><br />\n");
}
if (pending.size() > 0)
out.write("Build in progress: " + pending.size() + " inbound<br />\n");
live += pending.size();
}
if (outPool != null) {
List pending = outPool.listPending();
for (int i = 0; i < pending.size(); i++) {
TunnelInfo info = (TunnelInfo)pending.get(i);
out.write("In progress: <code>" + info.toString() + "</code><br />\n");
}
if (pending.size() > 0)
out.write("In progress: " + pending.size() + " outbound<br />\n");
live += pending.size();
}
if (live <= 0)
@ -716,22 +713,12 @@ public class TunnelPoolManager implements TunnelManagerFacade {
RouterInfo info = _context.netDb().lookupRouterInfoLocally(peer);
if (info != null) {
String caps = info.getCapabilities();
if (caps.indexOf(Router.CAPABILITY_BW12) >= 0) {
return "[&lt;12&nbsp;]";
} else if (caps.indexOf(Router.CAPABILITY_BW32) >= 0) {
return "[&lt;=32&nbsp;]";
} else if (caps.indexOf(Router.CAPABILITY_BW64) >= 0) {
return "[&lt;=64&nbsp;]";
} else if (caps.indexOf(Router.CAPABILITY_BW128) >= 0) {
return "<b>[&lt;=128]</b>";
} else if (caps.indexOf(Router.CAPABILITY_BW256) >= 0) {
return "<b>[&gt;128]</b>";
} else {
return "[old&nbsp;]";
for (char c = Router.CAPABILITY_BW12; c <= Router.CAPABILITY_BW256; c++) {
if (caps.indexOf(c) >= 0)
return " " + c;
}
} else {
return "[unkn]";
}
return "";
}
private String netDbLink(Hash peer) {