Ongoing UI enhancements; peers.jsp gets some love.

This commit is contained in:
z3d
2009-07-30 23:10:48 +00:00
parent 6e7ad3ecdb
commit 4de0b73cd8
17 changed files with 192 additions and 170 deletions

View File

@ -711,7 +711,7 @@ public class I2PSnarkServlet extends HttpServlet {
out.write("<span class=\"snarkConfigTitle\">Configuration:</span><br />\n"); out.write("<span class=\"snarkConfigTitle\">Configuration:</span><br />\n");
out.write("Data directory: <input type=\"text\" size=\"40\" name=\"dataDir\" value=\"" + dataDir + "\" "); out.write("Data directory: <input type=\"text\" size=\"40\" name=\"dataDir\" value=\"" + dataDir + "\" ");
out.write("title=\"Directory to store torrents and data\" disabled=\"true\" /> <i>(Edit i2psnark.config and restart to change)</i><br />\n"); out.write("title=\"Directory to store torrents and data\" disabled=\"true\" /> <i>(Edit i2psnark.config and restart to change)</i><br />\n");
out.write("Auto start: <input type=\"checkbox\" name=\"autoStart\" value=\"true\" " out.write("Auto start: <input type=\"checkbox\" class=\"optbox\" name=\"autoStart\" value=\"true\" "
+ (autoStart ? "checked " : "") + (autoStart ? "checked " : "")
+ "title=\"If true, automatically start torrents that are added\" />"); + "title=\"If true, automatically start torrents that are added\" />");
//Auto add: <input type="checkbox" name="autoAdd" value="true" title="If true, automatically add torrents that are found in the data directory" /> //Auto add: <input type="checkbox" name="autoAdd" value="true" title="If true, automatically add torrents that are found in the data directory" />
@ -738,7 +738,7 @@ public class I2PSnarkServlet extends HttpServlet {
out.write("Up bandwidth limit: <input type=\"text\" name=\"upBW\" value=\"" out.write("Up bandwidth limit: <input type=\"text\" name=\"upBW\" value=\""
+ _manager.util().getMaxUpBW() + "\" size=\"3\" maxlength=\"3\" /> KBps <i>(Half <a href=\"/config.jsp\" target=\"blank\">available bandwidth</a> recommended.)</i><br />\n"); + _manager.util().getMaxUpBW() + "\" size=\"3\" maxlength=\"3\" /> KBps <i>(Half <a href=\"/config.jsp\" target=\"blank\">available bandwidth</a> recommended.)</i><br />\n");
out.write("Use open trackers also: <input type=\"checkbox\" name=\"useOpenTrackers\" value=\"true\" " out.write("Use open trackers also: <input type=\"checkbox\" class=\"optbox\" name=\"useOpenTrackers\" value=\"true\" "
+ (useOpenTrackers ? "checked " : "") + (useOpenTrackers ? "checked " : "")
+ "title=\"If true, uses open trackers in addition\" /> "); + "title=\"If true, uses open trackers in addition\" /> ");
out.write("Announce URLs: <input type=\"text\" name=\"openTrackers\" value=\"" out.write("Announce URLs: <input type=\"text\" name=\"openTrackers\" value=\""

View File

@ -14,7 +14,7 @@ public class ConfigClientsHelper extends HelperBase {
public String getForm1() { public String getForm1() {
StringBuilder buf = new StringBuilder(1024); StringBuilder buf = new StringBuilder(1024);
buf.append("<table border=\"1\">\n"); buf.append("<table>\n");
buf.append("<tr><th>Client</th><th>Run at Startup?</th><th>Start Now</th><th>Class and arguments</th></tr>\n"); buf.append("<tr><th>Client</th><th>Run at Startup?</th><th>Start Now</th><th>Class and arguments</th></tr>\n");
List clients = ClientAppConfig.getClientApps(_context); List clients = ClientAppConfig.getClientApps(_context);
@ -30,7 +30,7 @@ public class ConfigClientsHelper extends HelperBase {
public String getForm2() { public String getForm2() {
StringBuilder buf = new StringBuilder(1024); StringBuilder buf = new StringBuilder(1024);
buf.append("<table border=\"1\">\n"); buf.append("<table>\n");
buf.append("<tr><th>WebApp</th><th>Run at Startup?</th><th>Start Now</th><th>Description</th></tr>\n"); buf.append("<tr><th>WebApp</th><th>Run at Startup?</th><th>Start Now</th><th>Description</th></tr>\n");
Properties props = RouterConsoleRunner.webAppProperties(); Properties props = RouterConsoleRunner.webAppProperties();
Set keys = new TreeSet(props.keySet()); Set keys = new TreeSet(props.keySet());
@ -56,7 +56,7 @@ public class ConfigClientsHelper extends HelperBase {
} else { } else {
buf.append(name); buf.append(name);
} }
buf.append("</td><td align=\"center\"><input type=\"checkbox\" name=\"").append(index).append(".enabled\" value=\"true\" "); buf.append("</td><td align=\"center\"><input type=\"checkbox\" class=\"optbox\" name=\"").append(index).append(".enabled\" value=\"true\" ");
if (enabled) { if (enabled) {
buf.append("checked=\"true\" "); buf.append("checked=\"true\" ");
if (ro) if (ro)

View File

@ -9,7 +9,7 @@ public class ConfigUIHelper extends HelperBase {
StringBuilder buf = new StringBuilder(512); StringBuilder buf = new StringBuilder(512);
String current = _context.getProperty(CSSHelper.PROP_THEME_NAME, CSSHelper.DEFAULT_THEME); String current = _context.getProperty(CSSHelper.PROP_THEME_NAME, CSSHelper.DEFAULT_THEME);
for (String theme : themes) { for (String theme : themes) {
buf.append("<input type=\"radio\" name=\"theme\" "); buf.append("<input type=\"radio\" class=\"optbox\" name=\"theme\" ");
if (theme.equals(current)) if (theme.equals(current))
buf.append("checked=\"true\" "); buf.append("checked=\"true\" ");
buf.append("value=\"").append(theme).append("\"/>").append(theme).append("<br />\n"); buf.append("value=\"").append(theme).append("\"/>").append(theme).append("<br />\n");

View File

@ -42,10 +42,10 @@ public class ConfigUpdateHelper extends HelperBase {
public String getUpdateThroughProxy() { public String getUpdateThroughProxy() {
String proxy = _context.getProperty(ConfigUpdateHandler.PROP_SHOULD_PROXY, ConfigUpdateHandler.DEFAULT_SHOULD_PROXY); String proxy = _context.getProperty(ConfigUpdateHandler.PROP_SHOULD_PROXY, ConfigUpdateHandler.DEFAULT_SHOULD_PROXY);
if (Boolean.valueOf(proxy).booleanValue()) if (Boolean.valueOf(proxy).booleanValue())
return "<input type=\"checkbox\" value=\"true\" name=\"updateThroughProxy\" checked=\"true\" >"; return "<input type=\"checkbox\" class=\"optbox\" value=\"true\" name=\"updateThroughProxy\" checked=\"true\" >";
else else
return "<input type=\"checkbox\" value=\"true\" name=\"updateThroughProxy\" >"; return "<input type=\"checkbox\" class=\"optbox\" value=\"true\" name=\"updateThroughProxy\" >";
} }
private static final long PERIODS[] = new long[] { 12*60*60*1000l, 24*60*60*1000l, 48*60*60*1000l, -1l }; private static final long PERIODS[] = new long[] { 12*60*60*1000l, 24*60*60*1000l, 48*60*60*1000l, -1l };

View File

@ -109,8 +109,8 @@ public class GraphHelper extends HelperBase {
_out.write("<p />[<a href=\"configstats.jsp\">Select Stats to Graph</a>]<p />"); _out.write("<p />[<a href=\"configstats.jsp\">Select Stats to Graph</a>]<p />");
_out.write("<form action=\"graphs.jsp\" method=\"GET\">"); _out.write("<form action=\"graphs.jsp\" method=\"GET\">");
_out.write("Periods: <input size=\"3\" type=\"text\" name=\"periodCount\" value=\"" + _periodCount + "\" /><br />\n"); _out.write("Periods: <input size=\"3\" type=\"text\" name=\"periodCount\" value=\"" + _periodCount + "\" /><br />\n");
_out.write("Plot averages: <input type=\"radio\" name=\"showEvents\" value=\"false\" " + (_showEvents ? "" : "checked=\"true\" ") + " /> "); _out.write("Plot averages: <input type=\"radio\" class=\"optbox\" name=\"showEvents\" value=\"false\" " + (_showEvents ? "" : "checked=\"true\" ") + " /> ");
_out.write("or plot events: <input type=\"radio\" name=\"showEvents\" value=\"true\" "+ (_showEvents ? "checked=\"true\" " : "") + " /><br />\n"); _out.write("or plot events: <input type=\"radio\" class=\"optbox\" name=\"showEvents\" value=\"true\" "+ (_showEvents ? "checked=\"true\" " : "") + " /><br />\n");
_out.write("Image sizes: width: <input size=\"4\" type=\"text\" name=\"width\" value=\"" + _width _out.write("Image sizes: width: <input size=\"4\" type=\"text\" name=\"width\" value=\"" + _width
+ "\" /> pixels, height: <input size=\"4\" type=\"text\" name=\"height\" value=\"" + _height + "\" /> pixels, height: <input size=\"4\" type=\"text\" name=\"height\" value=\"" + _height
+ "\" /><br />\n"); + "\" /><br />\n");

View File

@ -59,7 +59,7 @@
out.print("It improves your anonymity by creating cover traffic, and helps the network.<br />"); out.print("It improves your anonymity by creating cover traffic, and helps the network.<br />");
} else { } else {
out.print("You have configured I2P to share<b> " + share + "KBps</b>. "); out.print("You have configured I2P to share<b> " + share + "KBps</b>. ");
out.print("The higher the share bandwidth the more you improve your anonymity and help the network.<br />"); out.print("The higher the share bandwidth the more you improve your anonymity and help the network.<hr />");
} }
%> %>
</p><p> </p><p>
@ -67,7 +67,7 @@
</p> </p>
<!-- <!--
<b>Enable load testing: </b> <b>Enable load testing: </b>
<input type="checkbox" name="enableloadtesting" value="true" <jsp:getProperty name="nethelper" property="enableLoadTesting" /> /> <input type="checkbox" class="optbox" name="enableloadtesting" value="true" <jsp:getProperty name="nethelper" property="enableLoadTesting" /> />
<p>If enabled, your router will periodically anonymously probe some of your peers <p>If enabled, your router will periodically anonymously probe some of your peers
to see what sort of throughput they can handle. This improves your router's ability to see what sort of throughput they can handle. This improves your router's ability
to pick faster peers, but can cost substantial bandwidth. Relevant data from the to pick faster peers, but can cost substantial bandwidth. Relevant data from the
@ -80,20 +80,20 @@
<b>The default settings will work for most people. There is <a href="#chelp">help below</a>.</b> <b>The default settings will work for most people. There is <a href="#chelp">help below</a>.</b>
</p><p> </p><p>
<b>UPnP Configuration:</b><br /> <b>UPnP Configuration:</b><br />
<input type="checkbox" name="upnp" value="true" <jsp:getProperty name="nethelper" property="upnpChecked" /> /> <input type="checkbox" class="optbox" name="upnp" value="true" <jsp:getProperty name="nethelper" property="upnpChecked" /> />
Enable UPnP to open firewall ports - <a href="peers.jsp#upnp">UPnP status</a> Enable UPnP to open firewall ports - <a href="peers.jsp#upnp">UPnP status</a>
</p><p> </p><p>
<b>IP Configuration:</b><br /> <b>IP Configuration:</b><br />
Externally reachable hostname or IP address:<br /> Externally reachable hostname or IP address:<br />
<input type="radio" name="udpAutoIP" value="local,upnp,ssu" <%=nethelper.getUdpAutoIPChecked(3) %> /> <input type="radio" class="optbox" name="udpAutoIP" value="local,upnp,ssu" <%=nethelper.getUdpAutoIPChecked(3) %> />
Use all auto-detect methods<br /> Use all auto-detect methods<br />
<input type="radio" name="udpAutoIP" value="local,ssu" <%=nethelper.getUdpAutoIPChecked(4) %> /> <input type="radio" class="optbox" name="udpAutoIP" value="local,ssu" <%=nethelper.getUdpAutoIPChecked(4) %> />
Disable UPnP IP address detection<br /> Disable UPnP IP address detection<br />
<input type="radio" name="udpAutoIP" value="upnp,ssu" <%=nethelper.getUdpAutoIPChecked(5) %> /> <input type="radio" class="optbox" name="udpAutoIP" value="upnp,ssu" <%=nethelper.getUdpAutoIPChecked(5) %> />
Ignore local interface IP address<br /> Ignore local interface IP address<br />
<input type="radio" name="udpAutoIP" value="ssu" <%=nethelper.getUdpAutoIPChecked(0) %> /> <input type="radio" class="optbox" name="udpAutoIP" value="ssu" <%=nethelper.getUdpAutoIPChecked(0) %> />
Use SSU IP address detection only<br /> Use SSU IP address detection only<br />
<input type="radio" name="udpAutoIP" value="fixed" <%=nethelper.getUdpAutoIPChecked(1) %> /> <input type="radio" class="optbox" name="udpAutoIP" value="fixed" <%=nethelper.getUdpAutoIPChecked(1) %> />
Specify hostname or IP: Specify hostname or IP:
<input name ="udpHost1" type="text" size="16" value="<jsp:getProperty name="nethelper" property="udphostname" />" /> <input name ="udpHost1" type="text" size="16" value="<jsp:getProperty name="nethelper" property="udphostname" />" />
<% String[] ips = nethelper.getAddresses(); <% String[] ips = nethelper.getAddresses();
@ -110,14 +110,14 @@
} }
%> %>
<br /> <br />
<input type="radio" name="udpAutoIP" value="hidden" <%=nethelper.getUdpAutoIPChecked(2) %> /> <input type="radio" class="optbox" name="udpAutoIP" value="hidden" <%=nethelper.getUdpAutoIPChecked(2) %> />
Hidden mode - do not publish IP <i>(prevents participating traffic)</i><br /> Hidden mode - do not publish IP <i>(prevents participating traffic)</i><br />
</p><p> </p><p>
<b>UDP Configuration:</b><br /> <b>UDP Configuration:</b><br />
UDP port: UDP port:
<input name ="udpPort" type="text" size="5" maxlength="5" value="<jsp:getProperty name="nethelper" property="configuredUdpPort" />" /><br /> <input name ="udpPort" type="text" size="5" maxlength="5" value="<jsp:getProperty name="nethelper" property="configuredUdpPort" />" /><br />
<!-- let's keep this simple... <!-- let's keep this simple...
<input type="checkbox" name="requireIntroductions" value="true" <jsp:getProperty name="nethelper" property="requireIntroductionsChecked" /> /> <input type="checkbox" class="optbox" name="requireIntroductions" value="true" <jsp:getProperty name="nethelper" property="requireIntroductionsChecked" /> />
Require SSU introductions Require SSU introductions
<i>(Enable if you cannot open your firewall)</i> <i>(Enable if you cannot open your firewall)</i>
</p><p> </p><p>
@ -126,29 +126,29 @@
</p><p> </p><p>
<b>TCP Configuration:</b><br /> <b>TCP Configuration:</b><br />
Externally reachable hostname or IP address:<br /> Externally reachable hostname or IP address:<br />
<input type="radio" name="ntcpAutoIP" value="true" <%=nethelper.getTcpAutoIPChecked(2) %> /> <input type="radio" class="optbox" name="ntcpAutoIP" value="true" <%=nethelper.getTcpAutoIPChecked(2) %> />
Use auto-detected IP address Use auto-detected IP address
<i>(currently <jsp:getProperty name="nethelper" property="udpIP" />)</i> <i>(currently <jsp:getProperty name="nethelper" property="udpIP" />)</i>
if we are not firewalled<br /> if we are not firewalled<br />
<input type="radio" name="ntcpAutoIP" value="always" <%=nethelper.getTcpAutoIPChecked(3) %> /> <input type="radio" class="optbox" name="ntcpAutoIP" value="always" <%=nethelper.getTcpAutoIPChecked(3) %> />
Always use auto-detected IP address (Not firewalled)<br /> Always use auto-detected IP address (Not firewalled)<br />
<input type="radio" name="ntcpAutoIP" value="false" <%=nethelper.getTcpAutoIPChecked(1) %> /> <input type="radio" class="optbox" name="ntcpAutoIP" value="false" <%=nethelper.getTcpAutoIPChecked(1) %> />
Specify hostname or IP: Specify hostname or IP:
<input name ="ntcphost" type="text" size="16" value="<jsp:getProperty name="nethelper" property="ntcphostname" />" /><br /> <input name ="ntcphost" type="text" size="16" value="<jsp:getProperty name="nethelper" property="ntcphostname" />" /><br />
<input type="radio" name="ntcpAutoIP" value="false" <%=nethelper.getTcpAutoIPChecked(0) %> /> <input type="radio" class="optbox" name="ntcpAutoIP" value="false" <%=nethelper.getTcpAutoIPChecked(0) %> />
Disable inbound (Firewalled)<br /> Disable inbound (Firewalled)<br />
<input type="radio" name="ntcpAutoIP" value="disabled" <%=nethelper.getTcpAutoIPChecked(4) %> /> <input type="radio" class="optbox" name="ntcpAutoIP" value="disabled" <%=nethelper.getTcpAutoIPChecked(4) %> />
Completely disable <i>(select only if behind a firewall that throttles or blocks outbound TCP)</i><br /> Completely disable <i>(select only if behind a firewall that throttles or blocks outbound TCP)</i><br />
</p><p> </p><p>
Externally reachable TCP port:<br /> Externally reachable TCP port:<br />
<input type="radio" name="ntcpAutoPort" value="2" <%=nethelper.getTcpAutoPortChecked(2) %> /> <input type="radio" class="optbox" name="ntcpAutoPort" value="2" <%=nethelper.getTcpAutoPortChecked(2) %> />
Use the same port configured for UDP Use the same port configured for UDP
<i>(currently <jsp:getProperty name="nethelper" property="udpPort" />)</i><br /> <i>(currently <jsp:getProperty name="nethelper" property="udpPort" />)</i><br />
<input type="radio" name="ntcpAutoPort" value="1" <%=nethelper.getTcpAutoPortChecked(1) %> /> <input type="radio" class="optbox" name="ntcpAutoPort" value="1" <%=nethelper.getTcpAutoPortChecked(1) %> />
Specify Port: Specify Port:
<input name ="ntcpport" type="text" size="5" maxlength="5" value="<jsp:getProperty name="nethelper" property="ntcpport" />" /><br /> <input name ="ntcpport" type="text" size="5" maxlength="5" value="<jsp:getProperty name="nethelper" property="ntcpport" />" /><br />
</p><p><b>Note: Changing these settings will restart your router.</b> </p><p><b>Note: Changing these settings will restart your router.</b>
</p> </p><hr>
<input type="submit" name="save" value="Save changes" /> <input type="reset" value="Cancel" /> <input type="submit" name="save" value="Save changes" /> <input type="reset" value="Cancel" />
</div> </div>
<h3><a name="chelp">Configuration Help:</a></h3> <h3><a name="chelp">Configuration Help:</a></h3>
@ -248,7 +248,7 @@
<hr /> <hr />
<!-- <!--
<b>Dynamic Router Keys: </b> <b>Dynamic Router Keys: </b>
<input type="checkbox" name="dynamicKeys" value="true" <jsp:getProperty name="nethelper" property="dynamicKeysChecked" /> /><br /> <input type="checkbox" class="optbox" name="dynamicKeys" value="true" <jsp:getProperty name="nethelper" property="dynamicKeysChecked" /> /><br />
<p> <p>
This setting causes your router identity to be regenerated every time your IP address This setting causes your router identity to be regenerated every time your IP address
changes. If you have a dynamic IP this option can speed up your reintegration into changes. If you have a dynamic IP this option can speed up your reintegration into

View File

@ -73,7 +73,7 @@ function toggleAll(category)
<input type="hidden" name="nonce" value="<%=System.getProperty("net.i2p.router.web.ConfigStatsHandler.nonce")%>" /> <input type="hidden" name="nonce" value="<%=System.getProperty("net.i2p.router.web.ConfigStatsHandler.nonce")%>" />
<h3>Configure I2P Stat Collection</h3> <h3>Configure I2P Stat Collection</h3>
Enable full stats? Enable full stats?
<input type="checkbox" name="isFull" value="true" <% <input type="checkbox" class="optbox" name="isFull" value="true" <%
if (statshelper.getIsFull()) { %>checked="true" <% } %>/> if (statshelper.getIsFull()) { %>checked="true" <% } %>/>
(change requires restart to take effect)<br /> (change requires restart to take effect)<br />
Stat file: <input type="text" name="filename" value="<%=statshelper.getFilename()%>" /><br /> Stat file: <input type="text" name="filename" value="<%=statshelper.getFilename()%>" /><br />
@ -81,24 +81,24 @@ function toggleAll(category)
<table> <table>
<% while (statshelper.hasMoreStats()) { <% while (statshelper.hasMoreStats()) {
while (statshelper.groupRequired()) { %> while (statshelper.groupRequired()) { %>
<tr><td valign="top" align="left" colspan="3"> <tr><td align="left" colspan="3">
<b><%=statshelper.getCurrentGroupName()%></b> <b><%=statshelper.getCurrentGroupName()%></b>
(<a href="javascript: void(null);" onclick="toggleAll('<%=statshelper.getCurrentGroupName()%>')">toggle all</a>) (<a href="javascript: void(null);" onclick="toggleAll('<%=statshelper.getCurrentGroupName()%>')">toggle all</a>)
</td></tr><tr><td>Log</td><td>Graph</td><td></td></tr><% </td></tr><tr><td><b>Log</b></td><td><b>Graph</b></td><td></td></tr><%
} // end iterating over required groups for the current stat %> } // end iterating over required groups for the current stat %>
<tr><td valign="top" align="left"> <tr><td align="left">
<a name="<%=statshelper.getCurrentStatName()%>"></a> <a name="<%=statshelper.getCurrentStatName()%>"></a>
<input id="<%=statshelper.getCurrentGroupName()%>" type="checkbox" name="statList" value="<%=statshelper.getCurrentStatName()%>" <% <input id="<%=statshelper.getCurrentGroupName()%>" type="checkbox" class="optbox" name="statList" value="<%=statshelper.getCurrentStatName()%>" <%
if (statshelper.getCurrentIsLogged()) { %>checked="true" <% } %>/></td> if (statshelper.getCurrentIsLogged()) { %>checked="true" <% } %>/></td>
<td valign="top" align="left"> <td align="left">
<% if (statshelper.getCurrentCanBeGraphed()) { %> <% if (statshelper.getCurrentCanBeGraphed()) { %>
<input id="<%=statshelper.getCurrentGroupName()%>" type="checkbox" name="graphList" value="<%=statshelper.getCurrentGraphName()%>" <% <input id="<%=statshelper.getCurrentGroupName()%>" type="checkbox" class="optbox" name="graphList" value="<%=statshelper.getCurrentGraphName()%>" <%
if (statshelper.getCurrentIsGraphed()) { %>checked="true" <% } %>/><% } %></td> if (statshelper.getCurrentIsGraphed()) { %>checked="true" <% } %>/><% } %></td>
<td valign="top" align="left"><b><%=statshelper.getCurrentStatName()%>:</b><br /> <td align="left"><b><%=statshelper.getCurrentStatName()%>:</b><br />
<%=statshelper.getCurrentStatDescription()%></td></tr><% <%=statshelper.getCurrentStatDescription()%></td></tr><%
} // end iterating over all stats %> } // end iterating over all stats %>
<tr><td colspan="3"><hr /></td></tr> <tr><td colspan="3"><hr /></td></tr>
<tr><td><input type="checkbox" name="explicitFilter" /></td> <tr><td><input type="checkbox" class="optbox" name="explicitFilter" /></td>
<td colspan="2">Advanced filter: <td colspan="2">Advanced filter:
<input type="text" name="explicitFilterValue" value="<%=statshelper.getExplicitFilter()%>" size="40" /></td></tr> <input type="text" name="explicitFilterValue" value="<%=statshelper.getExplicitFilter()%>" size="40" /></td></tr>
<tr><td colspan="3"><hr /></td></tr> <tr><td colspan="3"><hr /></td></tr>

View File

@ -1545,7 +1545,7 @@ public class WebMail extends HttpServlet
"<tr><td align=\"right\">Cc:</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_CC + "\" value=\"" + cc + "\"></td></tr>\n" + "<tr><td align=\"right\">Cc:</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_CC + "\" value=\"" + cc + "\"></td></tr>\n" +
"<tr><td align=\"right\">Bcc:</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_BCC + "\" value=\"" + bcc + "\"></td></tr>\n" + "<tr><td align=\"right\">Bcc:</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_BCC + "\" value=\"" + bcc + "\"></td></tr>\n" +
"<tr><td align=\"right\">Subject:</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_SUBJECT + "\" value=\"" + subject + "\"></td></tr>\n" + "<tr><td align=\"right\">Subject:</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_SUBJECT + "\" value=\"" + subject + "\"></td></tr>\n" +
"<tr><td>&nbsp;</td><td align=\"left\"><input type=\"checkbox\" name=\"" + NEW_BCC_TO_SELF + "\" value=\"1\"" + ( bccToSelf.compareToIgnoreCase( "false" ) != 0 ? "checked" : "" )+ ">Bcc to self</td></tr>\n" + "<tr><td>&nbsp;</td><td align=\"left\"><input type=\"checkbox\" class=\"optbox\" name=\"" + NEW_BCC_TO_SELF + "\" value=\"1\"" + ( bccToSelf.compareToIgnoreCase( "false" ) != 0 ? "checked" : "" )+ ">Bcc to self</td></tr>\n" +
"<tr><td colspan=\"2\" align=\"center\"><textarea cols=\"" + Config.getProperty( CONFIG_COMPOSER_COLS, 80 )+ "\" rows=\"" + Config.getProperty( CONFIG_COMPOSER_ROWS, 10 )+ "\" name=\"" + NEW_TEXT + "\">" + text + "</textarea>" + "<tr><td colspan=\"2\" align=\"center\"><textarea cols=\"" + Config.getProperty( CONFIG_COMPOSER_COLS, 80 )+ "\" rows=\"" + Config.getProperty( CONFIG_COMPOSER_ROWS, 10 )+ "\" name=\"" + NEW_TEXT + "\">" + text + "</textarea>" +
"<tr><td colspan=\"2\" align=\"center\"><hr></td></tr>\n" + "<tr><td colspan=\"2\" align=\"center\"><hr></td></tr>\n" +
"<tr><td align=\"right\">New Attachment:</td><td align=\"left\"><input type=\"file\" size=\"50%\" name=\"" + NEW_FILENAME + "\" value=\"\"><input type=\"submit\" name=\"" + NEW_UPLOAD + "\" value=\"Upload File\"></td></tr>" ); "<tr><td align=\"right\">New Attachment:</td><td align=\"left\"><input type=\"file\" size=\"50%\" name=\"" + NEW_FILENAME + "\" value=\"\"><input type=\"submit\" name=\"" + NEW_UPLOAD + "\" value=\"Upload File\"></td></tr>" );
@ -1558,7 +1558,7 @@ public class WebMail extends HttpServlet
wroteHeader = true; wroteHeader = true;
} }
Attachment attachment = (Attachment)it.next(); Attachment attachment = (Attachment)it.next();
out.println( "<tr><td colspan=\"2\" align=\"center\"><input type=\"checkbox\" name=\"check" + attachment.hashCode() + "\" value=\"1\">&nbsp;" + attachment.getFileName() + "</td></tr>"); out.println( "<tr><td colspan=\"2\" align=\"center\"><input type=\"checkbox\" class=\"optbox\" name=\"check" + attachment.hashCode() + "\" value=\"1\">&nbsp;" + attachment.getFileName() + "</td></tr>");
} }
} }
out.println( "</table>" ); out.println( "</table>" );
@ -1632,7 +1632,7 @@ public class WebMail extends HttpServlet
", markAll=" + sessionObject.markAll + ", markAll=" + sessionObject.markAll +
", invert=" + sessionObject.invert + ", invert=" + sessionObject.invert +
", clear=" + sessionObject.clear ); ", clear=" + sessionObject.clear );
out.println( "<tr class=\"list" + bg + "\"><td><input type=\"checkbox\" name=\"check" + i + "\" value=\"1\"" + out.println( "<tr class=\"list" + bg + "\"><td><input type=\"checkbox\" class=\"optbox\" name=\"check" + i + "\" value=\"1\"" +
( idChecked ? "checked" : "" ) + ">" + ( RELEASE ? "" : "" + i ) + "</td><td>" + link + mail.shortSender + "</a></td><td>&nbsp;</td><td>" + link + mail.shortSubject + "</a></td><td>&nbsp;</td><td>" + mail.formattedDate + "</a></td><td>&nbsp;</td><td>" + mail.size + " Bytes</a></td></tr>" ); ( idChecked ? "checked" : "" ) + ">" + ( RELEASE ? "" : "" + i ) + "</td><td>" + link + mail.shortSender + "</a></td><td>&nbsp;</td><td>" + link + mail.shortSubject + "</a></td><td>&nbsp;</td><td>" + mail.formattedDate + "</a></td><td>&nbsp;</td><td>" + mail.size + " Bytes</a></td></tr>" );
bg = 1 - bg; bg = 1 - bg;
i++; i++;

View File

@ -502,7 +502,7 @@ public class TransientSessionKeyManager extends SessionKeyManager {
public String renderStatusHTML() { public String renderStatusHTML() {
StringBuilder buf = new StringBuilder(1024); StringBuilder buf = new StringBuilder(1024);
buf.append("<h2>Inbound sessions</h2>"); buf.append("<h2>Inbound sessions</h2>");
buf.append("<table border=\"1\">"); buf.append("<table>");
Set<TagSet> inbound = getInboundTagSets(); Set<TagSet> inbound = getInboundTagSets();
Map<SessionKey, Set<TagSet>> inboundSets = new HashMap(inbound.size()); Map<SessionKey, Set<TagSet>> inboundSets = new HashMap(inbound.size());
for (Iterator<TagSet> iter = inbound.iterator(); iter.hasNext();) { for (Iterator<TagSet> iter = inbound.iterator(); iter.hasNext();) {
@ -528,7 +528,7 @@ public class TransientSessionKeyManager extends SessionKeyManager {
buf.append("<h2><b>Outbound sessions</b></h2>"); buf.append("<h2><b>Outbound sessions</b></h2>");
buf.append("<table border=\"1\">"); buf.append("<table>");
Set<OutboundSession> outbound = getOutboundSessions(); Set<OutboundSession> outbound = getOutboundSessions();
for (Iterator<OutboundSession> iter = outbound.iterator(); iter.hasNext();) { for (Iterator<OutboundSession> iter = outbound.iterator(); iter.hasNext();) {
OutboundSession sess = iter.next(); OutboundSession sess = iter.next();

View File

@ -641,4 +641,26 @@ form {}
font-size: 8pt; font-size: 8pt;
font-style: italic; font-style: italic;
font-weight: bold; font-weight: bold;
}
.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;
}
.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;
} }

View File

@ -667,7 +667,7 @@ public class JobQueue {
/** render the HTML for the job stats */ /** render the HTML for the job stats */
private void getJobStats(StringBuilder buf) { private void getJobStats(StringBuilder buf) {
buf.append("<table border=\"1\">\n"); buf.append("<table>\n");
buf.append("<tr><th>Job</th><th>Runs</th>"); buf.append("<tr><th>Job</th><th>Runs</th>");
buf.append("<th>Time</th><th><i>Avg</i></th><th><i>Max</i></th><th><i>Min</i></th>"); buf.append("<th>Time</th><th><i>Avg</i></th><th><i>Max</i></th><th><i>Min</i></th>");
buf.append("<th>Pending</th><th><i>Avg</i></th><th><i>Max</i></th><th><i>Min</i></th></tr>\n"); buf.append("<th>Pending</th><th><i>Avg</i></th><th><i>Max</i></th><th><i>Min</i></th></tr>\n");

View File

@ -67,7 +67,7 @@ public class PersistentKeyRing extends KeyRing {
@Override @Override
public void renderStatusHTML(Writer out) throws IOException { public void renderStatusHTML(Writer out) throws IOException {
StringBuilder buf = new StringBuilder(1024); StringBuilder buf = new StringBuilder(1024);
buf.append("\n<table border=\"1\"><tr><th align=\"left\">Destination Hash<th align=\"left\">Name or Dest.<th align=\"left\">Session Key</tr>"); buf.append("\n<table><tr><th align=\"left\">Destination Hash<th align=\"left\">Name or Dest.<th align=\"left\">Session Key</tr>");
for (Entry<Hash, SessionKey> e : entrySet()) { for (Entry<Hash, SessionKey> e : entrySet()) {
buf.append("\n<tr><td>"); buf.append("\n<tr><td>");
Hash h = e.getKey(); Hash h = e.getKey();

View File

@ -759,7 +759,7 @@ public class Router {
buf.setLength(0); buf.setLength(0);
buf.append("\n<hr /><a name=\"logs\"> </a>\n"); buf.append("\n<hr /><a name=\"logs\"> </a>\n");
List msgs = _context.logManager().getBuffer().getMostRecentMessages(); List msgs = _context.logManager().getBuffer().getMostRecentMessages();
buf.append("\n<h2>Most recent console messages:</h2><table border=\"1\">\n"); buf.append("\n<h2>Most recent console messages:</h2><table>\n");
for (Iterator iter = msgs.iterator(); iter.hasNext(); ) { for (Iterator iter = msgs.iterator(); iter.hasNext(); ) {
String msg = (String)iter.next(); String msg = (String)iter.next();
buf.append("<tr><td align=\"left\"><pre>"); buf.append("<tr><td align=\"left\"><pre>");

View File

@ -619,8 +619,8 @@ public class FIFOBandwidthLimiter {
public void renderStatusHTML(Writer out) throws IOException { public void renderStatusHTML(Writer out) throws IOException {
long now = now(); long now = now();
StringBuilder buf = new StringBuilder(4096); StringBuilder buf = new StringBuilder(4096);
buf.append("<p><b id=\"bwlim\">Limiter Status:</b><br />").append(getStatus().toString()).append("</p>\n"); buf.append("<h3><b id=\"bwlim\">Limiter Status:</b></h3>").append(getStatus().toString()).append("\n");
buf.append("<p><b>Pending bandwidth requests:</b><ul>"); buf.append("<h3>Pending bandwidth requests:</h3><ul>");
buf.append("<li>Inbound requests: <ol>"); buf.append("<li>Inbound requests: <ol>");
synchronized (_pendingInboundRequests) { synchronized (_pendingInboundRequests) {
for (int i = 0; i < _pendingInboundRequests.size(); i++) { for (int i = 0; i < _pendingInboundRequests.size(); i++) {
@ -643,7 +643,7 @@ public class FIFOBandwidthLimiter {
buf.append("ms ago</li>\n"); buf.append("ms ago</li>\n");
} }
} }
buf.append("</ol></li></ul></p>\n"); buf.append("</ol></li></ul></p><hr>\n");
out.write(buf.toString()); out.write(buf.toString());
out.flush(); out.flush();
} }

View File

@ -492,7 +492,7 @@ public class TransportManager implements TransportEventListener {
t.renderStatusHTML(out, urlBase, sortFlags); t.renderStatusHTML(out, urlBase, sortFlags);
} }
StringBuilder buf = new StringBuilder(4*1024); StringBuilder buf = new StringBuilder(4*1024);
buf.append("<p><b>Router Transport Addresses:</b><br /><pre>\n"); buf.append("<h3>Router Transport Addresses:</h3><pre>\n");
for (int i = 0; i < _transports.size(); i++) { for (int i = 0; i < _transports.size(); i++) {
Transport t = (Transport)_transports.get(i); Transport t = (Transport)_transports.get(i);
if (t.getCurrentAddress() != null) if (t.getCurrentAddress() != null)

View File

@ -639,10 +639,10 @@ public class NTCPTransport extends TransportImpl {
long totalRecv = 0; long totalRecv = 0;
StringBuilder buf = new StringBuilder(512); StringBuilder buf = new StringBuilder(512);
buf.append("<p><b id=\"ntcpcon\">NTCP connections: ").append(peers.size()); buf.append("<p><b id=\"ntcpcon\"><h3>NTCP connections: ").append(peers.size());
buf.append(" limit: ").append(getMaxConnections()); buf.append(". Limit: ").append(getMaxConnections());
buf.append(" timeout: ").append(DataHelper.formatDuration(_pumper.getIdleTimeout())); buf.append(". Timeout: ").append(DataHelper.formatDuration(_pumper.getIdleTimeout()));
buf.append("</b><br />\n"); buf.append(".</b></h3>\n");
buf.append("<table>\n"); buf.append("<table>\n");
buf.append("<tr><th><a href=\"#def.peer\">Peer</a></th>"); buf.append("<tr><th><a href=\"#def.peer\">Peer</a></th>");
buf.append("<th>Dir</th>"); buf.append("<th>Dir</th>");
@ -650,8 +650,8 @@ public class NTCPTransport extends TransportImpl {
buf.append("<th align=\"right\"><a href=\"#def.rate\">In/Out</a></th>"); buf.append("<th align=\"right\"><a href=\"#def.rate\">In/Out</a></th>");
buf.append("<th align=\"right\"><a href=\"#def.up\">Up</a></th>"); buf.append("<th align=\"right\"><a href=\"#def.up\">Up</a></th>");
buf.append("<th align=\"right\"><a href=\"#def.skew\">Skew</a></th>"); buf.append("<th align=\"right\"><a href=\"#def.skew\">Skew</a></th>");
buf.append("<th align=\"right\"><a href=\"#def.send\">Send</a></th>"); buf.append("<th align=\"right\"><a href=\"#def.send\">TX</a></th>");
buf.append("<th align=\"right\"><a href=\"#def.recv\">Recv</a></th>"); buf.append("<th align=\"right\"><a href=\"#def.recv\">RX</a></th>");
buf.append("<th>Out queue</th>"); buf.append("<th>Out queue</th>");
buf.append("<th>Backlogged?</th>"); buf.append("<th>Backlogged?</th>");
buf.append("<th>Reading?</th>"); buf.append("<th>Reading?</th>");
@ -665,15 +665,15 @@ public class NTCPTransport extends TransportImpl {
//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));
buf.append("</td><td align=\"center\"><code>"); buf.append("</td><td align=\"center\">");
if (con.isInbound()) if (con.isInbound())
buf.append("in"); buf.append("<img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound\"/>");
else else
buf.append("out"); buf.append("<img src=\"/themes/console/images/outbound.png\" alt=\"Outbound\" title=\"Outbound\"/>");
buf.append("</code></td><td align=\"right\"><code>"); buf.append("</td><td align=\"right\">");
buf.append(con.getTimeSinceReceive()/1000); buf.append(con.getTimeSinceReceive()/1000);
buf.append("s/").append(con.getTimeSinceSend()/1000); buf.append("s/").append(con.getTimeSinceSend()/1000);
buf.append("s</code></td><td align=\"right\"><code>"); buf.append("s</td><td align=\"right\">");
if (con.getTimeSinceReceive() < 10*1000) { if (con.getTimeSinceReceive() < 10*1000) {
buf.append(formatRate(con.getRecvRate()/1024)); buf.append(formatRate(con.getRecvRate()/1024));
bpsRecv += con.getRecvRate(); bpsRecv += con.getRecvRate();
@ -687,43 +687,43 @@ public class NTCPTransport extends TransportImpl {
} else { } else {
buf.append(formatRate(0)); buf.append(formatRate(0));
} }
buf.append("KBps"); buf.append("K/s");
buf.append("</code></td><td align=\"right\"><code>").append(DataHelper.formatDuration(con.getUptime())); buf.append("</td><td align=\"right\">").append(DataHelper.formatDuration(con.getUptime()));
totalUptime += con.getUptime(); totalUptime += con.getUptime();
offsetTotal = offsetTotal + con.getClockSkew(); offsetTotal = offsetTotal + con.getClockSkew();
buf.append("</code></td><td align=\"right\"><code>").append(con.getClockSkew()); buf.append("</td><td align=\"right\">").append(con.getClockSkew());
buf.append("s</code></td><td align=\"right\"><code>").append(con.getMessagesSent()); buf.append("s</td><td align=\"right\">").append(con.getMessagesSent());
totalSend += con.getMessagesSent(); totalSend += con.getMessagesSent();
buf.append("</code></td><td align=\"right\"><code>").append(con.getMessagesReceived()); buf.append("</td><td align=\"right\">").append(con.getMessagesReceived());
totalRecv += con.getMessagesReceived(); totalRecv += con.getMessagesReceived();
long outQueue = con.getOutboundQueueSize(); long outQueue = con.getOutboundQueueSize();
if (outQueue <= 0) { if (outQueue <= 0) {
buf.append("</code></td><td align=\"right\"><code>No messages"); buf.append("</td><td align=\"right\">No messages");
} else { } else {
buf.append("</code></td><td align=\"right\"><code>").append(outQueue).append(" message"); buf.append("</td><td align=\"right\">").append(outQueue).append(" message");
if (outQueue > 1) if (outQueue > 1)
buf.append("s"); buf.append("s");
} }
buf.append("</code></td><td align=\"center\"><code>").append(con.getConsecutiveBacklog() > 0 ? "true" : "false"); buf.append("</td><td align=\"center\">").append(con.getConsecutiveBacklog() > 0 ? "true" : "false");
long readTime = con.getReadTime(); long readTime = con.getReadTime();
if (readTime <= 0) { if (readTime <= 0) {
buf.append("</code></td><td align=\"center\"><code>No"); buf.append("</td><td align=\"center\">No");
} else { } else {
buf.append("</code></td><td><code>For ").append(DataHelper.formatDuration(readTime)); buf.append("</td><td>For ").append(DataHelper.formatDuration(readTime));
} }
buf.append("</code></td></tr>\n"); buf.append("</td></tr>\n");
out.write(buf.toString()); out.write(buf.toString());
buf.setLength(0); buf.setLength(0);
} }
if (peers.size() > 0) { if (peers.size() > 0) {
buf.append("<tr><td colspan=\"11\"><hr /></td></tr>\n"); buf.append("<tr><td colspan=\"11\"><hr /></td></tr>\n");
buf.append("<tr><td>").append(peers.size()).append(" peers</td><td>&nbsp;</td><td>&nbsp;"); 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\">").append(formatRate(bpsRecv/1024)).append("/").append(formatRate(bpsSend/1024)).append("KBps"); 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\">").append(DataHelper.formatDuration(totalUptime/peers.size())); buf.append("</td><td align=\"right\"><b>").append(DataHelper.formatDuration(totalUptime/peers.size()));
buf.append("</td><td align=\"right\">").append(peers.size() > 0 ? DataHelper.formatDuration(offsetTotal*1000/peers.size()) : "0ms"); buf.append("</b></td><td align=\"right\"><b>").append(peers.size() > 0 ? DataHelper.formatDuration(offsetTotal*1000/peers.size()) : "0ms");
buf.append("</td><td align=\"right\">").append(totalSend).append("</td><td align=\"right\">").append(totalRecv); buf.append("</b></td><td align=\"right\"><b>").append(totalSend).append("</b></td><td align=\"right\"><b>").append(totalRecv);
buf.append("</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;"); buf.append("</b></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;");
buf.append("</td></tr>\n"); buf.append("</td></tr>\n");
} }

View File

@ -1763,51 +1763,51 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
int numPeers = 0; int numPeers = 0;
StringBuilder buf = new StringBuilder(512); StringBuilder buf = new StringBuilder(512);
buf.append("<p><b id=\"udpcon\">UDP connections: ").append(peers.size()); buf.append("<p><b id=\"udpcon\"><h3>UDP connections: ").append(peers.size());
buf.append(" limit: ").append(getMaxConnections()); buf.append(". Limit: ").append(getMaxConnections());
buf.append(" timeout: ").append(DataHelper.formatDuration(_expireTimeout)); buf.append(". Timeout: ").append(DataHelper.formatDuration(_expireTimeout));
buf.append("</b><br />\n"); buf.append(".</b></h3>\n");
buf.append("<table>\n"); buf.append("<table>\n");
buf.append("<tr><th><a href=\"#def.peer\">Peer</a>"); buf.append("<tr><th class=\"smallhead\" nowrap><a href=\"#def.peer\">Peer</a>");
if (sortFlags != FLAG_ALPHA) if (sortFlags != FLAG_ALPHA)
buf.append(" <a href=\"").append(urlBase).append("?sort=0\">V</a> "); buf.append(" <a href=\"").append(urlBase).append("?sort=0\">V</a> ");
buf.append("</th><th><a href=\"#def.dir\">Dir/Intro</a></th><th><a href=\"#def.idle\">Idle</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>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by idle inbound", FLAG_IDLE_IN); appendSortLinks(buf, urlBase, sortFlags, "Sort by idle inbound", FLAG_IDLE_IN);
buf.append("/"); buf.append("/");
appendSortLinks(buf, urlBase, sortFlags, "Sort by idle outbound", FLAG_IDLE_OUT); appendSortLinks(buf, urlBase, sortFlags, "Sort by idle outbound", FLAG_IDLE_OUT);
buf.append("</th>"); buf.append("</th>");
buf.append("<th><a href=\"#def.rate\">In/Out</a>"); buf.append("<th class=\"smallhead\" nowrap><a href=\"#def.rate\">In/Out</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by inbound rate", FLAG_RATE_IN); appendSortLinks(buf, urlBase, sortFlags, "Sort by inbound rate", FLAG_RATE_IN);
buf.append("/"); buf.append("/");
appendSortLinks(buf, urlBase, sortFlags, "Sort by outbound rate", FLAG_RATE_OUT); appendSortLinks(buf, urlBase, sortFlags, "Sort by outbound rate", FLAG_RATE_OUT);
buf.append("</th>\n"); buf.append("</th>\n");
buf.append("<th><a href=\"#def.up\">Up</a>"); buf.append("<th class=\"smallhead\" nowrap><a href=\"#def.up\">Up</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by connection uptime", FLAG_UPTIME); appendSortLinks(buf, urlBase, sortFlags, "Sort by connection uptime", FLAG_UPTIME);
buf.append("</th><th><a href=\"#def.skew\">skew</a>"); buf.append("</th><th class=\"smallhead\" nowrap><a href=\"#def.skew\">Skew</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by clock skew", FLAG_SKEW); appendSortLinks(buf, urlBase, sortFlags, "Sort by clock skew", FLAG_SKEW);
buf.append("</th>\n"); buf.append("</th>\n");
buf.append("<th><a href=\"#def.cwnd\">Cwnd</a>"); buf.append("<th class=\"smallhead\" nowrap><a href=\"#def.cwnd\">Cwnd</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by congestion window", FLAG_CWND); appendSortLinks(buf, urlBase, sortFlags, "Sort by congestion window", FLAG_CWND);
buf.append("</th><th><a href=\"#def.ssthresh\">Ssthresh</a>"); buf.append("</th><th class=\"smallhead\" nowrap><a href=\"#def.ssthresh\">Sst</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by slow start threshold", FLAG_SSTHRESH); appendSortLinks(buf, urlBase, sortFlags, "Sort by slow start threshold", FLAG_SSTHRESH);
buf.append("</th>\n"); buf.append("</th>\n");
buf.append("<th><a href=\"#def.rtt\">Rtt</a>"); buf.append("<th class=\"smallhead\" nowrap><a href=\"#def.rtt\">Rtt</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by round trip time", FLAG_RTT); appendSortLinks(buf, urlBase, sortFlags, "Sort by round trip time", FLAG_RTT);
buf.append("</th><th><a href=\"#def.dev\">Dev</a>"); buf.append("</th><th class=\"smallhead\" nowrap><a href=\"#def.dev\">Dev</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by round trip time deviation", FLAG_DEV); appendSortLinks(buf, urlBase, sortFlags, "Sort by round trip time deviation", FLAG_DEV);
buf.append("</th><th><a href=\"#def.rto\">Rto</a>"); buf.append("</th><th class=\"smallhead\" nowrap><a href=\"#def.rto\">Rto</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by retransmission timeout", FLAG_RTO); appendSortLinks(buf, urlBase, sortFlags, "Sort by retransmission timeout", FLAG_RTO);
buf.append("</th>\n"); buf.append("</th>\n");
buf.append("<th><a href=\"#def.mtu\">Mtu</a>"); buf.append("<th class=\"smallhead\" nowrap><a href=\"#def.mtu\">Mtu</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by maximum transmit unit", FLAG_MTU); appendSortLinks(buf, urlBase, sortFlags, "Sort by maximum transmit unit", FLAG_MTU);
buf.append("</th><th><a href=\"#def.send\">Send</a>"); buf.append("</th><th class=\"smallhead\" nowrap><a href=\"#def.send\">TX</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by packets sent", FLAG_SEND); appendSortLinks(buf, urlBase, sortFlags, "Sort by packets sent", FLAG_SEND);
buf.append("</th><th><a href=\"#def.recv\">Recv</a>"); buf.append("</th><th class=\"smallhead\" nowrap><a href=\"#def.recv\">RX</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by packets received", FLAG_RECV); appendSortLinks(buf, urlBase, sortFlags, "Sort by packets received", FLAG_RECV);
buf.append("</th>\n"); buf.append("</th>\n");
buf.append("<th><a href=\"#def.resent\">Resent</a>"); buf.append("<th class=\"smallhead\" nowrap><a href=\"#def.resent\">ReTX</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by packets retransmitted", FLAG_RESEND); appendSortLinks(buf, urlBase, sortFlags, "Sort by packets retransmitted", FLAG_RESEND);
buf.append("</th><th><a href=\"#def.dupRecv\">DupRecv</a>"); buf.append("</th><th class=\"smallhead\" nowrap><a href=\"#def.dupRecv\">DupRX</a><br>");
appendSortLinks(buf, urlBase, sortFlags, "Sort by packets received more than once", FLAG_DUP); appendSortLinks(buf, urlBase, sortFlags, "Sort by packets received more than once", FLAG_DUP);
buf.append("</th>\n"); buf.append("</th>\n");
buf.append("</tr>\n"); buf.append("</tr>\n");
@ -1824,11 +1824,11 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
//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));
buf.append("</td><td><code>"); buf.append("</td><td nowrap>");
if (peer.isInbound()) if (peer.isInbound())
buf.append("in "); buf.append("<img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound\"/> ");
else else
buf.append("out "); buf.append("<img src=\"/themes/console/images/outbound.png\" alt=\"Outbound\" title=\"Outbound\"/> ");
if (peer.getWeRelayToThemAs() > 0) if (peer.getWeRelayToThemAs() > 0)
buf.append("^"); buf.append("^");
else else
@ -1839,107 +1839,107 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
boolean appended = false; boolean appended = false;
if (_activeThrottle.isChoked(peer.getRemotePeer())) { if (_activeThrottle.isChoked(peer.getRemotePeer())) {
if (!appended) buf.append("<br />"); if (!appended) buf.append("<br />");
buf.append(" [choked]"); buf.append(" <i>Choked</i>");
appended = true; appended = true;
} }
if (peer.getConsecutiveFailedSends() > 0) { if (peer.getConsecutiveFailedSends() > 0) {
if (!appended) buf.append("<br />"); if (!appended) buf.append("<br />");
buf.append(" [").append(peer.getConsecutiveFailedSends()).append(" failures]"); buf.append(" <i>").append(peer.getConsecutiveFailedSends()).append(" fail(s)</i>");
appended = true; appended = true;
} }
if (_context.shitlist().isShitlisted(peer.getRemotePeer(), STYLE)) { if (_context.shitlist().isShitlisted(peer.getRemotePeer(), STYLE)) {
if (!appended) buf.append("<br />"); if (!appended) buf.append("<br />");
buf.append(" [shitlisted]"); buf.append(" <i>Shitlist</i>");
appended = true; appended = true;
} }
//byte[] ip = getIP(peer.getRemotePeer()); //byte[] ip = getIP(peer.getRemotePeer());
//if (ip != null) //if (ip != null)
// buf.append(' ').append(_context.blocklist().toStr(ip)); // buf.append(' ').append(_context.blocklist().toStr(ip));
buf.append("</code></td>"); buf.append("</td>");
long idleIn = (now-peer.getLastReceiveTime())/1000; long idleIn = (now-peer.getLastReceiveTime())/1000;
long idleOut = (now-peer.getLastSendTime())/1000; long idleOut = (now-peer.getLastSendTime())/1000;
if (idleIn < 0) idleIn = 0; if (idleIn < 0) idleIn = 0;
if (idleOut < 0) idleOut = 0; if (idleOut < 0) idleOut = 0;
buf.append("<td align=\"right\" ><code>"); buf.append("<td align=\"right\" >");
buf.append(idleIn); buf.append(idleIn);
buf.append("s/"); buf.append("s/");
buf.append(idleOut); buf.append(idleOut);
buf.append("s</code></td>"); buf.append("s</td>");
int recvBps = (idleIn > 2 ? 0 : peer.getReceiveBps()); int recvBps = (idleIn > 2 ? 0 : peer.getReceiveBps());
int sendBps = (idleOut > 2 ? 0 : peer.getSendBps()); int sendBps = (idleOut > 2 ? 0 : peer.getSendBps());
buf.append("<td align=\"right\" ><code>"); buf.append("<td align=\"right\" nowrap>");
buf.append(formatKBps(recvBps)); buf.append(formatKBps(recvBps));
buf.append("/"); buf.append("/");
buf.append(formatKBps(sendBps)); buf.append(formatKBps(sendBps));
buf.append("KBps "); buf.append("K/s ");
//buf.append(formatKBps(peer.getReceiveACKBps())); //buf.append(formatKBps(peer.getReceiveACKBps()));
//buf.append("KBps/"); //buf.append("K/s/");
//buf.append(formatKBps(peer.getSendACKBps())); //buf.append(formatKBps(peer.getSendACKBps()));
//buf.append("KBps "); //buf.append("K/s ");
buf.append("</code></td>"); buf.append("</td>");
long uptime = now - peer.getKeyEstablishedTime(); long uptime = now - peer.getKeyEstablishedTime();
buf.append("<td align=\"right\" ><code>"); buf.append("<td align=\"right\" >");
buf.append(DataHelper.formatDuration(uptime)); buf.append(DataHelper.formatDuration(uptime));
buf.append("</code></td>"); buf.append("</td>");
buf.append("<td align=\"right\" ><code>"); buf.append("<td align=\"right\" >");
buf.append(peer.getClockSkew()); buf.append(peer.getClockSkew());
buf.append("s</code></td>"); buf.append("s</td>");
offsetTotal = offsetTotal + peer.getClockSkew(); offsetTotal = offsetTotal + peer.getClockSkew();
long sendWindow = peer.getSendWindowBytes(); long sendWindow = peer.getSendWindowBytes();
buf.append("<td align=\"right\" ><code>"); buf.append("<td align=\"right\" >");
buf.append(sendWindow/1024); buf.append(sendWindow/1024);
buf.append("K"); buf.append("K");
buf.append("/").append(peer.getConcurrentSends()); buf.append("/").append(peer.getConcurrentSends());
buf.append("/").append(peer.getConcurrentSendWindow()); buf.append("/").append(peer.getConcurrentSendWindow());
buf.append("/").append(peer.getConsecutiveSendRejections()); buf.append("/").append(peer.getConsecutiveSendRejections());
buf.append("</code></td>"); buf.append("</td>");
buf.append("<td align=\"right\" ><code>"); buf.append("<td align=\"right\" >");
buf.append(peer.getSlowStartThreshold()/1024); buf.append(peer.getSlowStartThreshold()/1024);
buf.append("K</code></td>"); buf.append("K</td>");
int rtt = peer.getRTT(); int rtt = peer.getRTT();
int rto = peer.getRTO(); int rto = peer.getRTO();
buf.append("<td align=\"right\" ><code>"); buf.append("<td align=\"right\" >");
buf.append(rtt); buf.append(rtt);
buf.append("</code></td>"); buf.append("</td>");
buf.append("<td align=\"right\" ><code>"); buf.append("<td align=\"right\" >");
buf.append(peer.getRTTDeviation()); buf.append(peer.getRTTDeviation());
buf.append("</code></td>"); buf.append("</td>");
buf.append("<td align=\"right\" ><code>"); buf.append("<td align=\"right\" >");
buf.append(rto); buf.append(rto);
buf.append("</code></td>"); buf.append("</td>");
buf.append("<td align=\"right\" ><code>"); buf.append("<td align=\"right\" >");
buf.append(peer.getMTU()).append("/").append(peer.getReceiveMTU()); buf.append(peer.getMTU()).append("/").append(peer.getReceiveMTU());
//.append('/'); //.append('/');
//buf.append(peer.getMTUIncreases()).append('/'); //buf.append(peer.getMTUIncreases()).append('/');
//buf.append(peer.getMTUDecreases()); //buf.append(peer.getMTUDecreases());
buf.append("</code></td>"); buf.append("</td>");
long sent = peer.getPacketsTransmitted(); long sent = peer.getPacketsTransmitted();
long recv = peer.getPacketsReceived(); long recv = peer.getPacketsReceived();
buf.append("<td align=\"right\" ><code>"); buf.append("<td align=\"right\" >");
buf.append(sent); buf.append(sent);
buf.append("</code></td>"); buf.append("</td>");
buf.append("<td align=\"right\" ><code>"); buf.append("<td align=\"right\" >");
buf.append(recv); buf.append(recv);
buf.append("</code></td>"); buf.append("</td>");
//double sent = (double)peer.getPacketsPeriodTransmitted(); //double sent = (double)peer.getPacketsPeriodTransmitted();
//double sendLostPct = 0; //double sendLostPct = 0;
@ -1949,16 +1949,16 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
long resent = peer.getPacketsRetransmitted(); long resent = peer.getPacketsRetransmitted();
long dupRecv = peer.getPacketsReceivedDuplicate(); long dupRecv = peer.getPacketsReceivedDuplicate();
buf.append("<td align=\"right\" ><code>"); buf.append("<td align=\"right\" >");
//buf.append(formatPct(sendLostPct)); //buf.append(formatPct(sendLostPct));
buf.append(resent); // + "/" + peer.getPacketsPeriodRetransmitted() + "/" + sent); buf.append(resent); // + "/" + peer.getPacketsPeriodRetransmitted() + "/" + sent);
//buf.append(peer.getPacketRetransmissionRate()); //buf.append(peer.getPacketRetransmissionRate());
buf.append("</code></td>"); buf.append("</td>");
double recvDupPct = (double)peer.getPacketsReceivedDuplicate()/(double)peer.getPacketsReceived(); double recvDupPct = (double)peer.getPacketsReceivedDuplicate()/(double)peer.getPacketsReceived();
buf.append("<td align=\"right\" ><code>"); buf.append("<td align=\"right\" >");
buf.append(dupRecv); //formatPct(recvDupPct)); buf.append(dupRecv); //formatPct(recvDupPct));
buf.append("</code></td>"); buf.append("</td>");
buf.append("</tr>\n"); buf.append("</tr>\n");
out.write(buf.toString()); out.write(buf.toString());
@ -1982,22 +1982,22 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
buf.append("<tr><td colspan=\"16\"><hr /></td></tr>\n"); buf.append("<tr><td colspan=\"16\"><hr /></td></tr>\n");
buf.append(" <tr><td colspan=\"3\"><b>Total</b></td>"); buf.append(" <tr><td colspan=\"3\"><b>Total</b></td>");
buf.append(" <td align=\"right\">"); buf.append(" <td align=\"right\" nowrap><b>");
buf.append(formatKBps(bpsIn)).append("/").append(formatKBps(bpsOut)); buf.append(formatKBps(bpsIn)).append("/").append(formatKBps(bpsOut));
buf.append("KBps</td>"); buf.append("K/s</b></td>");
buf.append(" <td align=\"right\">").append(numPeers > 0 ? DataHelper.formatDuration(uptimeMsTotal/numPeers) : "0s"); buf.append(" <td align=\"right\"><b>").append(numPeers > 0 ? DataHelper.formatDuration(uptimeMsTotal/numPeers) : "0s");
buf.append("</td><td align=\"right\">").append(numPeers > 0 ? DataHelper.formatDuration(offsetTotal*1000/numPeers) : "0ms").append("</td>\n"); 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\">"); buf.append(" <td align=\"right\"><b>");
buf.append(numPeers > 0 ? cwinTotal/(numPeers*1024) + "K" : "0K"); buf.append(numPeers > 0 ? cwinTotal/(numPeers*1024) + "K" : "0K");
buf.append("</td><td>&nbsp;</td>\n"); buf.append("</b></td><td>&nbsp;</td>\n");
buf.append(" <td align=\"right\">"); buf.append(" <td align=\"right\"><b>");
buf.append(numPeers > 0 ? rttTotal/numPeers : 0); buf.append(numPeers > 0 ? rttTotal/numPeers : 0);
buf.append("</td><td align=\"right\">&nbsp;</td><td align=\"right\">"); buf.append("</b></td><td align=\"right\">&nbsp;</td><td align=\"right\"><b>");
buf.append(numPeers > 0 ? rtoTotal/numPeers : 0); buf.append(numPeers > 0 ? rtoTotal/numPeers : 0);
buf.append("</td>\n <td>&nbsp;</td><td align=\"right\">"); buf.append("</b></td>\n <td>&nbsp;</td><td align=\"right\"><b>");
buf.append(sendTotal).append("</td><td align=\"right\">").append(recvTotal).append("</td>\n"); buf.append(sendTotal).append("</td></b><td align=\"right\"><b>").append(recvTotal).append("</b></td>\n");
buf.append(" <td align=\"right\">").append(resentTotal); buf.append(" <td align=\"right\"><b>").append(resentTotal);
buf.append("</td><td align=\"right\">").append(dupRecvTotal).append("</td>\n"); buf.append("</b></td><td align=\"right\"><b>").append(dupRecvTotal).append("</b></td>\n");
buf.append(" </tr></table></p><p>\n"); buf.append(" </tr></table></p><p>\n");
long bytesTransmitted = _context.bandwidthLimiter().getTotalAllocatedOutboundBytes(); long bytesTransmitted = _context.bandwidthLimiter().getTotalAllocatedOutboundBytes();
// NPE here early // NPE here early
@ -2006,8 +2006,8 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
resentTotal = (long)_context.statManager().getRate("udp.packetsRetransmitted").getLifetimeEventCount(); resentTotal = (long)_context.statManager().getRate("udp.packetsRetransmitted").getLifetimeEventCount();
double nondupSent = ((double)bytesTransmitted - ((double)resentTotal)*averagePacketSize); double nondupSent = ((double)bytesTransmitted - ((double)resentTotal)*averagePacketSize);
double bwResent = (nondupSent <= 0 ? 0d : ((((double)resentTotal)*averagePacketSize) / nondupSent)); double bwResent = (nondupSent <= 0 ? 0d : ((((double)resentTotal)*averagePacketSize) / nondupSent));
buf.append("Percentage of bytes retransmitted (lifetime): ").append(formatPct(bwResent)); buf.append("<h3>Percentage of bytes retransmitted (lifetime): ").append(formatPct(bwResent));
buf.append(" <i>(includes retransmission required by packet loss)</i><br /></p>\n"); buf.append("</h3><i>(Includes retransmission required by packet loss)</i><br /></p>\n");
out.write(buf.toString()); out.write(buf.toString());
buf.setLength(0); buf.setLength(0);
out.write(KEY); out.write(KEY);
@ -2026,27 +2026,27 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
} }
} }
private static final String KEY = "<p>" + private static final String KEY = "<h3>Explanation of abbreviated terms used.</h3><div class=\"configure\">" +
"<b id=\"def.peer\">peer</b>: the remote peer<br />\n" + "<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.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" + "<b id=\"def.idle\">Idle</b>: the idle time is how long since a packet has been received or sent.<br />\n" +
"<b id=\"def.rate\">in/out</b>: the rates show a smoothed inbound and outbound transfer rate (KBytes per second)<br />\n" + "<b id=\"def.rate\">In/out</b>: the rates show a smoothed inbound and outbound transfer rate (KBytes per second).<br />\n" +
"<b id=\"def.up\">up</b>: the uptime is how long ago this session was established<br />\n" + "<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.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" + "<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 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 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; the number of consecutive sends which were blocked due to throws message window size.<br />\n" +
"<b id=\"def.ssthresh\">ssthresh</b>: the slow start threshold help make sure the cwnd doesn't grow too fast<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.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" + "<b id=\"def.dev\">Dev</b>: the standard deviation of the round trip time, to help control the retransmit timeout.<br />\n" +
"<b id=\"def.rto\">rto</b>: the retransmit timeout controls how frequently an unacknowledged packet will be retransmitted<br />\n" + "<b id=\"def.rto\">Rto</b>: the retransmit timeout controls how frequently an unacknowledged packet will be retransmitted.<br />\n" +
"<b id=\"def.mtu\">mtu</b>: current sending packet size / estimated receiving packet size<br />\n" + "<b id=\"def.mtu\">Mtu</b>: current sending packet size / estimated receiving packet size.<br />\n" +
"<b id=\"def.send\">send</b>: the number of packets sent to the peer<br />\n" + "<b id=\"def.send\">TX</b>: the number of packets sent to the peer.<br />\n" +
"<b id=\"def.recv\">recv</b>: the number of packets received from the peer<br />\n" + "<b id=\"def.recv\">RX</b>: the number of packets received from the peer.<br />\n" +
"<b id=\"def.resent\">resent</b>: the number of packets retransmitted to the peer<br />\n" + "<b id=\"def.resent\">ReTX</b>: the number of packets retransmitted to the peer.<br />\n" +
"<b id=\"def.dupRecv\">dupRecv</b>: the number of duplicate packets received from the peer" + "<b id=\"def.dupRecv\">DupRX</b>: the number of duplicate packets received from the peer." +
"</p>\n"; "</div>\n";
/** /**
* Cache the bid to reduce object churn * Cache the bid to reduce object churn