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

View File

@ -657,8 +657,8 @@ public class NTCPTransport extends TransportImpl {
buf.setLength(0); buf.setLength(0);
for (Iterator iter = peers.iterator(); iter.hasNext(); ) { for (Iterator iter = peers.iterator(); iter.hasNext(); ) {
NTCPConnection con = (NTCPConnection)iter.next(); NTCPConnection con = (NTCPConnection)iter.next();
String name = con.getRemotePeer().calculateHash().toBase64().substring(0,6); buf.append("<tr><td>");
buf.append("<tr><td><code><a href=\"netdb.jsp?r=").append(name).append("\">").append(name).append("</a>"); buf.append(_context.commSystem().renderPeerHTML(con.getRemotePeer().calculateHash()));
//byte[] ip = getIP(con.getRemotePeer().calculateHash()); //byte[] ip = getIP(con.getRemotePeer().calculateHash());
//if (ip != null) //if (ip != null)
// buf.append(' ').append(_context.blocklist().toStr(ip)); // 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("</b><br />\n");
buf.append("<table border=\"1\">\n"); buf.append("<table border=\"1\">\n");
buf.append(" <tr><td><b><a href=\"#def.peer\">peer</a></b>"); buf.append(" <tr><td><b><a href=\"#def.peer\">peer</a></b>");
if (sortFlags == FLAG_ALPHA) if (sortFlags != FLAG_ALPHA)
buf.append(" V ");
else
buf.append(" <a href=\"").append(urlBase).append("?sort=0\">V</a> "); 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>"); 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); 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>"); buf.append("<tr>");
String name = peer.getRemotePeer().toBase64().substring(0,6); buf.append("<td>");
buf.append("<td valign=\"top\" nowrap=\"nowrap\"><code>"); buf.append(_context.commSystem().renderPeerHTML(peer.getRemotePeer()));
buf.append("<a href=\"netdb.jsp?r=");
buf.append(name);
buf.append("\">");
buf.append(name);
buf.append("</a>");
//byte ip[] = peer.getRemoteIP(); //byte ip[] = peer.getRemoteIP();
//if (ip != null) //if (ip != null)
// buf.append(' ').append(_context.blocklist().toStr(ip)); // 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"); out.write("<td align=right>" + info.getProcessedMessagesCount() + "KB</td>\n");
for (int j = 0; j < info.getLength(); j++) { for (int j = 0; j < info.getLength(); j++) {
Hash peer = info.getPeer(j); Hash peer = info.getPeer(j);
String cap = getCapacity(peer);
TunnelId id = (info.isInbound() ? info.getReceiveTunnelId(j) : info.getSendTunnelId(j)); 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>"); out.write("<td>" + (id == null ? "" : "" + id) + "</td>");
else } else {
out.write("<td>" + netDbLink(peer) + (id == null ? "" : ":" + id) + cap + "</td>"); String cap = getCapacity(peer);
out.write("<td>" + netDbLink(peer) + (id == null ? "" : " " + id) + cap + "</td>");
}
} }
out.write("</tr>\n"); out.write("</tr>\n");
@ -563,18 +564,14 @@ public class TunnelPoolManager implements TunnelManagerFacade {
out.write("</table>\n"); out.write("</table>\n");
if (in != null) { if (in != null) {
List pending = in.listPending(); List pending = in.listPending();
for (int i = 0; i < pending.size(); i++) { if (pending.size() > 0)
TunnelInfo info = (TunnelInfo)pending.get(i); out.write("Build in progress: " + pending.size() + " inbound<br />\n");
out.write("In progress: <code>" + info.toString() + "</code><br />\n");
}
live += pending.size(); live += pending.size();
} }
if (outPool != null) { if (outPool != null) {
List pending = outPool.listPending(); List pending = outPool.listPending();
for (int i = 0; i < pending.size(); i++) { if (pending.size() > 0)
TunnelInfo info = (TunnelInfo)pending.get(i); out.write("In progress: " + pending.size() + " outbound<br />\n");
out.write("In progress: <code>" + info.toString() + "</code><br />\n");
}
live += pending.size(); live += pending.size();
} }
if (live <= 0) if (live <= 0)
@ -716,22 +713,12 @@ public class TunnelPoolManager implements TunnelManagerFacade {
RouterInfo info = _context.netDb().lookupRouterInfoLocally(peer); RouterInfo info = _context.netDb().lookupRouterInfoLocally(peer);
if (info != null) { if (info != null) {
String caps = info.getCapabilities(); String caps = info.getCapabilities();
if (caps.indexOf(Router.CAPABILITY_BW12) >= 0) { for (char c = Router.CAPABILITY_BW12; c <= Router.CAPABILITY_BW256; c++) {
return "[&lt;12&nbsp;]"; if (caps.indexOf(c) >= 0)
} else if (caps.indexOf(Router.CAPABILITY_BW32) >= 0) { return " " + c;
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;]";
} }
} else {
return "[unkn]";
} }
return "";
} }
private String netDbLink(Hash peer) { private String netDbLink(Hash peer) {