UI fixes: text boxes, buttons, radio/checkbox width. Enhanced /peers.jsp.

This commit is contained in:
z3d
2009-07-31 19:15:35 +00:00
parent 2f4c428316
commit 24e83398ba
11 changed files with 246 additions and 126 deletions

View File

@ -81,28 +81,28 @@ function toggleAll(category)
<table>
<% while (statshelper.hasMoreStats()) {
while (statshelper.groupRequired()) { %>
<tr><td align="left" colspan="3">
<tr class="tablefooter"><td align="left" colspan="3">
<b><%=statshelper.getCurrentGroupName()%></b>
(<a href="javascript: void(null);" onclick="toggleAll('<%=statshelper.getCurrentGroupName()%>')">toggle all</a>)
</td></tr><tr><td><b>Log</b></td><td><b>Graph</b></td><td></td></tr><%
</td></tr><tr class="tablefooter"><td align="center"><b>Log</b></td><td align="center"><b>Graph</b></td><td></td></tr><%
} // end iterating over required groups for the current stat %>
<tr><td align="left">
<tr><td align="center">
<a name="<%=statshelper.getCurrentStatName()%>"></a>
<input id="<%=statshelper.getCurrentGroupName()%>" type="checkbox" class="optbox" name="statList" value="<%=statshelper.getCurrentStatName()%>" <%
if (statshelper.getCurrentIsLogged()) { %>checked="true" <% } %>/></td>
<td align="left">
<td align="center">
<% if (statshelper.getCurrentCanBeGraphed()) { %>
<input id="<%=statshelper.getCurrentGroupName()%>" type="checkbox" class="optbox" name="graphList" value="<%=statshelper.getCurrentGraphName()%>" <%
if (statshelper.getCurrentIsGraphed()) { %>checked="true" <% } %>/><% } %></td>
<td align="left"><b><%=statshelper.getCurrentStatName()%>:</b><br />
<%=statshelper.getCurrentStatDescription()%></td></tr><%
} // end iterating over all stats %>
<tr><td colspan="3"><hr /></td></tr>
<tr><td><input type="checkbox" class="optbox" name="explicitFilter" /></td>
<tr><td colspan="3"></td></tr>
<tr><td align="center"><input type="checkbox" class="optbox" name="explicitFilter" /></td>
<td colspan="2">Advanced filter:
<input type="text" name="explicitFilterValue" value="<%=statshelper.getExplicitFilter()%>" size="40" /></td></tr>
<tr><td colspan="3"><hr /></td></tr>
<tr><td><input type="submit" name="shouldsave" value="Save changes" /> </td>
<tr><td colspan="3"></td></tr>
<tr class="tablefooter"><td><input type="submit" name="shouldsave" value="Save changes" /> </td>
<td><input type="reset" value="Cancel" /></td><td></td></tr></form>
</table>
</div>

View File

