UI fixes: text boxes, buttons, radio/checkbox width. Enhanced /peers.jsp.
This commit is contained in:
@ -18,9 +18,9 @@ public class RouterVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Monotone";
|
||||
public final static String VERSION = CoreVersion.VERSION;
|
||||
public final static long BUILD = 0;
|
||||
public final static long BUILD = 02;
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "";
|
||||
public final static String EXTRA = "-zed";
|
||||
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
|
||||
public static void main(String args[]) {
|
||||
System.out.println("I2P Router version: " + FULL_VERSION);
|
||||
|
@ -218,7 +218,11 @@ class ProfileOrganizerRenderer {
|
||||
}
|
||||
buf.append("</table>");
|
||||
|
||||
buf.append("<p><i>Definitions:<ul>");
|
||||
buf.append("<h3>Thresholds:</h3>");
|
||||
buf.append("<b>Speed:</b> ").append(num(_organizer.getSpeedThreshold())).append(" (").append(fast).append(" fast peers)<br />");
|
||||
buf.append("<b>Capacity:</b> ").append(num(_organizer.getCapacityThreshold())).append(" (").append(reliable).append(" high capacity peers)<br />");
|
||||
buf.append("<b>Integration:</b> ").append(num(_organizer.getIntegrationThreshold())).append(" (").append(integrated).append(" well integrated peers)");
|
||||
buf.append("<h3>Definitions:</h3><ul>");
|
||||
buf.append("<li><b>groups</b>: as determined by the profile organizer</li>");
|
||||
buf.append("<li><b>caps</b>: capabilities in the netDb, not used to determine profiles</li>");
|
||||
buf.append("<li><b>speed</b>: peak throughput (bytes per second) over a 1 minute period that the peer has sustained in a single tunnel</li>");
|
||||
@ -226,10 +230,6 @@ class ProfileOrganizerRenderer {
|
||||
buf.append("<li><b>integration</b>: how many new peers have they told us about lately?</li>");
|
||||
buf.append("<li><b>failing?</b>: is the peer currently swamped (and if possible we should avoid nagging them)?</li>");
|
||||
buf.append("</ul></i>");
|
||||
buf.append("<p><b>Thresholds:</b><br />");
|
||||
buf.append("<b>Speed:</b> ").append(num(_organizer.getSpeedThreshold())).append(" (").append(fast).append(" fast peers)<br />");
|
||||
buf.append("<b>Capacity:</b> ").append(num(_organizer.getCapacityThreshold())).append(" (").append(reliable).append(" high capacity peers)<br />");
|
||||
buf.append("<b>Integration:</b> ").append(num(_organizer.getIntegrationThreshold())).append(" (").append(integrated).append(" well integrated peers)<br />");
|
||||
out.write(buf.toString());
|
||||
out.flush();
|
||||
}
|
||||
|
@ -660,20 +660,20 @@ public class NTCPTransport extends TransportImpl {
|
||||
buf.setLength(0);
|
||||
for (Iterator iter = peers.iterator(); iter.hasNext(); ) {
|
||||
NTCPConnection con = (NTCPConnection)iter.next();
|
||||
buf.append("<tr><td align=\"right\" nowrap>");
|
||||
buf.append("<tr> <td class=\"cells\" align=\"left\" nowrap>");
|
||||
buf.append(_context.commSystem().renderPeerHTML(con.getRemotePeer().calculateHash()));
|
||||
//byte[] ip = getIP(con.getRemotePeer().calculateHash());
|
||||
//if (ip != null)
|
||||
// buf.append(' ').append(_context.blocklist().toStr(ip));
|
||||
buf.append("</td><td align=\"center\">");
|
||||
buf.append("</td> <td class=\"cells\" align=\"center\">");
|
||||
if (con.isInbound())
|
||||
buf.append("<img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound\"/>");
|
||||
else
|
||||
buf.append("<img src=\"/themes/console/images/outbound.png\" alt=\"Outbound\" title=\"Outbound\"/>");
|
||||
buf.append("</td><td align=\"right\">");
|
||||
buf.append("</td> <td class=\"cells\" align=\"right\">");
|
||||
buf.append(con.getTimeSinceReceive()/1000);
|
||||
buf.append("s/").append(con.getTimeSinceSend()/1000);
|
||||
buf.append("s</td><td align=\"right\">");
|
||||
buf.append("s</td> <td class=\"cells\" align=\"center\">");
|
||||
if (con.getTimeSinceReceive() < 10*1000) {
|
||||
buf.append(formatRate(con.getRecvRate()/1024));
|
||||
bpsRecv += con.getRecvRate();
|
||||
@ -688,28 +688,28 @@ public class NTCPTransport extends TransportImpl {
|
||||
buf.append(formatRate(0));
|
||||
}
|
||||
buf.append("K/s");
|
||||
buf.append("</td><td align=\"right\">").append(DataHelper.formatDuration(con.getUptime()));
|
||||
buf.append("</td> <td class=\"cells\" align=\"center\">").append(DataHelper.formatDuration(con.getUptime()));
|
||||
totalUptime += con.getUptime();
|
||||
offsetTotal = offsetTotal + con.getClockSkew();
|
||||
buf.append("</td><td align=\"right\">").append(con.getClockSkew());
|
||||
buf.append("s</td><td align=\"right\">").append(con.getMessagesSent());
|
||||
buf.append("</td> <td class=\"cells\" align=\"center\">").append(con.getClockSkew());
|
||||
buf.append("s</td> <td class=\"cells\" align=\"center\">").append(con.getMessagesSent());
|
||||
totalSend += con.getMessagesSent();
|
||||
buf.append("</td><td align=\"right\">").append(con.getMessagesReceived());
|
||||
buf.append("</td> <td class=\"cells\" align=\"center\">").append(con.getMessagesReceived());
|
||||
totalRecv += con.getMessagesReceived();
|
||||
long outQueue = con.getOutboundQueueSize();
|
||||
if (outQueue <= 0) {
|
||||
buf.append("</td><td align=\"right\">No messages");
|
||||
buf.append("</td> <td class=\"cells\" align=\"center\">No messages");
|
||||
} else {
|
||||
buf.append("</td><td align=\"right\">").append(outQueue).append(" message");
|
||||
buf.append("</td> <td class=\"cells\" align=\"center\">").append(outQueue).append(" message");
|
||||
if (outQueue > 1)
|
||||
buf.append("s");
|
||||
}
|
||||
buf.append("</td><td align=\"center\">").append(con.getConsecutiveBacklog() > 0 ? "true" : "false");
|
||||
buf.append("</td> <td class=\"cells\" align=\"center\">").append(con.getConsecutiveBacklog() > 0 ? "true" : "false");
|
||||
long readTime = con.getReadTime();
|
||||
if (readTime <= 0) {
|
||||
buf.append("</td><td align=\"center\">No");
|
||||
buf.append("</td> <td class=\"cells\" align=\"center\">No");
|
||||
} else {
|
||||
buf.append("</td><td>For ").append(DataHelper.formatDuration(readTime));
|
||||
buf.append("</td> <td class=\"cells\">For ").append(DataHelper.formatDuration(readTime));
|
||||
}
|
||||
buf.append("</td></tr>\n");
|
||||
out.write(buf.toString());
|
||||
@ -717,13 +717,13 @@ public class NTCPTransport extends TransportImpl {
|
||||
}
|
||||
|
||||
if (peers.size() > 0) {
|
||||
buf.append("<tr><td colspan=\"11\"><hr /></td></tr>\n");
|
||||
buf.append("<tr><td align=\"center\"><b>").append(peers.size()).append(" peers</b></td><td> </td><td> ");
|
||||
buf.append("</td><td align=\"right\"><b>").append(formatRate(bpsRecv/1024)).append("/").append(formatRate(bpsSend/1024)).append("K/s</b>");
|
||||
buf.append("</td><td align=\"right\"><b>").append(DataHelper.formatDuration(totalUptime/peers.size()));
|
||||
buf.append("</b></td><td align=\"right\"><b>").append(peers.size() > 0 ? DataHelper.formatDuration(offsetTotal*1000/peers.size()) : "0ms");
|
||||
buf.append("</b></td><td align=\"right\"><b>").append(totalSend).append("</b></td><td align=\"right\"><b>").append(totalRecv);
|
||||
buf.append("</b></td><td> </td><td> </td><td> ");
|
||||
// buf.append("<tr> <td colspan=\"11\"><hr /></td></tr>\n");
|
||||
buf.append("<tr class=\"tablefooter\"> <td align=\"center\"><b>").append(peers.size()).append(" peers</b></td> <td> </td> <td> ");
|
||||
buf.append("</td> <td align=\"center\"><b>").append(formatRate(bpsRecv/1024)).append("/").append(formatRate(bpsSend/1024)).append("K/s</b>");
|
||||
buf.append("</td> <td align=\"center\"><b>").append(DataHelper.formatDuration(totalUptime/peers.size()));
|
||||
buf.append("</b></td> <td align=\"center\"><b>").append(peers.size() > 0 ? DataHelper.formatDuration(offsetTotal*1000/peers.size()) : "0ms");
|
||||
buf.append("</b></td> <td align=\"center\"><b>").append(totalSend).append("</b></td> <td align=\"center\"><b>").append(totalRecv);
|
||||
buf.append("</b></td> <td> </td> <td> </td> <td> ");
|
||||
buf.append("</td></tr>\n");
|
||||
}
|
||||
|
||||
|
@ -1771,7 +1771,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
buf.append("<tr><th class=\"smallhead\" nowrap><a href=\"#def.peer\">Peer</a>");
|
||||
if (sortFlags != FLAG_ALPHA)
|
||||
buf.append(" <a href=\"").append(urlBase).append("?sort=0\">V</a> ");
|
||||
buf.append("</th><th class=\"smallhead\" nowrap><a href=\"#def.dir\">Dir/Intro</a></th><th class=\"smallhead\" nowrap><a href=\"#def.idle\">Idle</a><br>");
|
||||
buf.append("</th><th class=\"smallhead\" nowrap><a href=\"#def.dir\" title=\"Direction/Introduction\">Dir</a></th><th class=\"smallhead\" nowrap><a href=\"#def.idle\">Idle</a><br>");
|
||||
appendSortLinks(buf, urlBase, sortFlags, "Sort by idle inbound", FLAG_IDLE_IN);
|
||||
buf.append("/");
|
||||
appendSortLinks(buf, urlBase, sortFlags, "Sort by idle outbound", FLAG_IDLE_OUT);
|
||||
@ -1819,12 +1819,12 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
if (now-peer.getLastReceiveTime() > 60*60*1000)
|
||||
continue; // don't include old peers
|
||||
|
||||
buf.append("<tr><td align=\"right\" nowrap>");
|
||||
buf.append("<tr> <td class=\"cells\" align=\"left\" nowrap>");
|
||||
buf.append(_context.commSystem().renderPeerHTML(peer.getRemotePeer()));
|
||||
//byte ip[] = peer.getRemoteIP();
|
||||
//if (ip != null)
|
||||
// buf.append(' ').append(_context.blocklist().toStr(ip));
|
||||
buf.append("</td><td nowrap>");
|
||||
buf.append("</td> <td class=\"cells\" nowrap align=\"left\">");
|
||||
if (peer.isInbound())
|
||||
buf.append("<img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound\"/> ");
|
||||
else
|
||||
@ -1862,7 +1862,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
if (idleIn < 0) idleIn = 0;
|
||||
if (idleOut < 0) idleOut = 0;
|
||||
|
||||
buf.append("<td align=\"right\" >");
|
||||
buf.append(" <td class=\"cells\" align=\"right\" >");
|
||||
buf.append(idleIn);
|
||||
buf.append("s/");
|
||||
buf.append(idleOut);
|
||||
@ -1871,7 +1871,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
int recvBps = (idleIn > 2 ? 0 : peer.getReceiveBps());
|
||||
int sendBps = (idleOut > 2 ? 0 : peer.getSendBps());
|
||||
|
||||
buf.append("<td align=\"right\" nowrap>");
|
||||
buf.append(" <td class=\"cells\" align=\"right\" nowrap>");
|
||||
buf.append(formatKBps(recvBps));
|
||||
buf.append("/");
|
||||
buf.append(formatKBps(sendBps));
|
||||
@ -1884,18 +1884,18 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
|
||||
long uptime = now - peer.getKeyEstablishedTime();
|
||||
|
||||
buf.append("<td align=\"right\" >");
|
||||
buf.append(" <td class=\"cells\" align=\"center\" >");
|
||||
buf.append(DataHelper.formatDuration(uptime));
|
||||
buf.append("</td>");
|
||||
|
||||
buf.append("<td align=\"right\" >");
|
||||
buf.append(" <td class=\"cells\" align=\"center\" >");
|
||||
buf.append(peer.getClockSkew());
|
||||
buf.append("s</td>");
|
||||
offsetTotal = offsetTotal + peer.getClockSkew();
|
||||
|
||||
long sendWindow = peer.getSendWindowBytes();
|
||||
|
||||
buf.append("<td align=\"right\" >");
|
||||
buf.append(" <td class=\"cells\" align=\"right\" >");
|
||||
buf.append(sendWindow/1024);
|
||||
buf.append("K");
|
||||
buf.append("/").append(peer.getConcurrentSends());
|
||||
@ -1903,26 +1903,26 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
buf.append("/").append(peer.getConsecutiveSendRejections());
|
||||
buf.append("</td>");
|
||||
|
||||
buf.append("<td align=\"right\" >");
|
||||
buf.append(" <td class=\"cells\" align=\"center\" >");
|
||||
buf.append(peer.getSlowStartThreshold()/1024);
|
||||
buf.append("K</td>");
|
||||
|
||||
int rtt = peer.getRTT();
|
||||
int rto = peer.getRTO();
|
||||
|
||||
buf.append("<td align=\"right\" >");
|
||||
buf.append(" <td class=\"cells\" align=\"right\" >");
|
||||
buf.append(rtt);
|
||||
buf.append("</td>");
|
||||
|
||||
buf.append("<td align=\"right\" >");
|
||||
buf.append(" <td class=\"cells\" align=\"right\" >");
|
||||
buf.append(peer.getRTTDeviation());
|
||||
buf.append("</td>");
|
||||
|
||||
buf.append("<td align=\"right\" >");
|
||||
buf.append(" <td class=\"cells\" align=\"right\" >");
|
||||
buf.append(rto);
|
||||
buf.append("</td>");
|
||||
|
||||
buf.append("<td align=\"right\" >");
|
||||
buf.append(" <td class=\"cells\" align=\"right\" >");
|
||||
buf.append(peer.getMTU()).append("/").append(peer.getReceiveMTU());
|
||||
|
||||
//.append('/');
|
||||
@ -1933,11 +1933,11 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
long sent = peer.getPacketsTransmitted();
|
||||
long recv = peer.getPacketsReceived();
|
||||
|
||||
buf.append("<td align=\"right\" >");
|
||||
buf.append(" <td class=\"cells\" align=\"center\" >");
|
||||
buf.append(sent);
|
||||
buf.append("</td>");
|
||||
|
||||
buf.append("<td align=\"right\" >");
|
||||
buf.append(" <td class=\"cells\" align=\"center\" >");
|
||||
buf.append(recv);
|
||||
buf.append("</td>");
|
||||
|
||||
@ -1949,14 +1949,14 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
long resent = peer.getPacketsRetransmitted();
|
||||
long dupRecv = peer.getPacketsReceivedDuplicate();
|
||||
|
||||
buf.append("<td align=\"right\" >");
|
||||
buf.append(" <td class=\"cells\" align=\"center\" >");
|
||||
//buf.append(formatPct(sendLostPct));
|
||||
buf.append(resent); // + "/" + peer.getPacketsPeriodRetransmitted() + "/" + sent);
|
||||
//buf.append(peer.getPacketRetransmissionRate());
|
||||
buf.append("</td>");
|
||||
|
||||
double recvDupPct = (double)peer.getPacketsReceivedDuplicate()/(double)peer.getPacketsReceived();
|
||||
buf.append("<td align=\"right\" >");
|
||||
buf.append(" <td class=\"cells\" align=\"center\" >");
|
||||
buf.append(dupRecv); //formatPct(recvDupPct));
|
||||
buf.append("</td>");
|
||||
|
||||
@ -1980,24 +1980,24 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
numPeers++;
|
||||
}
|
||||
|
||||
buf.append("<tr><td colspan=\"16\"><hr /></td></tr>\n");
|
||||
buf.append(" <tr><td colspan=\"3\"><b>Total</b></td>");
|
||||
buf.append(" <td align=\"right\" nowrap><b>");
|
||||
// buf.append("<tr><td colspan=\"16\"><hr /></td></tr>\n");
|
||||
buf.append(" <tr class=\"tablefooter\"> <td colspan=\"3\" align=\"right\"><b>Total</b></td>");
|
||||
buf.append(" <td align=\"center\" nowrap><b>");
|
||||
buf.append(formatKBps(bpsIn)).append("/").append(formatKBps(bpsOut));
|
||||
buf.append("K/s</b></td>");
|
||||
buf.append(" <td align=\"right\"><b>").append(numPeers > 0 ? DataHelper.formatDuration(uptimeMsTotal/numPeers) : "0s");
|
||||
buf.append("</b></td><td align=\"right\"><b>").append(numPeers > 0 ? DataHelper.formatDuration(offsetTotal*1000/numPeers) : "0ms").append("</b></td>\n");
|
||||
buf.append(" <td align=\"right\"><b>");
|
||||
buf.append(" <td align=\"center\"><b>").append(numPeers > 0 ? DataHelper.formatDuration(uptimeMsTotal/numPeers) : "0s");
|
||||
buf.append("</b></td> <td align=\"center\"><b>").append(numPeers > 0 ? DataHelper.formatDuration(offsetTotal*1000/numPeers) : "0ms").append("</b></td>\n");
|
||||
buf.append(" <td align=\"center\"><b>");
|
||||
buf.append(numPeers > 0 ? cwinTotal/(numPeers*1024) + "K" : "0K");
|
||||
buf.append("</b></td><td> </td>\n");
|
||||
buf.append(" <td align=\"right\"><b>");
|
||||
buf.append("</b></td> <td> </td>\n");
|
||||
buf.append(" <td align=\"center\"><b>");
|
||||
buf.append(numPeers > 0 ? rttTotal/numPeers : 0);
|
||||
buf.append("</b></td><td align=\"right\"> </td><td align=\"right\"><b>");
|
||||
buf.append("</b></td> <td> </td> <td align=\"center\"><b>");
|
||||
buf.append(numPeers > 0 ? rtoTotal/numPeers : 0);
|
||||
buf.append("</b></td>\n <td> </td><td align=\"right\"><b>");
|
||||
buf.append(sendTotal).append("</td></b><td align=\"right\"><b>").append(recvTotal).append("</b></td>\n");
|
||||
buf.append(" <td align=\"right\"><b>").append(resentTotal);
|
||||
buf.append("</b></td><td align=\"right\"><b>").append(dupRecvTotal).append("</b></td>\n");
|
||||
buf.append("</b></td>\n <td> </td> <td align=\"center\"><b>");
|
||||
buf.append(sendTotal).append("</td></b> <td align=\"center\"><b>").append(recvTotal).append("</b></td>\n");
|
||||
buf.append(" <td align=\"center\"><b>").append(resentTotal);
|
||||
buf.append("</b></td> <td align=\"center\"><b>").append(dupRecvTotal).append("</b></td>\n");
|
||||
buf.append(" </tr></table></p><p>\n");
|
||||
long bytesTransmitted = _context.bandwidthLimiter().getTotalAllocatedOutboundBytes();
|
||||
// NPE here early
|
||||
@ -2026,7 +2026,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
}
|
||||
}
|
||||
|
||||
private static final String KEY = "<h3>Explanation of abbreviated terms used.</h3><div class=\"configure\">" +
|
||||
private static final String KEY = "<h3>Definitions:</h3><div class=\"configure\">" +
|
||||
"<br><b id=\"def.peer\">Peer</b>: the remote peer.<br />\n" +
|
||||
"<b id=\"def.dir\">Dir</b>: v means they offer to introduce us, ^ means we offer to introduce them.<br />\n" +
|
||||
"<b id=\"def.idle\">Idle</b>: the idle time is how long since a packet has been received or sent.<br />\n" +
|
||||
@ -2034,9 +2034,9 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
"<b id=\"def.up\">Up</b>: the uptime is how long ago this session was established.<br />\n" +
|
||||
"<b id=\"def.skew\">Skew</b>: the skew says how far off the other user's clock is, relative to your own.<br />\n" +
|
||||
"<b id=\"def.cwnd\">Cwnd</b>: the congestion window is how many bytes in 'in flight' you can send w/out an acknowledgement, / <br />\n" +
|
||||
" the number of currently active messages being sent, /<br />\n" +
|
||||
" the maximum number of concurrent messages to send, /<br />\n"+
|
||||
" the number of consecutive sends which were blocked due to throws message window size.<br />\n" +
|
||||
" the number of currently active messages being sent, /<br />\n" +
|
||||
" the maximum number of concurrent messages to send, /<br />\n"+
|
||||
" the number of consecutive sends which were blocked due to throws message window size.<br />\n" +
|
||||
"<b id=\"def.ssthresh\">Sst</b>: the slow start threshold helps make sure the cwnd doesn't grow too fast.<br />\n" +
|
||||
"<b id=\"def.rtt\">Rtt</b>: the round trip time is how long it takes to get an acknowledgement of a packet.<br />\n" +
|
||||
"<b id=\"def.dev\">Dev</b>: the standard deviation of the round trip time, to help control the retransmit timeout.<br />\n" +
|
||||
|
@ -455,41 +455,41 @@ public class TunnelPoolManager implements TunnelManagerFacade {
|
||||
}
|
||||
out.write("<tr>");
|
||||
if (cfg.getReceiveTunnel() != null)
|
||||
out.write("<td align=\"center\">" + cfg.getReceiveTunnel().getTunnelId() +"</td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + cfg.getReceiveTunnel().getTunnelId() +"</td>");
|
||||
else
|
||||
out.write("<td align=\"center\">n/a</td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\">n/a</td>");
|
||||
if (cfg.getReceiveFrom() != null)
|
||||
out.write("<td align=\"right\">" + netDbLink(cfg.getReceiveFrom()) +"</td>");
|
||||
out.write(" <td class=\"cells\" align=\"right\">" + netDbLink(cfg.getReceiveFrom()) +"</td>");
|
||||
else
|
||||
out.write("<td align=\"center\"> </td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\"> </td>");
|
||||
if (cfg.getSendTunnel() != null)
|
||||
out.write("<td align=\"center\">" + cfg.getSendTunnel().getTunnelId() +"</td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + cfg.getSendTunnel().getTunnelId() +"</td>");
|
||||
else
|
||||
out.write("<td align=\"center\"> </td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\"> </td>");
|
||||
if (cfg.getSendTo() != null)
|
||||
out.write("<td align=\"center\">" + netDbLink(cfg.getSendTo()) +"</td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + netDbLink(cfg.getSendTo()) +"</td>");
|
||||
else
|
||||
// out.write("<td align=\"center\"> </td>");
|
||||
out.write("<td align=\"center\"> </td>");
|
||||
// out.write(" <td class=\"cells\" align=\"center\"> </td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\"> </td>");
|
||||
long timeLeft = cfg.getExpiration()-_context.clock().now();
|
||||
if (timeLeft > 0)
|
||||
out.write("<td align=\"center\">" + DataHelper.formatDuration(timeLeft) + "</td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + DataHelper.formatDuration(timeLeft) + "</td>");
|
||||
else
|
||||
out.write("<td align=\"center\">(grace period)</td>");
|
||||
out.write("<td align=\"center\">" + cfg.getProcessedMessagesCount() + "KB</td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\">(grace period)</td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + cfg.getProcessedMessagesCount() + "KB</td>");
|
||||
int lifetime = (int) ((_context.clock().now() - cfg.getCreation()) / 1000);
|
||||
if (lifetime <= 0)
|
||||
lifetime = 1;
|
||||
if (lifetime > 10*60)
|
||||
lifetime = 10*60;
|
||||
int bps = 1024 * (int) cfg.getProcessedMessagesCount() / lifetime;
|
||||
out.write("<td align=\"center\">" + bps + "Bps</td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + bps + "Bps</td>");
|
||||
if (cfg.getSendTo() == null)
|
||||
out.write("<td align=\"center\">Outbound Endpoint</td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\">Outbound Endpoint</td>");
|
||||
else if (cfg.getReceiveFrom() == null)
|
||||
out.write("<td align=\"center\">Inbound Gateway</td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\">Inbound Gateway</td>");
|
||||
else
|
||||
out.write("<td align=\"center\">Participant</td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\">Participant</td>");
|
||||
out.write("</tr>\n");
|
||||
processed += cfg.getProcessedMessagesCount();
|
||||
}
|
||||
@ -543,23 +543,23 @@ public class TunnelPoolManager implements TunnelManagerFacade {
|
||||
continue; // don't display tunnels in their grace period
|
||||
live++;
|
||||
if (info.isInbound())
|
||||
out.write("<tr><td align=\"center\"><img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound\"/></td>");
|
||||
out.write("<tr> <td class=\"cells\" align=\"center\"><img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound\"/></td>");
|
||||
else
|
||||
out.write("<tr><td align=\"center\"><img src=\"/themes/console/images/outbound.png\" alt=\"Outbound\" title=\"Outbound\"/></td>");
|
||||
out.write("<td align=\"center\">" + DataHelper.formatDuration(timeLeft) + "</td>\n");
|
||||
out.write("<td align=\"center\">" + info.getProcessedMessagesCount() + "KB</td>\n");
|
||||
out.write("<tr> <td class=\"cells\" align=\"center\"><img src=\"/themes/console/images/outbound.png\" alt=\"Outbound\" title=\"Outbound\"/></td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + DataHelper.formatDuration(timeLeft) + "</td>\n");
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + info.getProcessedMessagesCount() + "KB</td>\n");
|
||||
for (int j = 0; j < info.getLength(); j++) {
|
||||
Hash peer = info.getPeer(j);
|
||||
TunnelId id = (info.isInbound() ? info.getReceiveTunnelId(j) : info.getSendTunnelId(j));
|
||||
if (_context.routerHash().equals(peer)) {
|
||||
out.write("<td align=\"center\">" + (id == null ? "" : "" + id) + "</td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + (id == null ? "" : "" + id) + "</td>");
|
||||
} else {
|
||||
String cap = getCapacity(peer);
|
||||
out.write("<td align=\"center\">" + netDbLink(peer) + (id == null ? "" : " " + id) + cap + "</td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + netDbLink(peer) + (id == null ? "" : " " + id) + cap + "</td>");
|
||||
}
|
||||
if (info.getLength() < maxLength && (info.getLength() == 1 || j == info.getLength() - 2)) {
|
||||
for (int k = info.getLength(); k < maxLength; k++)
|
||||
out.write("<td align=\"center\"> </td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\"> </td>");
|
||||
}
|
||||
}
|
||||
out.write("</tr>\n");
|
||||
@ -605,25 +605,25 @@ public class TunnelPoolManager implements TunnelManagerFacade {
|
||||
out.write("<h2><a name=\"peers\"></a>Tunnel Counts By Peer:</h2>\n");
|
||||
out.write("<table><tr><th>Peer</th><th>Expl. + Client</th><th>% of total</th><th>Part. from + to</th><th>% of total</th></tr>\n");
|
||||
for (Hash h : peerList) {
|
||||
out.write("<tr><td align=\"center\">");
|
||||
out.write("<tr> <td class=\"cells\" align=\"center\">");
|
||||
out.write(netDbLink(h));
|
||||
out.write("<td align=\"center\">" + lc.count(h));
|
||||
out.write("<td align=\"center\">");
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + lc.count(h));
|
||||
out.write(" <td class=\"cells\" align=\"center\">");
|
||||
if (tunnelCount > 0)
|
||||
out.write("" + (lc.count(h) * 100 / tunnelCount));
|
||||
else
|
||||
out.write('0');
|
||||
out.write("<td align=\"center\">" + pc.count(h));
|
||||
out.write("<td align=\"center\">");
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + pc.count(h));
|
||||
out.write(" <td class=\"cells\" align=\"center\">");
|
||||
if (partCount > 0)
|
||||
out.write("" + (pc.count(h) * 100 / partCount));
|
||||
else
|
||||
out.write('0');
|
||||
out.write('\n');
|
||||
}
|
||||
out.write("<tr><td align=\"center\"><b>Tunnels</b><td align=\"center\"><b>" + tunnelCount);
|
||||
out.write("</b><td> </td><td align=\"center\"><b>" + partCount);
|
||||
out.write("</b><td> </td></tr></table>\n");
|
||||
out.write("<tr class=\"tablefooter\"> <td align=\"center\"><b>Tunnels</b> <td align=\"center\"><b>" + tunnelCount);
|
||||
out.write("</b> <td> </td> <td align=\"center\"><b>" + partCount);
|
||||
out.write("</b> <td> </td></tr></table>\n");
|
||||
}
|
||||
|
||||
/** @return total number of non-fallback expl. + client tunnels */
|
||||
|
Reference in New Issue
Block a user