merge of '0d58ec9e2b160029e92a584b0c707ffdf4f25c7e'
and 'd4e270a4df0c8134d7bac1585e30ef8ddef37f85'
This commit is contained in:
@ -33,7 +33,8 @@ public class ConfigRestartBean {
|
||||
ctx.addShutdownTask(new ConfigServiceHandler.UpdateWrapperManagerTask(Router.EXIT_HARD));
|
||||
//ctx.router().shutdown(Router.EXIT_HARD); // never returns
|
||||
ctx.router().shutdownGracefully(Router.EXIT_HARD); // give the UI time to respond
|
||||
} else if ("cancelShutdown".equals(action) || _("Cancel shutdown", ctx).equals(action)) {
|
||||
} else if ("cancelShutdown".equals(action) || _("Cancel shutdown", ctx).equals(action) ||
|
||||
_("Cancel restart", ctx).equals(action)) {
|
||||
ctx.router().cancelGracefulShutdown();
|
||||
} else if ("restartImmediate".equals(action) || _("Restart immediately", ctx).equals(action)) {
|
||||
ctx.addShutdownTask(new ConfigServiceHandler.UpdateWrapperManagerTask(Router.EXIT_HARD_RESTART));
|
||||
|
@ -37,6 +37,7 @@ public class ConfigUIHelper extends HelperBase {
|
||||
}
|
||||
|
||||
private static final String langs[] = {"de", "en", "fr", "nl", "se", "zh"};
|
||||
private static final String flags[] = {"de", "us", "fr", "nl", "se", "cn"};
|
||||
private static final String xlangs[] = {_x("German"), _x("English"), _x("French"),
|
||||
_x("Dutch"), _x("Swedish"), _x("Chinese")};
|
||||
|
||||
@ -49,7 +50,9 @@ public class ConfigUIHelper extends HelperBase {
|
||||
buf.append("<input type=\"radio\" class=\"optbox\" name=\"lang\" ");
|
||||
if (langs[i].equals(current))
|
||||
buf.append("checked=\"true\" ");
|
||||
buf.append("value=\"").append(langs[i]).append("\">").append(_(xlangs[i])).append("<br>\n");
|
||||
buf.append("value=\"").append(langs[i]).append("\">")
|
||||
.append("<img height=\"11\" width=\"16\" alt=\"\" src=\"/flags.jsp?c=").append(flags[i]).append("\"> ")
|
||||
.append(_(xlangs[i])).append("<br>\n");
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
@ -84,8 +84,8 @@ public class NetDbRenderer {
|
||||
public void renderLeaseSetHTML(Writer out) throws IOException {
|
||||
StringBuilder buf = new StringBuilder(4*1024);
|
||||
buf.append("<h2>" + _("Network Database Contents") + "</h2>\n");
|
||||
buf.append("<a href=\"netdb.jsp\">" + _("View") + " RouterInfo</a>");
|
||||
buf.append("<h3>LeaseSets</h3>\n");
|
||||
buf.append("<a href=\"netdb.jsp\">" + _("View RouterInfo") + "</a>");
|
||||
buf.append("<h3>").append(_("LeaseSets")).append("</h3>\n");
|
||||
Set leases = new TreeSet(new LeaseSetComparator());
|
||||
leases.addAll(_context.netDb().getLeases());
|
||||
long now = _context.clock().now();
|
||||
@ -132,7 +132,7 @@ public class NetDbRenderer {
|
||||
}
|
||||
|
||||
public void renderStatusHTML(Writer out, boolean full) throws IOException {
|
||||
out.write("<h2>" + _("Network Database Contents") + " (<a href=\"netdb.jsp?l=1\">" + _("View") + " LeaseSets</a>)</h2>\n");
|
||||
out.write("<h2>" + _("Network Database Contents") + " (<a href=\"netdb.jsp?l=1\">" + _("View LeaseSets") + "</a>)</h2>\n");
|
||||
if (!_context.netDb().isInitialized()) {
|
||||
out.write(_("Not initialized"));
|
||||
out.flush();
|
||||
@ -244,7 +244,7 @@ public class NetDbRenderer {
|
||||
}
|
||||
for (Iterator iter = info.getAddresses().iterator(); iter.hasNext(); ) {
|
||||
RouterAddress addr = (RouterAddress)iter.next();
|
||||
buf.append(DataHelper.stripHTML(addr.getTransportStyle())).append(": ");
|
||||
buf.append("<b>").append(DataHelper.stripHTML(addr.getTransportStyle())).append("</b>: ");
|
||||
for (Iterator optIter = addr.getOptions().keySet().iterator(); optIter.hasNext(); ) {
|
||||
String name = (String)optIter.next();
|
||||
String val = addr.getOptions().getProperty(name);
|
||||
|
@ -105,6 +105,9 @@ class ProfileOrganizerRenderer {
|
||||
|
||||
buf.append("<tr><td align=\"center\" nowrap>");
|
||||
buf.append(_context.commSystem().renderPeerHTML(peer));
|
||||
// debug
|
||||
//if(prof.getIsExpandedDB())
|
||||
// buf.append(" ** ");
|
||||
buf.append("</td><td align=\"center\">");
|
||||
|
||||
switch (tier) {
|
||||
@ -145,18 +148,19 @@ class ProfileOrganizerRenderer {
|
||||
buf.append("</td><td align=\"right\">").append(num(prof.getIntegrationValue()));
|
||||
buf.append("</td><td align=\"center\">");
|
||||
if (_context.shitlist().isShitlisted(peer)) buf.append(_("Banned"));
|
||||
if (prof.getIsFailing()) buf.append(" ").append(_("Failing"));
|
||||
if (_context.commSystem().wasUnreachable(peer)) buf.append(" ").append(_("Unreachable"));
|
||||
if (prof.getIsFailing()) buf.append(' ').append(_("Failing"));
|
||||
if (_context.commSystem().wasUnreachable(peer)) buf.append(' ').append(_("Unreachable"));
|
||||
Rate failed = prof.getTunnelHistory().getFailedRate().getRate(30*60*1000);
|
||||
long fails = failed.getCurrentEventCount() + failed.getLastEventCount();
|
||||
if (fails > 0) {
|
||||
Rate accepted = prof.getTunnelCreateResponseTime().getRate(30*60*1000);
|
||||
long total = fails + accepted.getCurrentEventCount() + accepted.getLastEventCount();
|
||||
if (total / fails <= 10) // hide if < 10%
|
||||
buf.append(' ').append(fails).append('/').append(total).append(" ").append(_("Test Fails"));
|
||||
buf.append(' ').append(fails).append('/').append(total).append(' ').append(_("Test Fails"));
|
||||
}
|
||||
buf.append(" </td>");
|
||||
buf.append("<td nowrap align=\"center\"><a target=\"_blank\" href=\"dumpprofile.jsp?peer=").append(peer.toBase64().substring(0,6)).append("\">profile</a>");
|
||||
buf.append("<td nowrap align=\"center\"><a target=\"_blank\" href=\"dumpprofile.jsp?peer=")
|
||||
.append(peer.toBase64().substring(0,6)).append("\">").append(_("profile")).append("</a>");
|
||||
buf.append(" <a href=\"configpeer.jsp?peer=").append(peer.toBase64()).append("\">+-</a></td>\n");
|
||||
buf.append("</tr>");
|
||||
// let's not build the whole page in memory (~500 bytes per peer)
|
||||
@ -223,14 +227,20 @@ class ProfileOrganizerRenderer {
|
||||
buf.append("<td align=\"right\">").append(dbh.getUnpromptedDbStoreOld()).append("</td>");
|
||||
buf.append("<td align=\"right\">").append(davg(dbh, 60*60*1000l)).append("</td>");
|
||||
buf.append("<td align=\"right\">").append(davg(dbh, 24*60*60*1000l)).append("</td>");
|
||||
} else {
|
||||
for (int i = 0; i < 6; i++)
|
||||
buf.append("<td align=\"right\">").append(_(NA));
|
||||
}
|
||||
}
|
||||
buf.append("</table>");
|
||||
|
||||
buf.append("<h3>").append(_("Thresholds:")).append("</h3>");
|
||||
buf.append("<p><b>").append(_("Speed")).append(":</b> ").append(num(_organizer.getSpeedThreshold())).append(" (").append(fast).append(" fast peers)<br>");
|
||||
buf.append("<b>").append(_("Capacity")).append(":</b> ").append(num(_organizer.getCapacityThreshold())).append(" (").append(reliable).append(" high capacity peers)<br>");
|
||||
buf.append("<b>").append(_("Integration")).append(":</b> ").append(num(_organizer.getIntegrationThreshold())).append(" (").append(integrated).append(" well integrated peers)</p>");
|
||||
buf.append("<p><b>").append(_("Speed")).append(":</b> ").append(num(_organizer.getSpeedThreshold()))
|
||||
.append(" (").append(fast).append(' ').append(_("fast peers")).append(")<br>");
|
||||
buf.append("<b>").append(_("Capacity")).append(":</b> ").append(num(_organizer.getCapacityThreshold()))
|
||||
.append(" (").append(reliable).append(' ').append(_("high capacity peers")).append(")<br>");
|
||||
buf.append("<b>").append(_("Integration")).append(":</b> ").append(num(_organizer.getIntegrationThreshold()))
|
||||
.append(" (").append(integrated).append(' ').append(_(" well integrated peers")).append(")</p>");
|
||||
buf.append("<h3>").append(_("Definitions")).append(":</h3><ul>");
|
||||
buf.append("<li><b>").append(_("groups")).append("</b>: ").append(_("as determined by the profile organizer")).append("</li>");
|
||||
buf.append("<li><b>").append(_("caps")).append("</b>: ").append(_("capabilities in the netDb, not used to determine profiles")).append("</li>");
|
||||
@ -295,29 +305,29 @@ class ProfileOrganizerRenderer {
|
||||
|
||||
private final static DecimalFormat _fmt = new DecimalFormat("###,##0.00");
|
||||
private final static String num(double num) { synchronized (_fmt) { return _fmt.format(num); } }
|
||||
private final static String na = "n/a";
|
||||
private final static String NA = HelperBase._x("n/a");
|
||||
|
||||
private static String avg (PeerProfile prof, long rate) {
|
||||
private String avg (PeerProfile prof, long rate) {
|
||||
RateStat rs = prof.getDbResponseTime();
|
||||
if (rs == null)
|
||||
return na;
|
||||
return _(NA);
|
||||
Rate r = rs.getRate(rate);
|
||||
if (r == null)
|
||||
return na;
|
||||
return _(NA);
|
||||
long c = r.getCurrentEventCount() + r.getLastEventCount();
|
||||
if (c == 0)
|
||||
return na;
|
||||
return _(NA);
|
||||
double d = r.getCurrentTotalValue() + r.getLastTotalValue();
|
||||
return Math.round(d/c) + "ms";
|
||||
}
|
||||
|
||||
private static String davg (DBHistory dbh, long rate) {
|
||||
private String davg (DBHistory dbh, long rate) {
|
||||
RateStat rs = dbh.getFailedLookupRate();
|
||||
if (rs == null)
|
||||
return na;
|
||||
return _(NA);
|
||||
Rate r = rs.getRate(rate);
|
||||
if (r == null)
|
||||
return na;
|
||||
return _(NA);
|
||||
long c = r.getCurrentEventCount() + r.getLastEventCount();
|
||||
return "" + c;
|
||||
}
|
||||
|
@ -104,7 +104,7 @@
|
||||
<input name ="udpHost1" type="text" size="16" value="<jsp:getProperty name="nethelper" property="udphostname" />" />
|
||||
<% String[] ips = nethelper.getAddresses();
|
||||
if (ips.length > 0) {
|
||||
out.print(" " + intl._("or") + " <select name=\"udpHost2\"><option value=\"\" selected=\"true\">"+intl._("Select Interface")+"</option>\n");
|
||||
out.print(intl._("or") + " <select name=\"udpHost2\"><option value=\"\" selected=\"true\">"+intl._("Select Interface")+"</option>\n");
|
||||
for (int i = 0; i < ips.length; i++) {
|
||||
out.print("<option value=\"");
|
||||
out.print(ips[i]);
|
||||
@ -156,7 +156,7 @@
|
||||
<hr><div class="formaction">
|
||||
<input type="submit" name="save" value="<%=intl._("Save changes")%>" /> <input type="reset" value="<%=intl._("Cancel")%>" />
|
||||
</div><h3><a name="chelp"><%=intl._("Configuration Help")%>:</a></h3><div align="justify"><p>
|
||||
<%=intl._("While I2P will work fine behind most firewalls, your speeds and network integration will generally improve if the I2P port (generally 8887) is forwarded for both UDP and TCP.")%>
|
||||
<%=intl._("While I2P will work fine behind most firewalls, your speeds and network integration will generally improve if the I2P port is forwarded for both UDP and TCP.")%>
|
||||
</p><p>
|
||||
<%=intl._("If you can, please poke a hole in your firewall to allow unsolicited UDP and TCP packets to reach you.")%>
|
||||
<%=intl._("If you can't, I2P supports UPnP (Universal Plug and Play) and UDP hole punching with \"SSU introductions\" to relay traffic.")%>
|
||||
@ -187,7 +187,7 @@
|
||||
<%=intl._("When in doubt, leave the settings at the defaults.")%>
|
||||
</p>
|
||||
<h3><a name="help"><%=intl._("Reachability Help")%>:</a></h3><p>
|
||||
<%=intl._("While I2P will work fine behind most firewalls, your speeds and network integration will generally improve if the I2P port (generally 8887) is forwarded for both UDP and TCP.")%>
|
||||
<%=intl._("While I2P will work fine behind most firewalls, your speeds and network integration will generally improve if the I2P port is forwarded for both UDP and TCP.")%>
|
||||
<%=intl._("If you think you have opened up your firewall and I2P still thinks you are firewalled, remember that you may have multiple firewalls, for example both software packages and external hardware routers.")%>
|
||||
<%=intl._("If there is an error, the <a href=\"logs.jsp\">logs</a> may also help diagnose the problem.")%>
|
||||
<ul>
|
||||
@ -196,7 +196,7 @@
|
||||
<li class="tidylist"><b><%=intl._("Firewalled")%></b> -
|
||||
<%=intl._("Your UDP port appears to be firewalled.")%>
|
||||
<%=intl._("As the firewall detection methods are not 100% reliable, this may occasionally be displayed in error.")%>
|
||||
<%=intl._("However, if it appears consistently, you should check whether both your external and internal firewalls are open on port 8887.")%>
|
||||
<%=intl._("However, if it appears consistently, you should check whether both your external and internal firewalls are open for your port.")%>
|
||||
<%=intl._("I2P will work fine when firewalled, there is no reason for concern. When firewalled, the router uses \"introducers\" to relay inbound connections.")%>
|
||||
<%=intl._("However, you will get more participating traffic and help the network more if you can open your firewall(s).")%>
|
||||
<%=intl._("If you think you have already done so, remember that you may have both a hardware and a software firewall, or be behind an additional, institutional firewall you cannot control.")%>
|
||||
@ -230,7 +230,7 @@
|
||||
<%=intl._("I2P does not work well behind this type of firewall. You will probably not be able to accept inbound connections, which will limit your participation in the network.")%>
|
||||
<li class="tidylist"><b><%=intl._("ERR - UDP Port In Use - Set i2np.udp.internalPort=xxxx in advanced config and restart")%></b> -
|
||||
<%=intl._("I2P was unable to bind to port 8887 or other configured port.")%>
|
||||
<%=intl._("Check to see if another program is using port 8887. If so, stop that program or configure I2P to use a different port.")%>
|
||||
<%=intl._("Check to see if another program is using the configured port. If so, stop that program or configure I2P to use a different port.")%>
|
||||
<%=intl._("This may be a transient error, if the other program is no longer using the port.")%>
|
||||
<%=intl._("However, a restart is always required after this error.")%>
|
||||
<li class="tidylist"><b><%=intl._("ERR - UDP Disabled and Inbound TCP host/port not set")%></b> -
|
||||
|
Reference in New Issue
Block a user