propagate from branch 'i2p.i2p' (head 098e31ae6c0969990791077264bfd58d8ac3680c)

to branch 'i2p.i2p.str4d.ui' (head 0cfd439957ebce6c3a71f5b3e11f4e873388b03c)
This commit is contained in:
str4d
2017-05-14 06:53:02 +00:00
796 changed files with 54568 additions and 10785 deletions

View File

@@ -1017,48 +1017,58 @@ public class Blocklist {
Set<Integer> singles = new TreeSet<Integer>();
singles.addAll(_singleIPBlocklist);
if (!(singles.isEmpty() && _singleIPv6Blocklist.isEmpty())) {
out.write("<table><tr><th align=\"center\" colspan=\"2\"><b>");
out.write("<table id=\"bannedips\"><tr><td>");
out.write("<table id=\"banneduntilrestart\"><tr><th align=\"center\"><b>");
out.write(_t("IPs Banned Until Restart"));
out.write("</b></td></tr>");
out.write("</b></th></tr>");
if (!singles.isEmpty()) {
out.write("<tr id=\"ipv4\" align=\"center\"><td><b>");
out.write(_t("IPv4 Addresses"));
out.write("</b></td></tr>");
}
// first 0 - 127
for (Integer ii : singles) {
int ip = ii.intValue();
if (ip < 0)
continue;
out.write("<tr><td align=\"center\" width=\"50%\">");
out.write("<tr><td align=\"center\">");
out.write(toStr(ip));
out.write("</td><td width=\"50%\">&nbsp;</td></tr>\n");
out.write("</td></tr>\n");
}
// then 128 - 255
for (Integer ii : singles) {
int ip = ii.intValue();
if (ip >= 0)
break;
out.write("<tr><td align=\"center\" width=\"50%\">");
out.write("<tr><td align=\"center\">");
out.write(toStr(ip));
out.write("</td><td width=\"50%\">&nbsp;</td></tr>\n");
out.write("</td></tr>\n");
}
// then IPv6
if (!_singleIPv6Blocklist.isEmpty()) {
out.write("<tr id=\"ipv6\" align=\"center\"><td><b>");
out.write(_t("IPv6 Addresses"));
out.write("</b></td></tr>");
List<BigInteger> s6;
synchronized(_singleIPv6Blocklist) {
s6 = new ArrayList<BigInteger>(_singleIPv6Blocklist.keySet());
}
Collections.sort(s6);
for (BigInteger bi : s6) {
out.write("<tr><td align=\"center\" width=\"50%\">");
out.write("<tr><td align=\"center\">");
out.write(Addresses.toString(toIPBytes(bi)));
out.write("</td><td width=\"50%\">&nbsp;</td></tr>\n");
out.write("</td></tr>\n");
}
}
out.write("</table>");
}
if (_blocklistSize > 0) {
out.write("<table><tr><th align=\"center\" colspan=\"2\"><b>");
out.write("</td><td>");
out.write("<table id=\"permabanned\"><tr><th align=\"center\" colspan=\"3\"><b>");
out.write(_t("IPs Permanently Banned"));
out.write("</b></th></tr><tr><td align=\"center\" width=\"50%\"><b>");
out.write("</b></th></tr><tr><td align=\"center\" width=\"49%\"><b>");
out.write(_t("From"));
out.write("</b></td><td align=\"center\" width=\"50%\"><b>");
out.write("</b></td><td></td><td align=\"center\" width=\"49%\"><b>");
out.write(_t("To"));
out.write("</b></td></tr>");
int max = Math.min(_blocklistSize, MAX_DISPLAY);
@@ -1068,12 +1078,16 @@ public class Blocklist {
int from = getFrom(_blocklist[i]);
if (from < 0)
continue;
out.write("<tr><td align=\"center\" width=\"50%\">"); out.write(toStr(from)); out.write("</td><td align=\"center\" width=\"50%\">");
out.write("<tr><td align=\"center\" width=\"49%\">");
out.write(toStr(from));
out.write("</td>");
int to = getTo(_blocklist[i]);
if (to != from) {
out.write(toStr(to)); out.write("</td></tr>\n");
out.write("<td align=\"center\">-</td><td align=\"center\" width=\"49%\">");
out.write(toStr(to));
out.write("</td></tr>\n");
} else
out.write("&nbsp;</td></tr>\n");
out.write("<td></td><td width=\"49%\">&nbsp;</td></tr>\n");
displayed++;
}
// then 128 - 255
@@ -1081,18 +1095,23 @@ public class Blocklist {
int from = getFrom(_blocklist[i]);
if (from >= 0)
break;
out.write("<tr><td align=\"center\" width=\"50%\">"); out.write(toStr(from)); out.write("</td><td align=\"center\" width=\"50%\">");
out.write("<tr><td align=\"center\" width=\"49%\">");
out.write(toStr(from));
out.write("</td>");
int to = getTo(_blocklist[i]);
if (to != from) {
out.write(toStr(to)); out.write("</td></tr>\n");
out.write("<td align=\"center\">-</td><td align=\"center\" width=\"49%\">");
out.write(toStr(to));
out.write("</td></tr>\n");
} else
out.write("&nbsp;</td></tr>\n");
out.write("<td></td><td width=\"49%\">&nbsp;</td></tr>\n");
}
if (_blocklistSize > MAX_DISPLAY)
// very rare, don't bother translating
out.write("<tr><th colspan=2>First " + MAX_DISPLAY + " displayed, see the " +
BLOCKLIST_FILE_DEFAULT + " file for the full list</th></tr>");
out.write("</table>");
out.write("</td></tr></table>");
} else {
out.write("<br><i>");
out.write(_t("none"));

View File

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

View File

@@ -721,7 +721,7 @@ public class TransportManager implements TransportEventListener {
*/
public void renderStatusHTML(Writer out, String urlBase, int sortFlags) throws IOException {
if (_context.getBooleanProperty(PROP_ADVANCED)) {
out.write("<p><b>");
out.write("<p id=\"upnpstatus\"><b>");
out.write(_t("Status"));
out.write(": ");
out.write(_t(getReachabilityStatus().toStatusString()));
@@ -740,7 +740,7 @@ public class TransportManager implements TransportEventListener {
}
StringBuilder buf = new StringBuilder(4*1024);
buf.append("<h3>").append(_t("Router Transport Addresses")).append("</h3><pre>\n");
buf.append("<h3 id=\"transports\">").append(_t("Router Transport Addresses")).append("</h3><pre id=\"transports\">\n");
for (Transport t : _transports.values()) {
if (t.hasCurrentAddress()) {
for (RouterAddress ra : t.getCurrentAddresses()) {
@@ -759,7 +759,7 @@ public class TransportManager implements TransportEventListener {
} else if (_upnpManager != null) {
out.write(_upnpManager.renderStatusHTML());
} else {
out.write("<h3><a name=\"upnp\"></a>" + _t("UPnP is not enabled") + "</h3>\n");
out.write("<h3 id=\"upnpstatus\"><a name=\"upnp\"></a>" + _t("UPnP is not enabled") + "</h3>\n");
}
out.write("</p>\n");
out.flush();
@@ -768,39 +768,36 @@ public class TransportManager implements TransportEventListener {
private final String getTransportsLegend() {
StringBuilder buf = new StringBuilder(1024);
buf.append("<h3 id=\"help\">").append(_t("Help")).append("</h3><div class=\"configure\"><p>")
buf.append("<p class=\"infohelp\">")
.append(_t("Your transport connection limits are automatically set based on your configured bandwidth."))
.append('\n')
.append(_t("To override these limits, add the settings i2np.ntcp.maxConnections=nnn and i2np.udp.maxConnections=nnn on the advanced configuration page."))
.append("</p></div>\n");
buf.append("<h3>").append(_t("Definitions")).append("</h3><div class=\"configure\">" +
"<p><b id=\"def.peer\">").append(_t("Peer")).append("</b>: ").append(_t("The remote peer, identified by router hash")).append("<br>\n" +
"<b id=\"def.dir\">").append(_t("Dir")).append("</b>: " +
"<img alt=\"Inbound\" src=\"/themes/console/images/inbound.png\"> ").append(_t("Inbound connection")).append("<br>\n" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
"<img alt=\"Outbound\" src=\"/themes/console/images/outbound.png\"> ").append(_t("Outbound connection")).append("<br>\n" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
"<img src=\"/themes/console/images/inbound.png\" alt=\"V\" height=\"8\" width=\"12\"> ").append(_t("They offered to introduce us (help other peers traverse our firewall)")).append("<br>\n" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" +
"<img src=\"/themes/console/images/outbound.png\" alt=\"^\" height=\"8\" width=\"12\"> ").append(_t("We offered to introduce them (help other peers traverse their firewall)")).append("<br>\n" +
"<b id=\"def.idle\">").append(_t("Idle")).append("</b>: ").append(_t("How long since a packet has been received / sent")).append("<br>\n" +
"<b id=\"def.rate\">").append(_t("In/Out")).append("</b>: ").append(_t("The smoothed inbound / outbound transfer rate (KBytes per second)")).append("<br>\n" +
"<b id=\"def.up\">").append(_t("Up")).append("</b>: ").append(_t("How long ago this connection was established")).append("<br>\n" +
"<b id=\"def.skew\">").append(_t("Skew")).append("</b>: ").append(_t("The difference between the peer's clock and your own")).append("<br>\n" +
"<b id=\"def.cwnd\">CWND</b>: ").append(_t("The congestion window, which is how many bytes can be sent without an acknowledgement")).append(" / <br>\n" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ").append(_t("The number of sent messages awaiting acknowledgement")).append(" /<br>\n" +
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ").append(_t("The maximum number of concurrent messages to send")).append(" /<br>\n"+
"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ").append(_t("The number of pending sends which exceed congestion window")).append("<br>\n" +
"<b id=\"def.ssthresh\">SST</b>: ").append(_t("The slow start threshold")).append("<br>\n" +
"<b id=\"def.rtt\">RTT</b>: ").append(_t("The round trip time in milliseconds")).append("<br>\n" +
//"<b id=\"def.dev\">").append(_t("Dev")).append("</b>: ").append(_t("The standard deviation of the round trip time in milliseconds")).append("<br>\n" +
"<b id=\"def.rto\">RTO</b>: ").append(_t("The retransmit timeout in milliseconds")).append("<br>\n" +
"<b id=\"def.mtu\">MTU</b>: ").append(_t("Current maximum send packet size / estimated maximum receive packet size (bytes)")).append("<br>\n" +
"<b id=\"def.send\">").append(_t("TX")).append("</b>: ").append(_t("The total number of messages sent to the peer")).append("<br>\n" +
"<b id=\"def.recv\">").append(_t("RX")).append("</b>: ").append(_t("The total number of messages received from the peer")).append("<br>\n" +
"<b id=\"def.resent\">").append(_t("Dup TX")).append("</b>: ").append(_t("The total number of packets retransmitted to the peer")).append("<br>\n" +
"<b id=\"def.dupRecv\">").append(_t("Dup RX")).append("</b>: ").append(_t("The total number of duplicate packets received from the peer")).append("</p>" +
"</div>\n");
.append("</p>\n");
buf.append("<h3 class=\"tabletitle\">").append(_t("Definitions")).append("</h3>")
.append("<table id=\"peerdefs\">\n")
.append("<tr><td><b id=\"def.peer\">").append(_t("Peer")).append("</b></td><td>").append(_t("The remote peer, identified by router hash")).append("</td></tr>\n")
.append("<tr><td><b id=\"def.dir\">").append(_t("Dir")).append("</b></td><td><img alt=\"Inbound\" src=\"/themes/console/images/inbound.png\"> ").append(_t("Inbound connection")).append("</td></tr>\n")
.append("<tr><td></td><td><img alt=\"Outbound\" src=\"/themes/console/images/outbound.png\"> ").append(_t("Outbound connection")).append("</td></tr>\n")
.append("<tr><td></td><td><img src=\"/themes/console/images/inbound.png\" alt=\"V\" height=\"8\" width=\"12\"> ").append(_t("They offered to introduce us (help other peers traverse our firewall)")).append("</td></tr>\n")
.append("<tr><td></td><td><img src=\"/themes/console/images/outbound.png\" alt=\"^\" height=\"8\" width=\"12\"> ").append(_t("We offered to introduce them (help other peers traverse their firewall)")).append("</td></tr>\n")
.append("<tr><td><b id=\"def.idle\">").append(_t("Idle")).append("</b></td><td>").append(_t("How long since a packet has been received / sent")).append("</td></tr>\n")
.append("<tr><td><b id=\"def.rate\">").append(_t("In/Out")).append("</b></td><td>").append(_t("The smoothed inbound / outbound transfer rate (KBytes per second)")).append("</td></tr>\n")
.append("<tr><td><b id=\"def.up\">").append(_t("Up")).append("</b></td><td>").append(_t("How long ago this connection was established")).append("</td></tr>\n")
.append("<tr><td><b id=\"def.skew\">").append(_t("Skew")).append("</b></td><td>").append(_t("The difference between the peer's clock and your own")).append("</td></tr>\n")
.append("<tr><td><b id=\"def.cwnd\">CWND</b></td><td>").append(_t("The congestion window, which is how many bytes can be sent without an acknowledgement")).append(" / </td></tr>\n")
.append("<tr><td></td><td>").append(_t("The number of sent messages awaiting acknowledgement")).append(" /</td></tr>\n")
.append("<tr><td></td><td>").append(_t("The maximum number of concurrent messages to send")).append(" /</td></tr>\n")
.append("<tr><td></td><td>").append(_t("The number of pending sends which exceed congestion window")).append("</td></tr>\n")
.append("<tr><td><b id=\"def.ssthresh\">SST</b></td><td>").append(_t("The slow start threshold")).append("</td></tr>\n")
.append("<tr><td><b id=\"def.rtt\">RTT</b></td><td>").append(_t("The round trip time in milliseconds")).append("</td></tr>\n")
//.append("<tr><td><b id=\"def.dev\">").append(_t("Dev")).append("</b></td><td>").append(_t("The standard deviation of the round trip time in milliseconds")).append("</td></tr>\n")
.append("<tr><td><b id=\"def.rto\">RTO</b></td><td>").append(_t("The retransmit timeout in milliseconds")).append("</td></tr>\n")
.append("<tr><td><b id=\"def.mtu\">MTU</b></td><td>").append(_t("Current maximum send packet size / estimated maximum receive packet size (bytes)")).append("</td></tr>\n")
.append("<tr><td><b id=\"def.send\">").append(_t("TX")).append("</b></td><td>").append(_t("The total number of messages sent to the peer")).append("</td></tr>\n")
.append("<tr><td><b id=\"def.recv\">").append(_t("RX")).append("</b></td><td>").append(_t("The total number of messages received from the peer")).append("</td></tr>\n")
.append("<tr><td><b id=\"def.resent\">").append(_t("Dup TX")).append("</b></td><td>").append(_t("The total number of packets retransmitted to the peer")).append("</td></tr>\n")
.append("<tr><td><b id=\"def.dupRecv\">").append(_t("Dup RX")).append("</b></td><td>").append(_t("The total number of duplicate packets received from the peer")).append("</td></tr>\n")
.append("</table>");
return buf.toString();
}

View File

@@ -1368,7 +1368,7 @@ public class NTCPTransport extends TransportImpl {
buf.append(". ").append(_t("Status")).append(": ").append(_t(getReachabilityStatus().toStatusString()));
}
buf.append(".</h3>\n" +
"<table>\n" +
"<div class=\"widescroll\"><table id=\"ntcpconnections\">\n" +
"<tr><th><a href=\"#def.peer\">").append(_t("Peer")).append("</a></th>" +
"<th>").append(_t("Dir")).append("</th>" +
"<th>").append(_t("IPv6")).append("</th>" +
@@ -1379,7 +1379,7 @@ public class NTCPTransport extends TransportImpl {
"<th align=\"right\"><a href=\"#def.send\">").append(_t("TX")).append("</a></th>" +
"<th align=\"right\"><a href=\"#def.recv\">").append(_t("RX")).append("</a></th>" +
"<th>").append(_t("Out Queue")).append("</th>" +
"<th>").append(_t("Backlogged?")).append("</th>" +
"<th title=\"").append(_t("Is peer backlogged?")).append("\">").append(_t("Backlogged?")).append("</th>" +
//"<th>").append(_t("Reading?")).append("</th>" +
" </tr>\n");
out.write(buf.toString());
@@ -1397,7 +1397,7 @@ public class NTCPTransport extends TransportImpl {
buf.append("<img src=\"/themes/console/images/outbound.png\" alt=\"Outbound\" title=\"").append(_t("Outbound")).append("\"/>");
buf.append("</td><td class=\"cells\" align=\"center\">");
if (con.isIPv6())
buf.append("&#x2713;");
buf.append("<span class=\"backlogged\">&#x2714;</span>");
else
buf.append("&nbsp;");
buf.append("</td><td class=\"cells\" align=\"right\">");
@@ -1432,7 +1432,7 @@ public class NTCPTransport extends TransportImpl {
buf.append("</td><td class=\"cells\" align=\"center\">").append(outQueue);
buf.append("</td><td class=\"cells\" align=\"center\">");
if (con.isBacklogged())
buf.append("&#x2713;");
buf.append("<span class=\"backlogged\">&#x2714;</span>");
else
buf.append("&nbsp;");
//long readTime = con.getReadTime();
@@ -1457,7 +1457,7 @@ public class NTCPTransport extends TransportImpl {
buf.append("</b></td><td>&nbsp;</td><td>&nbsp;</td></tr>\n");
}
buf.append("</table>\n");
buf.append("</table></div>\n");
out.write(buf.toString());
buf.setLength(0);
}

View File

@@ -285,20 +285,21 @@ class Sorters {
static void appendSortLinks(StringBuilder buf, String urlBase, int sortFlags, String descr, int ascending) {
if (ascending == FLAG_ALPHA) { // 0
buf.append(" <a href=\"").append(urlBase).append("?sort=0" +
"#udpcon\" title=\"").append(descr).append("\"><img src=\"/themes/console/images/inbound.png\" alt=\"V\"></a>");
buf.append(" <span class=\"sortdown\"><a href=\"").append(urlBase).append("?sort=0" +
"#udpcon\" title=\"").append(descr).append("\"><img src=\"/themes/console/images/inbound.png\" alt=\"V\"></a></span>");
} else if (sortFlags == ascending) {
buf.append(" <a href=\"").append(urlBase).append("?sort=").append(0-ascending);
buf.append("#udpcon\" title=\"").append(descr).append("\"><img src=\"/themes/console/images/inbound.png\" alt=\"V\"></a>" +
"<b><img src=\"/themes/console/images/outbound.png\" alt=\"^\"></b>");
buf.append(" <span class=\"sortdown\"><a href=\"").append(urlBase).append("?sort=").append(0-ascending);
buf.append("#udpcon\" title=\"").append(descr).append("\"><img src=\"/themes/console/images/inbound.png\" alt=\"V\"></a></span>" +
"<span class=\"sortupactive\"><b><img src=\"/themes/console/images/outbound.png\" alt=\"^\"></b></span>");
} else if (sortFlags == 0 - ascending) {
buf.append(" <b><img src=\"/themes/console/images/inbound.png\" alt=\"V\"></b><a href=\"").append(urlBase).append("?sort=").append(ascending);
buf.append("#udpcon\" title=\"").append(descr).append("\"><img src=\"/themes/console/images/outbound.png\" alt=\"^\"></a>");
buf.append(" <span class=\"sortdownactive\"><b><img src=\"/themes/console/images/inbound.png\" alt=\"V\"></b></span><span class=\"sortup\"><a href=\"")
.append(urlBase).append("?sort=").append(ascending);
buf.append("#udpcon\" title=\"").append(descr).append("\"><img src=\"/themes/console/images/outbound.png\" alt=\"^\"></a></span>");
} else {
buf.append(" <a href=\"").append(urlBase).append("?sort=").append(0-ascending);
buf.append("#udpcon\" title=\"").append(descr).append("\"><img src=\"/themes/console/images/inbound.png\" alt=\"V\"></a>" +
"<a href=\"").append(urlBase).append("?sort=").append(ascending);
buf.append("#udpcon\" title=\"").append(descr).append("\"><img src=\"/themes/console/images/outbound.png\" alt=\"^\"></a>");
buf.append(" <span class=\"sortdown\"><a href=\"").append(urlBase).append("?sort=").append(0-ascending);
buf.append("#udpcon\" title=\"").append(descr).append("\"><img src=\"/themes/console/images/inbound.png\" alt=\"V\"></a></span>" +
"<span class=\"sortup\"><a href=\"").append(urlBase).append("?sort=").append(ascending);
buf.append("#udpcon\" title=\"").append(descr).append("\"><img src=\"/themes/console/images/outbound.png\" alt=\"^\"></a></span>");
}
}
}

View File

@@ -2672,7 +2672,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
buf.append(". ").append(_t("Status")).append(": ").append(_t(_reachabilityStatus.toStatusString()));
}
buf.append(".</h3>\n");
buf.append("<table>\n");
buf.append("<div class=\"widescroll\"><table id=\"udpconnections\">\n");
buf.append("<tr><th class=\"smallhead\" nowrap><a href=\"#def.peer\">").append(_t("Peer")).append("</a><br>");
if (sortFlags != FLAG_ALPHA)
appendSortLinks(buf, urlBase, sortFlags, _t("Sort by peer hash"), FLAG_ALPHA);
@@ -2936,7 +2936,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
buf.append("</td></tr>");
}
} // numPeers > 0
buf.append("</table>\n");
buf.append("</table></div>\n");
/*****
long bytesTransmitted = _context.bandwidthLimiter().getTotalAllocatedOutboundBytes();