Changeset 39039b8
- Timestamp:
- Mar 10, 2018 5:19:38 PM (3 years ago)
- Branches:
- master
- Children:
- eb321445
- Parents:
- e7c2162
- Location:
- apps/routerconsole/java/src/net/i2p/router/web/helpers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigTunnelsHelper.java
re7c2162 r39039b8 7 7 import net.i2p.data.Destination; 8 8 import net.i2p.router.TunnelPoolSettings; 9 import net.i2p.router.transport.TransportUtil; 9 10 import net.i2p.router.web.HelperBase; 10 11 … … 78 79 in.getLength() + in.getLengthVariance() <= 0 || 79 80 out.getLength() <= 0 || 80 out.getLength() + out.getLengthVariance() <= 0) 81 out.getLength() + out.getLengthVariance() <= 0) { 81 82 buf.append("<tr><th colspan=\"3\"><font color=\"red\">" + _t("ANONYMITY WARNING - Settings include 0-hop tunnels.") + "</font></th></tr>"); 82 else if (in.getLength() <= 1 || 83 if (TransportUtil.getIPv6Config(_context, "SSU") == TransportUtil.IPv6Config.IPV6_ONLY) { 84 // rare, don't bother translating 85 buf.append("<tr><th colspan=\"3\"><font color=\"red\">WARNING - 0-hop tunnels not recommended for IPv6-only routers.</font></th></tr>"); 86 } 87 if ((in.getLength() <= 0 || in.getLength() + in.getLengthVariance() <= 0) && 88 _context.router().isHidden()) { 89 // rare, don't bother translating 90 buf.append("<tr><th colspan=\"3\"><font color=\"red\">WARNING - Inbound 0-hop tunnels not recommended for hidden routers.</font></th></tr>"); 91 } 92 } else if (in.getLength() <= 1 || 83 93 in.getLength() + in.getLengthVariance() <= 1 || 84 94 out.getLength() <= 1 || 85 out.getLength() + out.getLengthVariance() <= 1) 95 out.getLength() + out.getLengthVariance() <= 1) { 86 96 buf.append("<tr><th colspan=\"3\"><font color=\"red\">" + _t("ANONYMITY WARNING - Settings include 1-hop tunnels.") + "</font></th></tr>"); 97 } 87 98 if (in.getLength() + Math.abs(in.getLengthVariance()) >= WARN_LENGTH || 88 99 out.getLength() + Math.abs(out.getLengthVariance()) >= WARN_LENGTH) -
apps/routerconsole/java/src/net/i2p/router/web/helpers/NetDbRenderer.java
re7c2162 r39039b8 16 16 import java.text.DecimalFormat; // debug 17 17 import java.util.ArrayList; 18 import java.util.Collection; 18 19 import java.util.Collections; 19 20 import java.util.Comparator; … … 648 649 .append(info.getIdentity().getSigningPublicKey().getType().toString()); 649 650 buf.append("</td></tr>\n<tr>") 650 .append("<td><b>" + _t("Address (es)") + ":</b></td>")651 .append("<td><b>" + _t("Addresses") + ":</b></td>") 651 652 .append("<td colspan=\"2\" class=\"netdb_addresses\">"); 652 for (RouterAddress addr : info.getAddresses()) { 653 String style = addr.getTransportStyle(); 654 buf.append("<br><b class=\"netdb_transport\">").append(DataHelper.stripHTML(style)).append(":</b>"); 655 int cost = addr.getCost(); 656 if (!((style.equals("SSU") && cost == 5) || (style.equals("NTCP") && cost == 10))) 657 buf.append(" <span class=\"netdb_name\">").append(_t("cost")).append("</span>: <span class=\"netdb_info\">").append("" + cost).append("</span> "); 658 Map<Object, Object> p = addr.getOptionsMap(); 659 for (Map.Entry<Object, Object> e : p.entrySet()) { 660 String name = (String) e.getKey(); 661 String val = (String) e.getValue(); 662 buf.append(" <span class=\"nowrap\"><span class=\"netdb_name\">").append(_t(DataHelper.stripHTML(name))) 663 .append(":</span> <span class=\"netdb_info\">").append(DataHelper.stripHTML(val)).append("</span></span> "); 653 Collection<RouterAddress> addrs = info.getAddresses(); 654 if (addrs.isEmpty()) { 655 buf.append(_t("none")); 656 } else { 657 for (RouterAddress addr : info.getAddresses()) { 658 String style = addr.getTransportStyle(); 659 buf.append("<br><b class=\"netdb_transport\">").append(DataHelper.stripHTML(style)).append(":</b>"); 660 int cost = addr.getCost(); 661 if (!((style.equals("SSU") && cost == 5) || (style.equals("NTCP") && cost == 10))) 662 buf.append(" <span class=\"netdb_name\">").append(_t("cost")).append("</span>: <span class=\"netdb_info\">").append("" + cost).append("</span> "); 663 Map<Object, Object> p = addr.getOptionsMap(); 664 for (Map.Entry<Object, Object> e : p.entrySet()) { 665 String name = (String) e.getKey(); 666 String val = (String) e.getValue(); 667 buf.append(" <span class=\"nowrap\"><span class=\"netdb_name\">").append(_t(DataHelper.stripHTML(name))) 668 .append(":</span> <span class=\"netdb_info\">").append(DataHelper.stripHTML(val)).append("</span></span> "); 669 } 664 670 } 665 671 }
Note: See TracChangeset
for help on using the changeset viewer.