forked from I2P_Developers/i2p.i2p
all tagged all java except :
- summerbar related files since drz is working on it - string requiring word reordering - string with link in the middle - string which looks unusual - string found not in router console source update the POs
This commit is contained in:
@ -29,9 +29,9 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
|
||||
@Override
|
||||
protected void processForm() {
|
||||
if (_action.startsWith("Save Client")) {
|
||||
if (_action.equals(_("Save Client Configuration"))) {
|
||||
saveClientChanges();
|
||||
} else if (_action.startsWith("Save WebApp")) {
|
||||
} else if (_action.equals(_("Save WebApp Configuration"))) {
|
||||
saveWebAppChanges();
|
||||
} else if (_action.startsWith("Start ")) {
|
||||
String app = _action.substring(6);
|
||||
@ -43,7 +43,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
startClient(appnum);
|
||||
else
|
||||
startWebApp(app);
|
||||
} else if (_action.toLowerCase().startsWith("start<span class=hide> ") &&
|
||||
} else if (_action.toLowerCase().startsWith("Start<span class=hide> ") &&
|
||||
_action.toLowerCase().endsWith("</span>")) {
|
||||
// IE sucks
|
||||
String app = _action.substring(23, _action.length() - 7);
|
||||
@ -56,7 +56,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
else
|
||||
startWebApp(app);
|
||||
} else {
|
||||
addFormError("Unsupported " + _action + ".");
|
||||
addFormError(_("Unsupported") + " " + _action + ".");
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,18 +71,18 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
ca.disabled = val == null;
|
||||
}
|
||||
ClientAppConfig.writeClientAppConfig(_context, clients);
|
||||
addFormNotice("Client configuration saved successfully - restart required to take effect.");
|
||||
addFormNotice(_("Client configuration saved successfully - restart required to take effect."));
|
||||
}
|
||||
|
||||
private void startClient(int i) {
|
||||
List clients = ClientAppConfig.getClientApps(_context);
|
||||
if (i >= clients.size()) {
|
||||
addFormError("Bad client index.");
|
||||
addFormError(_("Bad client index."));
|
||||
return;
|
||||
}
|
||||
ClientAppConfig ca = (ClientAppConfig) clients.get(i);
|
||||
LoadClientAppsJob.runClient(ca.className, ca.clientName, LoadClientAppsJob.parseArgs(ca.args), configClient_log);
|
||||
addFormNotice("Client " + ca.clientName + " started.");
|
||||
addFormNotice(_("Client") + " " + ca.clientName + " " + _("started") + ".");
|
||||
}
|
||||
|
||||
private void saveWebAppChanges() {
|
||||
@ -99,7 +99,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
props.setProperty(name, "" + (val != null));
|
||||
}
|
||||
RouterConsoleRunner.storeWebAppProperties(props);
|
||||
addFormNotice("WebApp configuration saved successfully - restart required to take effect.");
|
||||
addFormNotice(_("WebApp configuration saved successfully - restart required to take effect."));
|
||||
}
|
||||
|
||||
// Big hack for the moment, not using properties for directory and port
|
||||
@ -117,14 +117,14 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
path = new File(path, app + ".war");
|
||||
s.addWebApplication("/"+ app, path.getAbsolutePath()).start();
|
||||
// no passwords... initialize(wac);
|
||||
addFormNotice("WebApp <a href=\"/" + app + "/\">" + app + "</a> started.");
|
||||
addFormNotice("WebApp <a href=\"/" + app + "/\">" + app + "</a> " + _("started") + ".");
|
||||
} catch (Exception ioe) {
|
||||
addFormError("Failed to start " + app + " " + ioe + ".");
|
||||
addFormError(_("Failed to start") + " " + app + " " + ioe + ".");
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
addFormError("Failed to find server.");
|
||||
addFormError(_("Failed to find server."));
|
||||
}
|
||||
}
|
||||
|
@ -15,12 +15,12 @@ public class ConfigKeyringHandler extends FormHandler {
|
||||
@Override
|
||||
protected void processForm() {
|
||||
if (_action == null) return;
|
||||
boolean adding = _action.startsWith("Add");
|
||||
if (adding || _action.startsWith("Delete")) {
|
||||
boolean adding = _action.equals(_("Add key"));
|
||||
if (adding || _action.equals(_("Delete key"))) {
|
||||
if (_peer == null)
|
||||
addFormError("You must enter a destination");
|
||||
addFormError(_("You must enter a destination"));
|
||||
if (_key == null && adding)
|
||||
addFormError("You must enter a key");
|
||||
addFormError(_("You must enter a key"));
|
||||
if (_peer == null || (_key == null && adding))
|
||||
return;
|
||||
Hash h = ConvertToHash.getHash(_peer);
|
||||
@ -33,7 +33,7 @@ public class ConfigKeyringHandler extends FormHandler {
|
||||
_context.keyRing().put(h, sk);
|
||||
addFormNotice("Key for " + h.toBase64() + " added to keyring");
|
||||
} else {
|
||||
addFormError("Invalid destination or key");
|
||||
addFormError(_("Invalid destination or key"));
|
||||
}
|
||||
} else { // Delete
|
||||
if (h != null && h.getData() != null) {
|
||||
@ -42,11 +42,11 @@ public class ConfigKeyringHandler extends FormHandler {
|
||||
else
|
||||
addFormNotice("Key for " + h.toBase64() + " not found in keyring");
|
||||
} else {
|
||||
addFormError("Invalid destination");
|
||||
addFormError(_("Invalid destination"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
addFormError("Unsupported");
|
||||
addFormError(_("Unsupported"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,26 +17,26 @@ public class ConfigPeerHandler extends FormHandler {
|
||||
if ("Save Configuration".equals(_action)) {
|
||||
_context.router().saveConfig();
|
||||
addFormNotice("Settings saved - not really!!!!!");
|
||||
} else if (_action.startsWith("Ban")) {
|
||||
} else if (_action.equals(_("Ban peer until restart"))) {
|
||||
Hash h = getHash();
|
||||
if (h != null) {
|
||||
_context.shitlist().shitlistRouterForever(h, "Manually banned via <a href=\"configpeer.jsp\">configpeer.jsp</a>");
|
||||
addFormNotice("Peer " + _peer + " banned until restart");
|
||||
addFormNotice(_("Peer") + " " + _peer + " " + _("banned until restart") );
|
||||
return;
|
||||
}
|
||||
addFormError("Invalid peer");
|
||||
} else if (_action.startsWith("Unban")) {
|
||||
addFormError(_("Invalid peer"));
|
||||
} else if (_action.equals(_("Unban peer"))) {
|
||||
Hash h = getHash();
|
||||
if (h != null) {
|
||||
if (_context.shitlist().isShitlisted(h)) {
|
||||
_context.shitlist().unshitlistRouter(h);
|
||||
addFormNotice("Peer " + _peer + " unbanned");
|
||||
addFormNotice(_("Peer") + " " + _peer + " " + _("unbanned") );
|
||||
} else
|
||||
addFormNotice("Peer " + _peer + " is not currently banned");
|
||||
addFormNotice(_("Peer") + " " + _peer + " " + _("is not currently banned") );
|
||||
return;
|
||||
}
|
||||
addFormError("Invalid peer");
|
||||
} else if (_action.startsWith("Adjust")) {
|
||||
addFormError(_("Invalid peer"));
|
||||
} else if (_action.equals(_("Adjust Profile Bonuses"))) {
|
||||
Hash h = getHash();
|
||||
if (h != null) {
|
||||
PeerProfile prof = _context.profileOrganizer().getProfile(h);
|
||||
@ -44,19 +44,19 @@ public class ConfigPeerHandler extends FormHandler {
|
||||
try {
|
||||
prof.setSpeedBonus(Long.parseLong(_speed));
|
||||
} catch (NumberFormatException nfe) {
|
||||
addFormError("Bad speed value");
|
||||
addFormError(_("Bad speed value"));
|
||||
}
|
||||
try {
|
||||
prof.setCapacityBonus(Long.parseLong(_capacity));
|
||||
} catch (NumberFormatException nfe) {
|
||||
addFormError("Bad capacity value");
|
||||
addFormError(_("Bad capacity value"));
|
||||
}
|
||||
addFormNotice("Bonuses adjusted for " + _peer);
|
||||
} else
|
||||
addFormError("No profile exists for " + _peer);
|
||||
return;
|
||||
}
|
||||
addFormError("Invalid peer");
|
||||
addFormError(_("Invalid peer"));
|
||||
} else if (_action.startsWith("Check")) {
|
||||
addFormError("Unsupported");
|
||||
}
|
||||
|
@ -137,9 +137,9 @@ public class ConfigTunnelsHandler extends FormHandler {
|
||||
if (saveRequired) {
|
||||
boolean saved = _context.router().saveConfig();
|
||||
if (saved)
|
||||
addFormNotice("Exploratory tunnel configuration saved successfully.");
|
||||
addFormNotice(_("Exploratory tunnel configuration saved successfully."));
|
||||
else
|
||||
addFormNotice("Error saving the configuration (applied but not saved) - please see the error logs.");
|
||||
addFormNotice(_("Error saving the configuration (applied but not saved) - please see the error logs."));
|
||||
}
|
||||
}
|
||||
private static final int getInt(Object val) {
|
||||
|
@ -18,7 +18,7 @@ public class ConfigTunnelsHelper extends HelperBase {
|
||||
TunnelPoolSettings exploratoryOut = _context.tunnelManager().getOutboundSettings();
|
||||
|
||||
buf.append("<input type=\"hidden\" name=\"pool.0\" value=\"exploratory\" >");
|
||||
renderForm(buf, 0, "exploratory", "Exploratory tunnels", exploratoryIn, exploratoryOut);
|
||||
renderForm(buf, 0, "exploratory", _("Exploratory tunnels"), exploratoryIn, exploratoryOut);
|
||||
|
||||
int cur = 1;
|
||||
Set clients = _context.clientManager().listClients();
|
||||
@ -38,7 +38,7 @@ public class ConfigTunnelsHelper extends HelperBase {
|
||||
String prefix = dest.calculateHash().toBase64().substring(0,4);
|
||||
buf.append("<input type=\"hidden\" name=\"pool.").append(cur).append("\" value=\"");
|
||||
buf.append(dest.calculateHash().toBase64()).append("\" >");
|
||||
renderForm(buf, cur, prefix, "Client tunnels for " + name, in, out);
|
||||
renderForm(buf, cur, prefix, _("Client tunnels for") + " " + name, in, out);
|
||||
cur++;
|
||||
}
|
||||
|
||||
@ -61,95 +61,95 @@ public class ConfigTunnelsHelper extends HelperBase {
|
||||
in.getLength() + in.getLengthVariance() <= 0 ||
|
||||
out.getLength() <= 0 ||
|
||||
out.getLength() + out.getLengthVariance() <= 0)
|
||||
buf.append("<tr><th colspan=\"3\"><font color=\"red\">ANONYMITY WARNING - Settings include 0-hop tunnels.</font></th></tr>");
|
||||
buf.append("<tr><th colspan=\"3\"><font color=\"red\">" + _("ANONYMITY WARNING - Settings include 0-hop tunnels.") + "</font></th></tr>");
|
||||
else if (in.getLength() <= 1 ||
|
||||
in.getLength() + in.getLengthVariance() <= 1 ||
|
||||
out.getLength() <= 1 ||
|
||||
out.getLength() + out.getLengthVariance() <= 1)
|
||||
buf.append("<tr><th colspan=\"3\"><font color=\"red\">ANONYMITY WARNING - Settings include 1-hop tunnels.</font></th></tr>");
|
||||
buf.append("<tr><th colspan=\"3\"><font color=\"red\">" + _("ANONYMITY WARNING - Settings include 1-hop tunnels.") + "</font></th></tr>");
|
||||
if (in.getLength() + Math.abs(in.getLengthVariance()) >= WARN_LENGTH ||
|
||||
out.getLength() + Math.abs(out.getLengthVariance()) >= WARN_LENGTH)
|
||||
buf.append("<tr><th colspan=\"3\"><font color=\"red\">PERFORMANCE WARNING - Settings include very long tunnels.</font></th></tr>");
|
||||
buf.append("<tr><th colspan=\"3\"><font color=\"red\">" + _("PERFORMANCE WARNING - Settings include very long tunnels.") + "</font></th></tr>");
|
||||
if (in.getQuantity() + in.getBackupQuantity() >= WARN_QUANTITY ||
|
||||
out.getQuantity() + out.getBackupQuantity() >= WARN_QUANTITY)
|
||||
buf.append("<tr><th colspan=\"3\"><font color=\"red\">PERFORMANCE WARNING - Settings include high tunnel quantities.</font></th></tr>");
|
||||
buf.append("<tr><th colspan=\"3\"><font color=\"red\">" + _("PERFORMANCE WARNING - Settings include high tunnel quantities.") + "</font></th></tr>");
|
||||
|
||||
buf.append("<tr><th></th><th><img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound Tunnels\"> Inbound</th><th><img src=\"/themes/console/images/outbound.png\" alt=\"Outbound Tunnels\" title=\"Outbound\"> Outbound</th></tr>\n");
|
||||
buf.append("<tr><th></th><th><img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound Tunnels\"> " + _("Inbound") + "</th><th><img src=\"/themes/console/images/outbound.png\" alt=\"Outbound Tunnels\" title=\"Outbound\"> " + _("Outbound") + "</th></tr>\n");
|
||||
|
||||
// buf.append("<tr><th></th><th>Inbound</th><th>Outbound</th></tr>\n");
|
||||
|
||||
// tunnel depth
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">Depth:</td>\n");
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _("Depth") + ":</td>\n");
|
||||
buf.append("<td align=\"center\"><select name=\"").append(index).append(".depthInbound\">\n");
|
||||
int now = in.getLength();
|
||||
renderOptions(buf, 0, MAX_LENGTH, now, "", "hop");
|
||||
renderOptions(buf, 0, MAX_LENGTH, now, "", _("hop"));
|
||||
if (now > MAX_LENGTH)
|
||||
renderOptions(buf, now, now, now, "", "hop");
|
||||
renderOptions(buf, now, now, now, "", _("hop"));
|
||||
buf.append("</select></td>\n");
|
||||
|
||||
buf.append("<td align=\"center\"><select name=\"").append(index).append(".depthOutbound\">\n");
|
||||
now = out.getLength();
|
||||
renderOptions(buf, 0, MAX_LENGTH, now, "", "hop");
|
||||
renderOptions(buf, 0, MAX_LENGTH, now, "", _("hop"));
|
||||
if (now > MAX_LENGTH)
|
||||
renderOptions(buf, now, now, now, "", "hop");
|
||||
renderOptions(buf, now, now, now, "", _("hop"));
|
||||
buf.append("</select></td>\n");
|
||||
buf.append("</tr>\n");
|
||||
|
||||
// tunnel depth variance
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">Randomization:</td>\n");
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _("Randomization") + ":</td>\n");
|
||||
buf.append("<td align=\"center\"><select name=\"").append(index).append(".varianceInbound\">\n");
|
||||
now = in.getLengthVariance();
|
||||
renderOptions(buf, 0, 0, now, "", "hop");
|
||||
renderOptions(buf, 1, MAX_VARIANCE, now, "+ 0-", "hop");
|
||||
renderOptions(buf, MIN_NEG_VARIANCE, -1, now, "+/- 0", "hop");
|
||||
renderOptions(buf, 0, 0, now, "", _("hop"));
|
||||
renderOptions(buf, 1, MAX_VARIANCE, now, "+ 0-", _("hop"));
|
||||
renderOptions(buf, MIN_NEG_VARIANCE, -1, now, "+/- 0", _("hop"));
|
||||
if (now > MAX_VARIANCE)
|
||||
renderOptions(buf, now, now, now, "+ 0-", "hop");
|
||||
renderOptions(buf, now, now, now, "+ 0-", _("hop"));
|
||||
else if (now < MIN_NEG_VARIANCE)
|
||||
renderOptions(buf, now, now, now, "+/- 0", "hop");
|
||||
renderOptions(buf, now, now, now, "+/- 0", _("hop"));
|
||||
buf.append("</select></td>\n");
|
||||
|
||||
buf.append("<td align=\"center\"><select name=\"").append(index).append(".varianceOutbound\">\n");
|
||||
now = out.getLengthVariance();
|
||||
renderOptions(buf, 0, 0, now, "", "hop");
|
||||
renderOptions(buf, 1, MAX_VARIANCE, now, "+ 0-", "hop");
|
||||
renderOptions(buf, MIN_NEG_VARIANCE, -1, now, "+/- 0", "hop");
|
||||
renderOptions(buf, 0, 0, now, "", _("hop"));
|
||||
renderOptions(buf, 1, MAX_VARIANCE, now, "+ 0-", _("hop"));
|
||||
renderOptions(buf, MIN_NEG_VARIANCE, -1, now, "+/- 0", _("hop"));
|
||||
if (now > MAX_VARIANCE)
|
||||
renderOptions(buf, now, now, now, "+ 0-", "hop");
|
||||
renderOptions(buf, now, now, now, "+ 0-", _("hop"));
|
||||
else if (now < MIN_NEG_VARIANCE)
|
||||
renderOptions(buf, now, now, now, "+/- 0", "hop");
|
||||
renderOptions(buf, now, now, now, "+/- 0", _("hop"));
|
||||
buf.append("</select></td>\n");
|
||||
|
||||
// tunnel quantity
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">Quantity:</td>\n");
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _("Quantity") + ":</td>\n");
|
||||
buf.append("<td align=\"center\"><select name=\"").append(index).append(".quantityInbound\">\n");
|
||||
now = in.getQuantity();
|
||||
renderOptions(buf, 1, MAX_QUANTITY, now, "", "tunnel");
|
||||
renderOptions(buf, 1, MAX_QUANTITY, now, "", _("tunnel"));
|
||||
if (now > MAX_QUANTITY)
|
||||
renderOptions(buf, now, now, now, "", "tunnel");
|
||||
renderOptions(buf, now, now, now, "", _("tunnel"));
|
||||
buf.append("</select></td>\n");
|
||||
|
||||
buf.append("<td align=\"center\"><select name=\"").append(index).append(".quantityOutbound\">\n");
|
||||
now = out.getQuantity();
|
||||
renderOptions(buf, 1, MAX_QUANTITY, now, "", "tunnel");
|
||||
renderOptions(buf, 1, MAX_QUANTITY, now, "", _("tunnel"));
|
||||
if (now > MAX_QUANTITY)
|
||||
renderOptions(buf, now, now, now, "", "tunnel");
|
||||
renderOptions(buf, now, now, now, "", _("tunnel"));
|
||||
buf.append("</select></td>\n");
|
||||
buf.append("</tr>\n");
|
||||
|
||||
// tunnel backup quantity
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">Backup quantity:</td>\n");
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _("Backup quantity") + ":</td>\n");
|
||||
buf.append("<td align=\"center\"><select name=\"").append(index).append(".backupInbound\">\n");
|
||||
now = in.getBackupQuantity();
|
||||
renderOptions(buf, 0, MAX_BACKUP_QUANTITY, now, "", "tunnel");
|
||||
renderOptions(buf, 0, MAX_BACKUP_QUANTITY, now, "", _("tunnel"));
|
||||
if (now > MAX_BACKUP_QUANTITY)
|
||||
renderOptions(buf, now, now, now, "", "tunnel");
|
||||
renderOptions(buf, now, now, now, "", _("tunnel"));
|
||||
buf.append("</select></td>\n");
|
||||
|
||||
buf.append("<td align=\"center\"><select name=\"").append(index).append(".backupOutbound\">\n");
|
||||
now = out.getBackupQuantity();
|
||||
renderOptions(buf, 0, MAX_BACKUP_QUANTITY, now, "", "tunnel");
|
||||
renderOptions(buf, 0, MAX_BACKUP_QUANTITY, now, "", _("tunnel"));
|
||||
if (now > MAX_BACKUP_QUANTITY)
|
||||
renderOptions(buf, now, now, now, "", "tunnel");
|
||||
renderOptions(buf, now, now, now, "", _("tunnel"));
|
||||
buf.append("</select></td>\n");
|
||||
buf.append("</tr>\n");
|
||||
|
||||
@ -159,7 +159,7 @@ buf.append("<tr><th></th><th><img src=\"/themes/console/images/inbound.png\" alt
|
||||
// And let's not display them at all unless they have contents, which should be rare.
|
||||
Properties props = in.getUnknownOptions();
|
||||
if (props.size() > 0) {
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">Inbound options:</td>\n" +
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _("Inbound options") + ":</td>\n" +
|
||||
"<td colspan=\"2\" align=\"center\"><input name=\"").append(index);
|
||||
buf.append(".inboundOptions\" type=\"text\" size=\"32\" disabled=\"true\" " +
|
||||
"value=\"");
|
||||
@ -172,7 +172,7 @@ buf.append("<tr><th></th><th><img src=\"/themes/console/images/inbound.png\" alt
|
||||
}
|
||||
props = out.getUnknownOptions();
|
||||
if (props.size() > 0) {
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">Outbound options:</td>\n" +
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _("Outbound options") + ":</td>\n" +
|
||||
"<td colspan=\"2\" align=\"center\"><input name=\"").append(index);
|
||||
buf.append(".outboundOptions\" type=\"text\" size=\"32\" disabled=\"true\" " +
|
||||
"value=\"");
|
||||
|
@ -55,7 +55,7 @@ public class NetDbRenderer {
|
||||
|
||||
public void renderRouterInfoHTML(Writer out, String routerPrefix) throws IOException {
|
||||
StringBuilder buf = new StringBuilder(4*1024);
|
||||
buf.append("<h2>Network Database RouterInfo Lookup</h2>\n");
|
||||
buf.append("<h2>" + _("Network Database RouterInfo Lookup") + "</h2>\n");
|
||||
if (".".equals(routerPrefix)) {
|
||||
renderRouterInfo(buf, _context.router().getRouterInfo(), true, true);
|
||||
} else {
|
||||
@ -70,7 +70,7 @@ public class NetDbRenderer {
|
||||
}
|
||||
}
|
||||
if (notFound)
|
||||
buf.append("Router ").append(routerPrefix).append(" not found in network database");
|
||||
buf.append(_("Router") + " ").append(routerPrefix).append(" " + _("not found in network database") );
|
||||
}
|
||||
out.write(buf.toString());
|
||||
out.flush();
|
||||
@ -82,8 +82,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("<h2>" + _("Network Database Contents") + "</h2>\n");
|
||||
buf.append("<a href=\"netdb.jsp\">" + _("View") + " RouterInfo</a>");
|
||||
buf.append("<h3>LeaseSets</h3>\n");
|
||||
Set leases = new TreeSet(new LeaseSetComparator());
|
||||
leases.addAll(_context.netDb().getLeases());
|
||||
@ -94,17 +94,17 @@ public class NetDbRenderer {
|
||||
Hash key = dest.calculateHash();
|
||||
buf.append("<b>LeaseSet: ").append(key.toBase64());
|
||||
if (_context.clientManager().isLocal(dest)) {
|
||||
buf.append(" (<a href=\"tunnels.jsp#" + key.toBase64().substring(0,4) + "\">Local</a> ");
|
||||
buf.append(" (<a href=\"tunnels.jsp#" + key.toBase64().substring(0,4) + "\">" + _("Local") + "</a> ");
|
||||
if (! _context.clientManager().shouldPublishLeaseSet(key))
|
||||
buf.append("Unpublished ");
|
||||
buf.append("Destination ");
|
||||
buf.append(_("Unpublished") + " ");
|
||||
buf.append(_("Destination") + " ");
|
||||
TunnelPoolSettings in = _context.tunnelManager().getInboundSettings(key);
|
||||
if (in != null && in.getDestinationNickname() != null)
|
||||
buf.append(in.getDestinationNickname());
|
||||
else
|
||||
buf.append(dest.toBase64().substring(0, 6));
|
||||
} else {
|
||||
buf.append(" (Destination ");
|
||||
buf.append(" (" + _("Destination") + " ");
|
||||
String host = _context.namingService().reverseLookup(dest);
|
||||
if (host != null)
|
||||
buf.append(host);
|
||||
@ -118,9 +118,9 @@ public class NetDbRenderer {
|
||||
else
|
||||
buf.append("Expired ").append(DataHelper.formatDuration(0-exp)).append(" ago<br>\n");
|
||||
for (int i = 0; i < ls.getLeaseCount(); i++) {
|
||||
buf.append("Lease ").append(i + 1).append(": Gateway ");
|
||||
buf.append("Lease ").append(i + 1).append(": " + _("Gateway") + " ");
|
||||
buf.append(_context.commSystem().renderPeerHTML(ls.getLease(i).getGateway()));
|
||||
buf.append(" Tunnel ").append(ls.getLease(i).getTunnelId().getTunnelId()).append("<br>\n");
|
||||
buf.append(" " + _("Tunnel") + " ").append(ls.getLease(i).getTunnelId().getTunnelId()).append("<br>\n");
|
||||
}
|
||||
buf.append("<hr>\n");
|
||||
out.write(buf.toString());
|
||||
@ -135,21 +135,21 @@ public class NetDbRenderer {
|
||||
if (full)
|
||||
size *= 4;
|
||||
StringBuilder buf = new StringBuilder(size);
|
||||
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()) {
|
||||
buf.append("Not initialized\n");
|
||||
buf.append("" + _("Not initialized") + "\n");
|
||||
out.write(buf.toString());
|
||||
out.flush();
|
||||
return;
|
||||
}
|
||||
|
||||
Hash us = _context.routerHash();
|
||||
out.write("<a name=\"routers\" ></a><h3>Routers (<a href=\"netdb.jsp");
|
||||
out.write("<a name=\"routers\" ></a><h3>" + _("Routers") + " (<a href=\"netdb.jsp");
|
||||
if (full)
|
||||
out.write("#routers\" >view without");
|
||||
out.write("#routers\" >" + _("view without") + "");
|
||||
else
|
||||
out.write("?f=1#routers\" >view with");
|
||||
out.write(" stats</a>)</h3>\n");
|
||||
out.write("?f=1#routers\" >" + _("view with") + "");
|
||||
out.write(" " + _("stats") + "</a>)</h3>\n");
|
||||
|
||||
RouterInfo ourInfo = _context.router().getRouterInfo();
|
||||
renderRouterInfo(buf, ourInfo, true, true);
|
||||
@ -183,7 +183,7 @@ public class NetDbRenderer {
|
||||
if (versionList.size() > 0) {
|
||||
Collections.sort(versionList, Collections.reverseOrder());
|
||||
buf.append("<table>\n");
|
||||
buf.append("<tr><th>Version</th><th>Count</th></tr>\n");
|
||||
buf.append("<tr><th>" + _("Version") + "</th><th>" + _("Count") + "</th></tr>\n");
|
||||
for (String routerVersion : versionList) {
|
||||
int num = versions.count(routerVersion);
|
||||
buf.append("<tr><td align=\"center\">").append(DataHelper.stripHTML(routerVersion));
|
||||
@ -199,7 +199,7 @@ public class NetDbRenderer {
|
||||
if (countryList.size() > 0) {
|
||||
Collections.sort(countryList);
|
||||
buf.append("<table>\n");
|
||||
buf.append("<tr><th align=\"left\">Country</th><th>Count</th></tr>\n");
|
||||
buf.append("<tr><th align=\"left\">" + _("Country") + "</th><th>" + _("Count") + "</th></tr>\n");
|
||||
for (String country : countryList) {
|
||||
int num = countries.count(country);
|
||||
buf.append("<tr><td><img height=\"11\" width=\"16\" alt=\"").append(country.toUpperCase()).append("\"");
|
||||
@ -222,9 +222,9 @@ public class NetDbRenderer {
|
||||
String hash = info.getIdentity().getHash().toBase64();
|
||||
buf.append("<table><tr><th><a name=\"").append(hash.substring(0, 6)).append("\" ></a>");
|
||||
if (isUs) {
|
||||
buf.append("<a name=\"our-info\" ></a><b>Our info: ").append(hash).append("</b></th></tr><tr><td>\n");
|
||||
buf.append("<a name=\"our-info\" ></a><b>" + _("Our info") + ": ").append(hash).append("</b></th></tr><tr><td>\n");
|
||||
} else {
|
||||
buf.append("<b>Peer info for:</b> ").append(hash).append("\n");
|
||||
buf.append("<b>" + _("Peer info for") + ":</b> ").append(hash).append("\n");
|
||||
if (full) {
|
||||
buf.append("[<a href=\"netdb.jsp\" >Back</a>]</th></tr><td>\n");
|
||||
} else {
|
||||
@ -234,12 +234,12 @@ public class NetDbRenderer {
|
||||
|
||||
long age = _context.clock().now() - info.getPublished();
|
||||
if (isUs && _context.router().isHidden())
|
||||
buf.append("<b>Hidden, Updated:</b> ").append(DataHelper.formatDuration(age)).append(" ago<br>\n");
|
||||
buf.append("<b>" + _("Hidden") + ", " + _("Updated") + ":</b> ").append(DataHelper.formatDuration(age)).append(" " + _("ago") + "<br>\n");
|
||||
else if (age > 0)
|
||||
buf.append("<b>Published:</b> ").append(DataHelper.formatDuration(age)).append(" ago<br>\n");
|
||||
buf.append("<b>" + _("Published") + ":</b> ").append(DataHelper.formatDuration(age)).append(" " + _("ago") + "<br>\n");
|
||||
else
|
||||
buf.append("<b>Published:</b> in ").append(DataHelper.formatDuration(0-age)).append("???<br>\n");
|
||||
buf.append("<b>Address(es):</b> ");
|
||||
buf.append("<b>" + _("Published") + ":</b> in ").append(DataHelper.formatDuration(0-age)).append("???<br>\n");
|
||||
buf.append("<b>" + _("Address(es)") + ":</b> ");
|
||||
String country = _context.commSystem().getCountry(info.getIdentity().getHash());
|
||||
if(country != null) {
|
||||
buf.append("<img height=\"11\" width=\"16\" alt=\"").append(country.toUpperCase()).append("\"");
|
||||
@ -256,7 +256,7 @@ public class NetDbRenderer {
|
||||
}
|
||||
buf.append("</td></tr>\n");
|
||||
if (full) {
|
||||
buf.append("<tr><td>Stats: <br><code>\n");
|
||||
buf.append("<tr><td>" + _("Stats") + ": <br><code>\n");
|
||||
for (Iterator iter = info.getOptions().keySet().iterator(); iter.hasNext(); ) {
|
||||
String key = (String)iter.next();
|
||||
String val = info.getOption(key);
|
||||
|
@ -37,7 +37,7 @@ public class TunnelRenderer {
|
||||
}
|
||||
|
||||
public void renderStatusHTML(Writer out) throws IOException {
|
||||
out.write("<div class=\"wideload\"><h2><a name=\"exploratory\" ></a>Exploratory tunnels (<a href=\"/configtunnels.jsp#exploratory\">config</a>):</h2>\n");
|
||||
out.write("<div class=\"wideload\"><h2><a name=\"exploratory\" ></a>" + _("Exploratory tunnels") + " (<a href=\"/configtunnels.jsp#exploratory\">" + _("config") + "</a>):</h2>\n");
|
||||
renderPool(out, _context.tunnelManager().getInboundExploratoryPool(), _context.tunnelManager().getOutboundExploratoryPool());
|
||||
|
||||
List<Hash> destinations = null;
|
||||
@ -56,9 +56,9 @@ public class TunnelRenderer {
|
||||
if (name == null)
|
||||
name = client.toBase64().substring(0,4);
|
||||
out.write("<h2><a name=\"" + client.toBase64().substring(0,4)
|
||||
+ "\" ></a>Client tunnels for " + name);
|
||||
+ "\" ></a>" + _("Client tunnels for") + " " + name);
|
||||
if (_context.clientManager().isLocal(client))
|
||||
out.write(" (<a href=\"/configtunnels.jsp#" + client.toBase64().substring(0,4) +"\">config</a>):</h2>\n");
|
||||
out.write(" (<a href=\"/configtunnels.jsp#" + client.toBase64().substring(0,4) +"\">" + _("config") + "</a>):</h2>\n");
|
||||
else
|
||||
out.write(" (dead):</h2>\n");
|
||||
renderPool(out, in, outPool);
|
||||
@ -66,10 +66,10 @@ public class TunnelRenderer {
|
||||
|
||||
List participating = _context.tunnelDispatcher().listParticipatingTunnels();
|
||||
Collections.sort(participating, new TunnelComparator());
|
||||
out.write("<h2><a name=\"participating\"></a>Participating tunnels:</h2><table>\n");
|
||||
out.write("<tr><th>Receive on</th><th>From</th><th>"
|
||||
+ "Send on</th><th>To</th><th>Expiration</th>"
|
||||
+ "<th>Usage</th><th>Rate</th><th>Role</th></tr>\n");
|
||||
out.write("<h2><a name=\"participating\"></a>" + _("Participating tunnels") + ":</h2><table>\n");
|
||||
out.write("<tr><th>" + _("Receive on") + "</th><th>" + _("From") + "</th><th>"
|
||||
+ "" + _("Send on") + "</th><th>" + _("To") + "</th><th>" + _("Expiration") + "</th>"
|
||||
+ "<th>" + _("Usage") + "</th><th>" + _("Rate") + "</th><th>" + _("Role") + "</th></tr>\n");
|
||||
long processed = 0;
|
||||
RateStat rs = _context.statManager().getRate("tunnel.participatingMessageCount");
|
||||
if (rs != null)
|
||||
@ -113,17 +113,17 @@ public class TunnelRenderer {
|
||||
int bps = 1024 * (int) cfg.getProcessedMessagesCount() / lifetime;
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + bps + "Bps</td>");
|
||||
if (cfg.getSendTo() == null)
|
||||
out.write(" <td class=\"cells\" align=\"center\">Outbound Endpoint</td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + _("Outbound Endpoint") + "</td>");
|
||||
else if (cfg.getReceiveFrom() == null)
|
||||
out.write(" <td class=\"cells\" align=\"center\">Inbound Gateway</td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + _("Inbound Gateway") + "</td>");
|
||||
else
|
||||
out.write(" <td class=\"cells\" align=\"center\">Participant</td>");
|
||||
out.write(" <td class=\"cells\" align=\"center\">" + _("Participant") + "</td>");
|
||||
out.write("</tr>\n");
|
||||
processed += cfg.getProcessedMessagesCount();
|
||||
}
|
||||
out.write("</table>\n");
|
||||
out.write("<div class=\"statusnotes\"><b>Inactive participating tunnels: " + inactive + "</b></div>\n");
|
||||
out.write("<div class=\"statusnotes\"><b>Lifetime bandwidth usage: " + DataHelper.formatSize(processed*1024) + "B</b></div>\n");
|
||||
out.write("<div class=\"statusnotes\"><b>" + _("Inactive participating tunnels") + ": " + inactive + "</b></div>\n");
|
||||
out.write("<div class=\"statusnotes\"><b>" + _("Lifetime bandwidth usage") + ": " + DataHelper.formatSize(processed*1024) + "B</b></div>\n");
|
||||
renderPeers(out);
|
||||
}
|
||||
|
||||
@ -152,16 +152,16 @@ public class TunnelRenderer {
|
||||
if (info.getLength() > maxLength)
|
||||
maxLength = info.getLength();
|
||||
}
|
||||
out.write("<table><tr><th>In/Out</th><th>Expiry</th><th>Usage</th><th>Gateway</th>");
|
||||
out.write("<table><tr><th>" + _("In/Out") + "</th><th>" + _("Expiry") + "</th><th>" + _("Usage") + "</th><th>" + _("Gateway") + "</th>");
|
||||
if (maxLength > 3) {
|
||||
out.write("<th align=\"center\" colspan=\"" + (maxLength - 2));
|
||||
out.write("\">Participants</th>");
|
||||
out.write("\">" + _("Participants") + "</th>");
|
||||
}
|
||||
else if (maxLength == 3) {
|
||||
out.write("<th>Participant</th>");
|
||||
out.write("<th>" + _("Participant") + "</th>");
|
||||
}
|
||||
if (maxLength > 1) {
|
||||
out.write("<th>Endpoint</th>");
|
||||
out.write("<th>" + _("Endpoint") + "</th>");
|
||||
}
|
||||
out.write("</tr>\n");
|
||||
for (int i = 0; i < tunnels.size(); i++) {
|
||||
@ -201,17 +201,17 @@ public class TunnelRenderer {
|
||||
if (in != null) {
|
||||
List pending = in.listPending();
|
||||
if (pending.size() > 0)
|
||||
out.write("<div class=\"statusnotes\"><center><b>Build in progress: " + pending.size() + " inbound</b></center></div>\n");
|
||||
out.write("<div class=\"statusnotes\"><center><b>" + _("Build in progress") + ": " + pending.size() + " " + _("inbound") + "</b></center></div>\n");
|
||||
live += pending.size();
|
||||
}
|
||||
if (outPool != null) {
|
||||
List pending = outPool.listPending();
|
||||
if (pending.size() > 0)
|
||||
out.write("<div class=\"statusnotes\"><center><b>Build in progress: " + pending.size() + " outbound</b></center></div>\n");
|
||||
out.write("<div class=\"statusnotes\"><center><b>" + _("Build in progress") + ": " + pending.size() + " " + _("outbound") + "</b></center></div>\n");
|
||||
live += pending.size();
|
||||
}
|
||||
if (live <= 0)
|
||||
out.write("<div class=\"statusnotes\"><center><b>No tunnels; waiting for the grace period to end.</center></b></div>\n");
|
||||
out.write("<div class=\"statusnotes\"><center><b>" + _("No tunnels; waiting for the grace period to end.") + "</center></b></div>\n");
|
||||
out.write("<div class=\"statusnotes\"><center><b>Lifetime bandwidth usage: " + DataHelper.formatSize(processedIn*1024) + "B in, " +
|
||||
DataHelper.formatSize(processedOut*1024) + "B out</b></center></div>");
|
||||
}
|
||||
@ -230,7 +230,7 @@ public class TunnelRenderer {
|
||||
List<Hash> peerList = new ArrayList(peers);
|
||||
Collections.sort(peerList, new HashComparator());
|
||||
|
||||
out.write("<h2><a name=\"peers\"></a>Tunnel Counts By Peer:</h2>\n");
|
||||
out.write("<h2><a name=\"peers\"></a>" + _("Tunnel Counts By Peer") + ":</h2>\n");
|
||||
out.write("<table><tr><th>Peer</th><th>Expl. + Client</th><th>% of total</th><th>Part. from + to</th><th>% of total</th></tr>\n");
|
||||
for (Hash h : peerList) {
|
||||
out.write("<tr> <td class=\"cells\" align=\"center\">");
|
||||
@ -249,7 +249,7 @@ public class TunnelRenderer {
|
||||
out.write('0');
|
||||
out.write('\n');
|
||||
}
|
||||
out.write("<tr class=\"tablefooter\"> <td align=\"center\"><b>Tunnels</b> <td align=\"center\"><b>" + tunnelCount);
|
||||
out.write("<tr class=\"tablefooter\"> <td align=\"center\"><b>" + _("Tunnels") + "</b> <td align=\"center\"><b>" + tunnelCount);
|
||||
out.write("</b> <td> </td> <td align=\"center\"><b>" + partCount);
|
||||
out.write("</b> <td> </td></tr></table></div>\n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user