2009-10-19 13:49:47 +00:00
|
|
|
package net.i2p.router.web;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.Writer;
|
|
|
|
|
2010-11-14 15:03:50 +00:00
|
|
|
import net.i2p.data.DataHelper;
|
2009-10-19 13:49:47 +00:00
|
|
|
import net.i2p.router.RouterContext;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Refactored from summarynoframe.jsp to save ~100KB
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class SummaryBarRenderer {
|
2011-10-17 17:28:57 +00:00
|
|
|
private final RouterContext _context;
|
|
|
|
private final SummaryHelper _helper;
|
2009-10-19 13:49:47 +00:00
|
|
|
|
|
|
|
public SummaryBarRenderer(RouterContext context, SummaryHelper helper) {
|
|
|
|
_context = context;
|
|
|
|
_helper = helper;
|
|
|
|
}
|
|
|
|
|
2009-12-11 19:03:30 +00:00
|
|
|
/**
|
|
|
|
* Note - ensure all links in here are absolute, as the summary bar may be displayed
|
|
|
|
* on lower-level directory errors.
|
|
|
|
*/
|
2009-10-19 13:49:47 +00:00
|
|
|
public void renderSummaryHTML(Writer out) throws IOException {
|
|
|
|
StringBuilder buf = new StringBuilder(8*1024);
|
2010-06-27 17:04:51 +00:00
|
|
|
String theme = _context.getProperty(CSSHelper.PROP_THEME_NAME, CSSHelper.DEFAULT_THEME);
|
|
|
|
|
2010-11-17 22:26:31 +00:00
|
|
|
buf.append("<a href=\"/\" target=\"_top\"><img src=\"")
|
2010-06-27 17:04:51 +00:00
|
|
|
.append(CSSHelper.BASE_THEME_PATH)
|
|
|
|
.append(theme)
|
|
|
|
.append("/images/i2plogo.png\" alt=\"")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_("I2P Router Console"))
|
|
|
|
.append("\" title=\"")
|
|
|
|
.append(_("I2P Router Console"))
|
2010-07-07 19:04:30 +00:00
|
|
|
.append("\"></a><hr>")
|
|
|
|
|
2010-11-17 22:26:31 +00:00
|
|
|
.append("<h3><a href=\"/help\" target=\"_top\" title=\"")
|
2010-07-07 19:04:30 +00:00
|
|
|
.append(_("I2P Router Help & FAQ"))
|
|
|
|
.append("\">")
|
|
|
|
.append(_("Help & FAQ"))
|
|
|
|
.append("</a></h3><hr>");
|
2009-10-19 13:49:47 +00:00
|
|
|
|
|
|
|
File lpath = new File(_context.getBaseDir(), "docs/toolbar.html");
|
|
|
|
// you better have target="_top" for the links in there...
|
|
|
|
if (lpath.exists()) {
|
|
|
|
ContentHelper linkhelper = new ContentHelper();
|
|
|
|
linkhelper.setPage(lpath.getAbsolutePath());
|
|
|
|
linkhelper.setMaxLines("100");
|
|
|
|
buf.append(linkhelper.getContent());
|
|
|
|
} else {
|
2010-11-17 22:26:31 +00:00
|
|
|
buf.append("<h3><a href=\"/configclients\" target=\"_top\" title=\"")
|
2009-10-29 23:22:51 +00:00
|
|
|
.append(_("Configure startup of clients and webapps (services); manually start dormant services"))
|
2009-10-19 13:49:47 +00:00
|
|
|
.append("\">")
|
|
|
|
.append(_("I2P Services"))
|
|
|
|
.append("</a></h3>\n" +
|
|
|
|
|
|
|
|
"<hr><table>" +
|
|
|
|
|
2009-12-11 19:03:30 +00:00
|
|
|
"<tr><td><a href=\"/susidns/index.jsp\" target=\"_blank\" title=\"")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_("Manage your I2P hosts file here (I2P domain name resolution)"))
|
|
|
|
.append("\">")
|
|
|
|
.append(_("Addressbook"))
|
|
|
|
.append("</a>\n" +
|
|
|
|
|
2009-12-11 19:03:30 +00:00
|
|
|
"<a href=\"/i2psnark/\" target=\"_blank\" title=\"")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_("Built-in anonymous BitTorrent Client"))
|
|
|
|
.append("\">")
|
|
|
|
.append(_("Torrents"))
|
|
|
|
.append("</a>\n" +
|
|
|
|
|
2009-12-11 19:03:30 +00:00
|
|
|
"<a href=\"/susimail/susimail\" target=\"blank\" title=\"")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_("Anonymous webmail client"))
|
|
|
|
.append("\">")
|
|
|
|
.append(_("Webmail"))
|
|
|
|
.append("</a>\n" +
|
|
|
|
|
|
|
|
"<a href=\"http://127.0.0.1:7658/\" target=\"_blank\" title=\"")
|
|
|
|
.append(_("Anonymous resident webserver"))
|
|
|
|
.append("\">")
|
|
|
|
.append(_("Webserver"))
|
2010-02-07 19:01:06 +00:00
|
|
|
.append("</a>")
|
|
|
|
|
|
|
|
.append(NavHelper.getClientAppLinks(_context))
|
|
|
|
|
|
|
|
.append("</td></tr></table>\n" +
|
2009-10-19 13:49:47 +00:00
|
|
|
|
2010-11-17 22:26:31 +00:00
|
|
|
"<hr><h3><a href=\"/config\" target=\"_top\" title=\"")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_("Configure I2P Router"))
|
|
|
|
.append("\">")
|
|
|
|
.append(_("I2P Internals"))
|
|
|
|
.append("</a></h3><hr>\n" +
|
|
|
|
|
|
|
|
"<table><tr><td>\n" +
|
|
|
|
|
2010-11-17 22:26:31 +00:00
|
|
|
"<a href=\"/tunnels\" target=\"_top\" title=\"")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_("View existing tunnels and tunnel build status"))
|
|
|
|
.append("\">")
|
|
|
|
.append(_("Tunnels"))
|
|
|
|
.append("</a>\n" +
|
|
|
|
|
2010-11-17 22:26:31 +00:00
|
|
|
"<a href=\"/peers\" target=\"_top\" title=\"")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_("Show all current peer connections"))
|
|
|
|
.append("\">")
|
|
|
|
.append(_("Peers"))
|
|
|
|
.append("</a>\n" +
|
|
|
|
|
2010-11-17 22:26:31 +00:00
|
|
|
"<a href=\"/profiles\" target=\"_top\" title=\"")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_("Show recent peer performance profiles"))
|
|
|
|
.append("\">")
|
|
|
|
.append(_("Profiles"))
|
|
|
|
.append("</a>\n" +
|
|
|
|
|
2010-11-17 22:26:31 +00:00
|
|
|
"<a href=\"/netdb\" target=\"_top\" title=\"")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_("Show list of all known I2P routers"))
|
|
|
|
.append("\">")
|
|
|
|
.append(_("NetDB"))
|
|
|
|
.append("</a>\n" +
|
|
|
|
|
2010-11-17 22:26:31 +00:00
|
|
|
"<a href=\"/logs\" target=\"_top\" title=\"")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_("Health Report"))
|
|
|
|
.append("\">")
|
|
|
|
.append(_("Logs"))
|
2011-05-20 13:47:09 +00:00
|
|
|
.append("</a>\n");
|
2009-10-19 13:49:47 +00:00
|
|
|
|
2010-02-26 16:47:41 +00:00
|
|
|
// "<a href=\"/jobs.jsp\" target=\"_top\" title=\"")
|
|
|
|
// .append(_("Show the router's workload, and how it's performing"))
|
|
|
|
// .append("\">")
|
|
|
|
// .append(_("Jobs"))
|
|
|
|
// .append("</a>\n" +
|
2009-10-19 13:49:47 +00:00
|
|
|
|
2011-05-23 19:22:33 +00:00
|
|
|
if (!StatSummarizer.isDisabled()) {
|
2011-05-20 13:47:09 +00:00
|
|
|
buf.append("<a href=\"/graphs\" target=\"_top\" title=\"")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_("Graph router performance"))
|
|
|
|
.append("\">")
|
|
|
|
.append(_("Graphs"))
|
2011-05-20 13:47:09 +00:00
|
|
|
.append("</a>\n");
|
|
|
|
}
|
2009-10-19 13:49:47 +00:00
|
|
|
|
2011-05-20 13:47:09 +00:00
|
|
|
buf.append("<a href=\"/stats\" target=\"_top\" title=\"")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_("Textual router performance statistics"))
|
|
|
|
.append("\">")
|
|
|
|
.append(_("Stats"))
|
2010-01-06 14:52:53 +00:00
|
|
|
.append("</a>\n" +
|
|
|
|
|
2010-11-19 16:14:14 +00:00
|
|
|
"<a href=\"/i2ptunnel/\" target=\"_blank\" title=\"")
|
2010-01-06 14:52:53 +00:00
|
|
|
.append(_("Local Destinations"))
|
|
|
|
.append("\">")
|
|
|
|
.append(_("I2PTunnel"))
|
2010-11-27 13:50:33 +00:00
|
|
|
.append("</a>\n");
|
2010-01-06 14:52:53 +00:00
|
|
|
|
2010-11-27 13:50:33 +00:00
|
|
|
File javadoc = new File(_context.getBaseDir(), "docs/javadoc/index.html");
|
|
|
|
if (javadoc.exists())
|
|
|
|
buf.append("<a href=\"/javadoc/index.html\" target=\"_blank\">Javadoc</a>\n");
|
|
|
|
buf.append("</td></tr></table>\n");
|
2009-10-19 13:49:47 +00:00
|
|
|
|
|
|
|
out.write(buf.toString());
|
|
|
|
buf.setLength(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-11-17 22:26:31 +00:00
|
|
|
buf.append("<hr><h3><a href=\"/help\" target=\"_top\" title=\"")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_("I2P Router Help"))
|
|
|
|
.append("\">")
|
|
|
|
.append(_("General"))
|
2010-07-07 19:04:30 +00:00
|
|
|
.append("</a></h3><hr>\n" +
|
|
|
|
|
|
|
|
"<table><tr>" +
|
|
|
|
"<td align=\"left\"><b>")
|
|
|
|
.append(_("Local Identity"))
|
|
|
|
.append(":</b></td>" +
|
|
|
|
"<td align=\"right\">" +
|
|
|
|
"<a title=\"")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_("Your unique I2P router identity is"))
|
|
|
|
.append(' ')
|
|
|
|
.append(_helper.getIdent())
|
|
|
|
.append(", ")
|
|
|
|
.append(_("never reveal it to anyone"))
|
2010-11-17 22:26:31 +00:00
|
|
|
.append("\" href=\"/netdb?r=.\" target=\"_top\">")
|
2010-07-07 19:04:30 +00:00
|
|
|
.append(_("show"))
|
|
|
|
.append("</a></td></tr>\n" +
|
2009-10-19 13:49:47 +00:00
|
|
|
|
2010-07-07 19:04:30 +00:00
|
|
|
"<tr><td align=\"left\"><b>")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_("Version"))
|
|
|
|
.append(":</b></td>" +
|
|
|
|
"<td align=\"right\">")
|
|
|
|
.append(_helper.getVersion())
|
|
|
|
.append("</td></tr>\n" +
|
|
|
|
|
|
|
|
"<tr title=\"")
|
|
|
|
.append(_("How long we've been running for this session"))
|
|
|
|
.append("\">" +
|
|
|
|
"<td align=\"left\"><b>")
|
|
|
|
.append(_("Uptime"))
|
|
|
|
.append(":</b></td>" +
|
|
|
|
"<td align=\"right\">")
|
|
|
|
.append(_helper.getUptime())
|
|
|
|
.append("</td></tr></table>\n" +
|
|
|
|
|
2010-11-17 22:26:31 +00:00
|
|
|
"<hr><h4><a href=\"/config#help\" target=\"_top\" title=\"")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_("Help with configuring your firewall and router for optimal I2P performance"))
|
|
|
|
.append("\">")
|
2010-07-07 19:04:30 +00:00
|
|
|
.append(_("Network"))
|
|
|
|
.append(": ")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_helper.getReachability())
|
|
|
|
.append("</a></h4><hr>\n");
|
|
|
|
|
|
|
|
|
2010-02-19 14:42:43 +00:00
|
|
|
// display all the time so we display the final failure message, and plugin update messages too
|
|
|
|
buf.append(UpdateHandler.getStatus());
|
2009-10-19 13:49:47 +00:00
|
|
|
if (_helper.updateAvailable() || _helper.unsignedUpdateAvailable()) {
|
2010-02-06 20:25:13 +00:00
|
|
|
if ("true".equals(System.getProperty(UpdateHandler.PROP_UPDATE_IN_PROGRESS))) {
|
2009-10-19 13:49:47 +00:00
|
|
|
// nothing
|
|
|
|
} else if(
|
|
|
|
// isDone() is always false for now, see UpdateHandler
|
|
|
|
// ((!update.isDone()) &&
|
|
|
|
_helper.getAction() == null &&
|
|
|
|
_helper.getUpdateNonce() == null &&
|
|
|
|
ConfigRestartBean.getRestartTimeRemaining() > 12*60*1000) {
|
|
|
|
long nonce = _context.random().nextLong();
|
|
|
|
String prev = System.getProperty("net.i2p.router.web.UpdateHandler.nonce");
|
|
|
|
if (prev != null)
|
|
|
|
System.setProperty("net.i2p.router.web.UpdateHandler.noncePrev", prev);
|
|
|
|
System.setProperty("net.i2p.router.web.UpdateHandler.nonce", nonce+"");
|
|
|
|
String uri = _helper.getRequestURI();
|
2011-03-08 03:07:02 +00:00
|
|
|
buf.append("<form action=\"").append(uri).append("\" method=\"POST\">\n");
|
2009-10-19 13:49:47 +00:00
|
|
|
buf.append("<input type=\"hidden\" name=\"updateNonce\" value=\"").append(nonce).append("\" >\n");
|
|
|
|
if (_helper.updateAvailable()) {
|
|
|
|
buf.append("<button type=\"submit\" name=\"updateAction\" value=\"signed\" >")
|
2011-03-08 03:07:02 +00:00
|
|
|
// Note to translators: parameter is a version, e.g. "0.8.4"
|
|
|
|
.append(_("Download {0} Update", _helper.getUpdateVersion()))
|
|
|
|
.append("</button><br>\n");
|
2009-10-19 13:49:47 +00:00
|
|
|
}
|
|
|
|
if (_helper.unsignedUpdateAvailable()) {
|
|
|
|
buf.append("<button type=\"submit\" name=\"updateAction\" value=\"Unsigned\" >")
|
2011-03-08 03:07:02 +00:00
|
|
|
// Note to translators: parameter is a date and time, e.g. "02-Mar 20:34 UTC"
|
|
|
|
// <br> is optional, to help the browser make the lines even in the button
|
|
|
|
// If the translation is shorter than the English, you should probably not include <br>
|
|
|
|
.append(_("Download Unsigned<br>Update {0}", _helper.getUnsignedUpdateVersion()))
|
|
|
|
.append("</button><br>\n");
|
2009-10-19 13:49:47 +00:00
|
|
|
}
|
|
|
|
buf.append("</form>\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-08 03:07:02 +00:00
|
|
|
buf.append(ConfigRestartBean.renderStatus(_helper.getRequestURI(), _helper.getAction(), _helper.getConsoleNonce()))
|
2009-10-19 13:49:47 +00:00
|
|
|
|
2011-03-08 03:07:02 +00:00
|
|
|
.append("<hr><h3><a href=\"/peers\" target=\"_top\" title=\"")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_("Show all current peer connections"))
|
|
|
|
.append("\">")
|
|
|
|
.append(_("Peers"))
|
|
|
|
.append("</a></h3><hr>\n" +
|
|
|
|
|
|
|
|
"<table>\n" +
|
|
|
|
|
|
|
|
"<tr><td align=\"left\"><b>")
|
|
|
|
.append(_("Active"))
|
2010-11-19 21:13:35 +00:00
|
|
|
.append(":</b></td><td align=\"right\">");
|
|
|
|
int active = _helper.getActivePeers();
|
|
|
|
buf.append(active)
|
2010-12-19 00:04:55 +00:00
|
|
|
.append(SummaryHelper.THINSP)
|
2010-11-19 21:13:35 +00:00
|
|
|
.append(Math.max(active, _helper.getActiveProfiles()))
|
2009-10-19 13:49:47 +00:00
|
|
|
.append("</td></tr>\n" +
|
|
|
|
|
|
|
|
"<tr><td align=\"left\"><b>")
|
|
|
|
.append(_("Fast"))
|
|
|
|
.append(":</b></td><td align=\"right\">")
|
|
|
|
.append(_helper.getFastPeers())
|
|
|
|
.append("</td></tr>\n" +
|
|
|
|
|
|
|
|
"<tr><td align=\"left\"><b>")
|
|
|
|
.append(_("High capacity"))
|
|
|
|
.append(":</b></td><td align=\"right\">")
|
|
|
|
.append(_helper.getHighCapacityPeers())
|
|
|
|
.append("</td></tr>\n" +
|
|
|
|
|
|
|
|
"<tr><td align=\"left\"><b>")
|
|
|
|
.append(_("Integrated"))
|
|
|
|
.append(":</b></td><td align=\"right\">")
|
|
|
|
.append(_helper.getWellIntegratedPeers())
|
|
|
|
.append("</td></tr>\n" +
|
|
|
|
|
|
|
|
"<tr><td align=\"left\"><b>")
|
|
|
|
.append(_("Known"))
|
|
|
|
.append(":</b></td><td align=\"right\">")
|
|
|
|
.append(_helper.getAllPeers())
|
|
|
|
.append("</td></tr>\n" +
|
|
|
|
|
|
|
|
"</table><hr>\n");
|
|
|
|
|
|
|
|
|
|
|
|
out.write(buf.toString());
|
|
|
|
buf.setLength(0);
|
|
|
|
|
|
|
|
|
2009-10-19 21:40:14 +00:00
|
|
|
boolean anotherLine = false;
|
2009-10-19 13:49:47 +00:00
|
|
|
if (_helper.showFirewallWarning()) {
|
2010-11-17 22:26:31 +00:00
|
|
|
buf.append("<h4><a href=\"/config\" target=\"_top\" title=\"")
|
2009-10-19 13:49:47 +00:00
|
|
|
.append(_("Help with firewall configuration"))
|
|
|
|
.append("\">")
|
|
|
|
.append(_("Check NAT/firewall"))
|
|
|
|
.append("</a></h4>");
|
2009-10-19 21:40:14 +00:00
|
|
|
anotherLine = true;
|
2009-10-19 13:49:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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();
|
2010-11-19 16:42:23 +00:00
|
|
|
buf.append("<p><form action=\"").append(uri).append("\" method=\"POST\">\n");
|
2009-10-19 13:49:47 +00:00
|
|
|
buf.append("<input type=\"hidden\" name=\"reseedNonce\" value=\"").append(nonce).append("\" >\n");
|
2009-10-31 18:18:36 +00:00
|
|
|
buf.append("<button type=\"submit\" value=\"Reseed\" >").append(_("Reseed")).append("</button></form></p>\n");
|
2009-10-19 13:49:47 +00:00
|
|
|
}
|
2009-10-19 21:40:14 +00:00
|
|
|
anotherLine = true;
|
2009-10-19 13:49:47 +00:00
|
|
|
}
|
|
|
|
// 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>");
|
2009-10-19 21:40:14 +00:00
|
|
|
anotherLine = true;
|
2009-10-19 13:49:47 +00:00
|
|
|
}
|
|
|
|
}
|
2009-10-19 21:40:14 +00:00
|
|
|
if (anotherLine)
|
|
|
|
buf.append("<hr>");
|
2009-10-19 13:49:47 +00:00
|
|
|
|
|
|
|
|
2010-11-17 22:26:31 +00:00
|
|
|
buf.append("<h3><a href=\"/config\" title=\"")
|
2009-10-19 21:40:14 +00:00
|
|
|
.append(_("Configure router bandwidth allocation"))
|
|
|
|
.append("\" target=\"_top\">")
|
|
|
|
.append(_("Bandwidth in/out"))
|
|
|
|
.append("</a></h3><hr>" +
|
|
|
|
"<table>\n" +
|
|
|
|
|
2010-11-14 15:03:50 +00:00
|
|
|
"<tr><td align=\"left\"><b>")
|
2010-12-18 13:22:47 +00:00
|
|
|
.append(DataHelper.formatDuration2(3 * 1000)) // lie and say 3 sec since 1 sec would appear as 1000 ms
|
2010-11-14 15:03:50 +00:00
|
|
|
.append(":</b></td><td align=\"right\">")
|
2010-05-10 14:22:37 +00:00
|
|
|
.append(_helper.getSecondKBps())
|
|
|
|
.append("Bps</td></tr>\n");
|
2009-10-19 21:40:14 +00:00
|
|
|
|
2010-05-10 14:22:37 +00:00
|
|
|
if (_context.router().getUptime() > 6*60*1000) {
|
2010-11-14 15:03:50 +00:00
|
|
|
buf.append("<tr><td align=\"left\"><b>")
|
|
|
|
.append(DataHelper.formatDuration2(5 * 60 * 1000)) // 5 min
|
|
|
|
.append(":</b></td><td align=\"right\">")
|
2010-05-10 14:22:37 +00:00
|
|
|
.append(_helper.getFiveMinuteKBps())
|
|
|
|
.append("Bps</td></tr>\n");
|
|
|
|
}
|
2009-10-19 21:40:14 +00:00
|
|
|
|
2010-05-10 14:22:37 +00:00
|
|
|
if (_context.router().getUptime() > 2*60*1000) {
|
|
|
|
buf.append("<tr><td align=\"left\"><b>")
|
2009-10-19 21:40:14 +00:00
|
|
|
.append(_("Total"))
|
|
|
|
.append(":</b></td><td align=\"right\">")
|
2010-05-10 14:22:37 +00:00
|
|
|
.append(_helper.getLifetimeKBps())
|
|
|
|
.append("Bps</td></tr>\n");
|
|
|
|
}
|
2009-10-19 21:40:14 +00:00
|
|
|
|
2010-05-10 14:22:37 +00:00
|
|
|
buf.append("<tr><td align=\"left\"><b>")
|
2009-10-19 21:40:14 +00:00
|
|
|
.append(_("Used"))
|
|
|
|
.append(":</b></td><td align=\"right\">")
|
|
|
|
.append(_helper.getInboundTransferred())
|
2010-12-19 00:04:55 +00:00
|
|
|
.append(SummaryHelper.THINSP)
|
2009-10-19 21:40:14 +00:00
|
|
|
.append(_helper.getOutboundTransferred())
|
|
|
|
.append("</td></tr></table>\n" +
|
|
|
|
|
2010-11-17 22:26:31 +00:00
|
|
|
"<hr><h3><a href=\"/tunnels\" target=\"_top\" title=\"")
|
2009-10-19 21:40:14 +00:00
|
|
|
.append(_("View existing tunnels and tunnel build status"))
|
|
|
|
.append("\">")
|
2010-05-10 14:22:37 +00:00
|
|
|
.append(_("Tunnels"))
|
2009-10-19 21:40:14 +00:00
|
|
|
.append("</a></h3><hr>" +
|
|
|
|
"<table>\n" +
|
|
|
|
|
|
|
|
"<tr><td align=\"left\"><b>")
|
|
|
|
.append(_("Exploratory"))
|
|
|
|
.append(":</b></td><td align=\"right\">")
|
2010-05-10 14:22:37 +00:00
|
|
|
.append(_helper.getInboundTunnels() + _helper.getOutboundTunnels())
|
2009-10-19 21:40:14 +00:00
|
|
|
.append("</td></tr>\n" +
|
|
|
|
|
|
|
|
"<tr><td align=\"left\"><b>")
|
|
|
|
.append(_("Client"))
|
|
|
|
.append(":</b></td><td align=\"right\">")
|
2010-05-10 14:22:37 +00:00
|
|
|
.append(_helper.getInboundClientTunnels() + _helper.getOutboundClientTunnels())
|
2009-10-19 21:40:14 +00:00
|
|
|
.append("</td></tr>\n" +
|
|
|
|
|
|
|
|
"<tr><td align=\"left\"><b>")
|
|
|
|
.append(_("Participating"))
|
|
|
|
.append(":</b></td><td align=\"right\">")
|
|
|
|
.append(_helper.getParticipatingTunnels())
|
2010-01-18 14:57:03 +00:00
|
|
|
.append("</td></tr>\n" +
|
|
|
|
|
|
|
|
"<tr><td align=\"left\"><b>")
|
|
|
|
.append(_("Share ratio"))
|
|
|
|
.append(":</b></td><td align=\"right\">")
|
|
|
|
.append(_helper.getShareRatio())
|
2009-10-19 21:40:14 +00:00
|
|
|
.append("</td></tr>\n" +
|
|
|
|
|
2010-11-17 22:26:31 +00:00
|
|
|
"</table><hr><h3><a href=\"/jobs\" target=\"_top\" title=\"")
|
2009-10-19 21:40:14 +00:00
|
|
|
.append(_("What's in the router's job queue?"))
|
|
|
|
.append("\">")
|
|
|
|
.append(_("Congestion"))
|
|
|
|
.append("</a></h3><hr>" +
|
|
|
|
"<table>\n" +
|
|
|
|
|
|
|
|
"<tr><td align=\"left\"><b>")
|
|
|
|
.append(_("Job lag"))
|
|
|
|
.append(":</b></td><td align=\"right\">")
|
|
|
|
.append(_helper.getJobLag())
|
|
|
|
.append("</td></tr>\n" +
|
|
|
|
|
|
|
|
"<tr><td align=\"left\"><b>")
|
|
|
|
.append(_("Message delay"))
|
|
|
|
.append(":</b></td><td align=\"right\">")
|
|
|
|
.append(_helper.getMessageDelay())
|
2011-10-17 17:28:57 +00:00
|
|
|
.append("</td></tr>\n");
|
2009-10-19 21:40:14 +00:00
|
|
|
|
2011-10-17 17:28:57 +00:00
|
|
|
if (!_context.getBooleanPropertyDefaultTrue("router.disableTunnelTesting")) {
|
|
|
|
buf.append("<tr><td align=\"left\"><b>")
|
2009-10-19 21:40:14 +00:00
|
|
|
.append(_("Tunnel lag"))
|
|
|
|
.append(":</b></td><td align=\"right\">")
|
|
|
|
.append(_helper.getTunnelLag())
|
2011-10-17 17:28:57 +00:00
|
|
|
.append("</td></tr>\n");
|
|
|
|
}
|
2009-10-19 21:40:14 +00:00
|
|
|
|
2011-10-17 17:28:57 +00:00
|
|
|
buf.append("<tr><td align=\"left\"><b>")
|
2009-10-19 21:40:14 +00:00
|
|
|
.append(_("Backlog"))
|
|
|
|
.append(":</b></td><td align=\"right\">")
|
|
|
|
.append(_helper.getInboundBacklog())
|
|
|
|
.append("</td></tr>\n" +
|
|
|
|
|
|
|
|
"</table><hr><h4>")
|
2009-11-09 17:15:19 +00:00
|
|
|
.append(_(_helper.getTunnelStatus()))
|
2009-10-19 21:40:14 +00:00
|
|
|
.append("</h4><hr>\n")
|
|
|
|
.append(_helper.getDestinations());
|
2009-10-19 13:49:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
out.write(buf.toString());
|
|
|
|
}
|
|
|
|
|
|
|
|
/** translate a string */
|
|
|
|
private String _(String s) {
|
|
|
|
return Messages.getString(s, _context);
|
|
|
|
}
|
2011-03-08 03:07:02 +00:00
|
|
|
|
|
|
|
/** translate a string with a parameter */
|
|
|
|
private String _(String s, Object o) {
|
|
|
|
return Messages.getString(s, o, _context);
|
|
|
|
}
|
2009-10-19 13:49:47 +00:00
|
|
|
}
|