forked from I2P_Developers/i2p.i2p
* Console: Fix HTML errors in
configpeer.jsp, configtunnels.jsp, configupdate.jsp
This commit is contained in:
@ -18,17 +18,24 @@ public class ConfigTunnelsHelper extends HelperBase {
|
||||
|
||||
public String getForm() {
|
||||
StringBuilder buf = new StringBuilder(1024);
|
||||
// HTML: <input> cannot be inside a <table>
|
||||
buf.append("<input type=\"hidden\" name=\"pool.0\" value=\"exploratory\" >\n");
|
||||
int cur = 1;
|
||||
Set<Destination> clients = _context.clientManager().listClients();
|
||||
for (Destination dest : clients) {
|
||||
buf.append("<input type=\"hidden\" name=\"pool.").append(cur).append("\" value=\"");
|
||||
buf.append(dest.calculateHash().toBase64()).append("\" >\n");
|
||||
cur++;
|
||||
}
|
||||
|
||||
buf.append("<table>\n");
|
||||
TunnelPoolSettings exploratoryIn = _context.tunnelManager().getInboundSettings();
|
||||
TunnelPoolSettings exploratoryOut = _context.tunnelManager().getOutboundSettings();
|
||||
|
||||
buf.append("<input type=\"hidden\" name=\"pool.0\" value=\"exploratory\" >");
|
||||
renderForm(buf, 0, "exploratory", _("Exploratory tunnels"), exploratoryIn, exploratoryOut);
|
||||
|
||||
int cur = 1;
|
||||
Set clients = _context.clientManager().listClients();
|
||||
for (Iterator iter = clients.iterator(); iter.hasNext(); ) {
|
||||
Destination dest = (Destination)iter.next();
|
||||
cur = 1;
|
||||
for (Destination dest : clients) {
|
||||
TunnelPoolSettings in = _context.tunnelManager().getInboundSettings(dest.calculateHash());
|
||||
TunnelPoolSettings out = _context.tunnelManager().getOutboundSettings(dest.calculateHash());
|
||||
|
||||
@ -41,9 +48,7 @@ public class ConfigTunnelsHelper extends HelperBase {
|
||||
name = dest.calculateHash().toBase64().substring(0,6);
|
||||
|
||||
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 {0}", _(name)), in, out);
|
||||
cur++;
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ public class ConfigUpdateHelper extends HelperBase {
|
||||
for (int i = 0; i < PERIODS.length; i++) {
|
||||
buf.append("<option value=\"").append(PERIODS[i]);
|
||||
if (PERIODS[i] == ms)
|
||||
buf.append("\" selected=\"true\"");
|
||||
buf.append("\" selected=\"true");
|
||||
|
||||
if (PERIODS[i] == -1)
|
||||
buf.append("\">" + _("Never") + "</option>\n");
|
||||
|
@ -43,6 +43,11 @@ public class ShitlistRenderer {
|
||||
Map<Hash, Shitlist.Entry> entries = new TreeMap(new HashComparator());
|
||||
|
||||
entries.putAll(_context.shitlist().getEntries());
|
||||
if (entries.isEmpty()) {
|
||||
buf.append("<i>").append(_("none")).append("</i>");
|
||||
out.write(buf.toString());
|
||||
return;
|
||||
}
|
||||
|
||||
buf.append("<ul>");
|
||||
|
||||
|
Reference in New Issue
Block a user