@ -62,7 +62,7 @@
if (!shutdownSoon) {
out.print("<hr /><p><form action=\"summaryframe.jsp\" method=\"GET\">\n");
if ("0".equals(d)) {
out.print("<b>Refresh (s):<b> <input size=\"3\" type=\"text\" name=\"refresh\" value=\"60\" />\n");
out.print("<b>Refresh (s):<b> <input size=\"3\" type=\"text\" name=\"refresh\" value=\"60\" align=\"right\" />\n");
out.print("<button type=\"submit\">Enable</button>\n");
} else {
// this will load in the iframe but subsequent pages will not have the iframe

View File

@ -1,3 +1,10 @@
2009-07-31 dr|z3d
* Resolve anomalous buttons and text fields in console ui.
* Enhance presentation of data in /peers.jsp.
* Fix themes issue with horizontal width of radio/checkbox icons.
(Radioboxes currently non-functional in Opera).
* Other cosmetic UI enhancements.
* 2009-07-31 0.7.6 released
2009-07-31 zzz

View File

@ -65,7 +65,7 @@ div.toolbar a:visited {
}
div.toolbar a:hover, button:hover{
border: 1px solid #eeeeff;
border: 1px solid #f60;
background: #003;
color: #f60;
}
@ -255,13 +255,14 @@ table {
}
th {
padding: 6px 3px;
padding: 6px 2px;
color: #eef;
text-align: center;
font-size: 8pt;
font-size: 9pt;
background: #004 url('images/tabletitledark.png') repeat-x;
border-top: 1px solid #99f;
border-bottom: 1px solid #99f;
border-bottom: 1px solid #99f !important;
line-height: 110%;
}
tr {
@ -285,7 +286,7 @@ tr:last-child {
}
*/
td {
padding: 6px 4px;
padding: 6px 3px;
color: #eef;
vertical-align: middle;
border-top: 1px inset #006;
@ -435,6 +436,7 @@ h4 {
}
button {
font: bold 9pt "Lucida Sans Unicode", "Bitstream Vera Sans", Verdana, Tahoma, Helvetica, sans-serif;
border: 1px outset #ddddc0;
padding: 1px 3px;
background: #bbf;
@ -486,37 +488,62 @@ sidebarlogo {
}
input {
border: 1px outset #bbf;
background: #bbf;
color: #002;
margin: 5px;
font: bold 9pt "Lucida Sans Unicode", "Bitstream Vera Sans", Verdana, Tahoma, Helvetica, sans-serif;
border: 1px solid #99f;
padding: 1px 2px;
text-decoration: none;
min-width: 110px;
opacity: 0.8;
border-radius: 4px;
-moz-border-radius: 4px;
-khtml-border-radius: 4px;
}
input:hover {
background: #eef;
color: #001;
background: #003;
color: #f60;
border: 1px solid #f60;
}
input:active {
background: #002;
color: #f30;
border: 1px solid #f30;
}
input:active {
border: 1px inset #f60;
background: #f60;
color: #fff;
border: 1px solid #f60;
}
input[type=text] {
background: #002;
color: #eef;
margin: 5px 10px;
padding: 4px 2px;
font: bold 8pt "Lucida Sans Unicode", "Bitstream Vera Sans", Verdana, Tahoma, Helvetica, sans-serif;
border: 1px solid #bbf;
text-decoration: none;
border-radius: 4px;
-moz-border-radius: 4px;
-khtml-border-radius: 4px;
}
input[type=text]:active, input[type=text]:hover {
background: #001;
}
select {
background: #002;
color: #eef;
margin: 5px;
border: 1px solid #99f;
border-radius: 0;
-moz-border-radius: 0;
-khtml-border-radius: 0;
margin: 5px 10px;
border: 1px solid #bbf;
border-radius: 4px;
-moz-border-radius: 4px;
-khtml-border-radius: 4px;
min-width: 110px;
font: 9pt "Lucida Sans Unicode", "Bitstream Vera Sans", Verdana, Tahoma, Helvetica, sans-serif;
padding: 2px;
@ -526,13 +553,13 @@ textarea {
background: #001;
color: #eef;
padding: 5px;
margin: 15px 15px 5px 0px;
margin: 10px;
border-radius: 4px;
-moz-border-radius: 4px;
-khtml-border-radius: 4px;
font: 9pt "Lucida Console", "DejaVu Sans Mono", Courier, mono;
min-height: 100px;
min-width: 100%;
min-width: 97%;
text-align: left;
border: 1px solid #99f;
}
@ -596,4 +623,41 @@ form {}
.mediumtags {
font-size: 9pt;
}
.optbox {
min-width: 16px !important;
max-width: 16px !important;
width: 16px !important;
min-height: 16px;
max-height: 16px;
height: 16px;
opacity: 1.0;
border: 0;
margin: 0 0 0 10px;
}
.optbox:hover {
min-width: 16px !important;
max-width: 16px !important;
width: 16px !important;
min-height: 16px;
max-height: 16px;
height: 16px;
opacity: 1.0;
border: 0;
margin: 0 0 0 10px;
}
.cells {
border: 1px inset #005;
border-left: 1px outset #002;
}
.tablefooter tr, .tablefooter td {
background: #004 url('images/tabletitledark.png') repeat-x !important;
border-top: 1px solid #99f;
border-bottom: 1px solid #99f !important;
font-size: 8pt;
line-height: 110%;
}

View File

@ -299,6 +299,7 @@ table {
cell-padding: 1px;
font-size: 7pt;
background: #b4c8ff url('images/tabletitlelight.png') repeat-x;
font: 7pt/130% "Lucida Sans Unicode", Verdana, Bitstream Vera Sans", Tahoma, Helvetica, sans-serif;
}
th {
@ -307,8 +308,9 @@ th {
background: #b4c8ff url('images/tabletitlelight.png') repeat-x;
text-align: center;
font-size: 9pt;
border-bottom: 1px solid #001;
border-top: 1px solid #001;
line-height: 110%;
border-bottom: 1px solid #001 !important;
border-top: 1px solid #001 !important;
}
tr {
@ -331,7 +333,7 @@ tr:last-child {
}
*/
td {
padding: 5px;
padding: 5px 3px;
color: #000;
vertical-align: middle;
border-top: 1px inset #001;
@ -473,7 +475,8 @@ h4 {
font-size: 11pt;
}
button {
button, button:visited {
font: bold 9pt "Lucida Sans Unicode", "Bitstream Vera Sans", Verdana, Tahoma, Helvetica, sans-serif;
border: 1px outset #ddddc0;
padding: 1px 3px;
background: #bbf !important;
@ -526,9 +529,23 @@ input {
border: 1px solid #001;
text-decoration: none;
min-width: 110px;
opacity: 0.8;
}
input, input:visited {
border: 1px outset #bbf;
background: #bbf;
color: #001;
margin: 5px;
font: bold 8pt "Lucida Sans Unicode", "Bitstream Vera Sans", Verdana, Tahoma, Helvetica, sans-serif;
padding: 1px 2px;
text-decoration: none;
min-width: 110px;
border-radius: 4px;
-moz-border-radius: 4px;
-khtml-border-radius: 4px;
}
input:hover {
background: #f60;
color: #fff;
@ -543,6 +560,16 @@ input:active {
opacity: 1.0;
}
input[type=text] {
background: #eef;
color: #001;
margin: 5px 10px 5px 10px;
padding: 4px 2px;
font: bold 8pt "Lucida Sans Unicode", "Bitstream Vera Sans", Verdana, Tahoma, Helvetica, sans-serif;
border: 1px solid #001;
text-decoration: none;
}
submit {
background: #f00;
color: #eef;
@ -566,11 +593,14 @@ select {
border: 1px solid #001;
min-width: 110px;
font: 9pt "Lucida Sans Unicode", "Bitstream Vera Sans", Verdana, Tahoma, Helvetica, sans-serif;
border-radius: 4px;
-moz-border-radius: 4px;
-khtml-border-radius: 4px;
}
textarea {
padding: 5px;
margin: 15px 15px 5px 0px;
margin: 5px 15px 5px 10px;
background: #eef;
color: #003;
border-radius: 4px;
@ -578,7 +608,7 @@ textarea {
-khtml-border-radius: 4px;
font: 8pt "Lucida Console", "DejaVu Sans Mono", Courier, mono;
min-height: 100px;
min-width: 100%;
min-width: 97%;
border: 1px solid #001;
}
@ -663,4 +693,23 @@ form {}
height: 16px;
opacity: 1.0;
border: 0;
}
.cells {
border-left: 1px outset #bbf;
border-top: 1px inset #99f !important;
border-bottom: 1px inset #99f !important;
}
.tablefooter {
background: #b4c8ff url('images/tabletitlelight.png') repeat-x;
}
.tablefooter tr, .tablefooter td {
background: #b4c8ff url('images/tabletitlelight.png') repeat-x;
border-top: 1px solid #001;
border-bottom: 1px solid #001 !important;
padding: 8px 2px !important;
font-size: 8pt;
line-height: 110%;
}

View File

@ -35,7 +35,7 @@
<p></p>
There are many more eepsites - just follow the links from the ones you see,
bookmark your favorites, and visit them often!
</ul>
</ul></ul>
<br />
<br />
<ul>

View File

@ -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);

View File

@ -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();
}

View File

@ -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>&nbsp;</td><td>&nbsp;");
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>&nbsp;</td><td>&nbsp;</td><td>&nbsp;");
// 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>&nbsp;</td> <td>&nbsp;");
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>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;");
buf.append("</td></tr>\n");
}

View File

@ -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>&nbsp;</td>\n");
buf.append(" <td align=\"right\"><b>");
buf.append("</b></td> <td>&nbsp;</td>\n");
buf.append(" <td align=\"center\"><b>");
buf.append(numPeers > 0 ? rttTotal/numPeers : 0);
buf.append("</b></td><td align=\"right\">&nbsp;</td><td align=\"right\"><b>");
buf.append("</b></td> <td>&nbsp;</td> <td align=\"center\"><b>");
buf.append(numPeers > 0 ? rtoTotal/numPeers : 0);
buf.append("</b></td>\n <td>&nbsp;</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>&nbsp;</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" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the number of currently active messages being sent, /<br />\n" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the maximum number of concurrent messages to send, /<br />\n"+
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the number of consecutive sends which were blocked due to throws message window size.<br />\n" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the number of currently active messages being sent, /<br />\n" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the maximum number of concurrent messages to send, /<br />\n"+
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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" +

View File

@ -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\">&nbsp;</td>");
out.write(" <td class=\"cells\" align=\"center\">&nbsp;</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\">&nbsp;</td>");
out.write(" <td class=\"cells\" align=\"center\">&nbsp;</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\">&nbsp;</td>");
out.write("<td align=\"center\">&nbsp;</td>");
// out.write(" <td class=\"cells\" align=\"center\">&nbsp;</td>");
out.write(" <td class=\"cells\" align=\"center\">&nbsp;</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\">&nbsp</td>");
out.write(" <td class=\"cells\" align=\"center\">&nbsp</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>&nbsp;</td><td align=\"center\"><b>" + partCount);
out.write("</b><td>&nbsp;</td></tr></table>\n");
out.write("<tr class=\"tablefooter\"> <td align=\"center\"><b>Tunnels</b> <td align=\"center\"><b>" + tunnelCount);
out.write("</b> <td>&nbsp;</td> <td align=\"center\"><b>" + partCount);
out.write("</b> <td>&nbsp;</td></tr></table>\n");
}
/** @return total number of non-fallback expl. + client tunnels */