forked from I2P_Developers/i2p.i2p
add firewall and reseed status on /home
This commit is contained in:
@ -266,47 +266,7 @@ public class SummaryBarRenderer {
|
||||
out.write(buf.toString());
|
||||
buf.setLength(0);
|
||||
|
||||
|
||||
boolean anotherLine = false;
|
||||
if (_helper.showFirewallWarning()) {
|
||||
buf.append("<h4><a href=\"/confignet\" target=\"_top\" title=\"")
|
||||
.append(_("Help with firewall configuration"))
|
||||
.append("\">")
|
||||
.append(_("Check network connection and NAT/firewall"))
|
||||
.append("</a></h4>");
|
||||
anotherLine = true;
|
||||
}
|
||||
|
||||
boolean reseedInProgress = Boolean.valueOf(System.getProperty("net.i2p.router.web.ReseedHandler.reseedInProgress")).booleanValue();
|
||||
// If showing the reseed link is allowed
|
||||
if (_helper.allowReseed()) {
|
||||
if (reseedInProgress) {
|
||||
// While reseed occurring, show status message instead
|
||||
buf.append("<i>").append(System.getProperty("net.i2p.router.web.ReseedHandler.statusMessage","")).append("</i><br>");
|
||||
} else {
|
||||
// While no reseed occurring, show reseed link
|
||||
long nonce = _context.random().nextLong();
|
||||
String prev = System.getProperty("net.i2p.router.web.ReseedHandler.nonce");
|
||||
if (prev != null) System.setProperty("net.i2p.router.web.ReseedHandler.noncePrev", prev);
|
||||
System.setProperty("net.i2p.router.web.ReseedHandler.nonce", nonce+"");
|
||||
String uri = _helper.getRequestURI();
|
||||
buf.append("<p><form action=\"").append(uri).append("\" method=\"POST\">\n");
|
||||
buf.append("<input type=\"hidden\" name=\"reseedNonce\" value=\"").append(nonce).append("\" >\n");
|
||||
buf.append("<button type=\"submit\" class=\"reload\" value=\"Reseed\" >").append(_("Reseed")).append("</button></form></p>\n");
|
||||
}
|
||||
anotherLine = true;
|
||||
}
|
||||
// If a new reseed ain't running, and the last reseed had errors, show error message
|
||||
if (!reseedInProgress) {
|
||||
String reseedErrorMessage = System.getProperty("net.i2p.router.web.ReseedHandler.errorMessage","");
|
||||
if (reseedErrorMessage.length() > 0) {
|
||||
buf.append("<i>").append(reseedErrorMessage).append("</i><br>");
|
||||
anotherLine = true;
|
||||
}
|
||||
}
|
||||
if (anotherLine)
|
||||
buf.append("<hr>");
|
||||
|
||||
buf.append(_helper.getFirewallAndReseedStatus());
|
||||
|
||||
buf.append("<h3><a href=\"/config\" title=\"")
|
||||
.append(_("Configure router bandwidth allocation"))
|
||||
|
Reference in New Issue
Block a user