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>");
|
||||
|
||||
|
@ -15,7 +15,10 @@ function toggleAll(category)
|
||||
var inputs = document.getElementsByTagName("input");
|
||||
for(index = 0; index < inputs.length; index++)
|
||||
{
|
||||
if(inputs[index].id == category)
|
||||
var classes = inputs[index].className.split(' ');
|
||||
for (var idx = 0; idx < classes.length; idx++)
|
||||
{
|
||||
if(classes[idx] == category)
|
||||
{
|
||||
if(inputs[index].checked == 0)
|
||||
{
|
||||
@ -26,6 +29,7 @@ function toggleAll(category)
|
||||
inputs[index].checked = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(category == '*')
|
||||
{
|
||||
if (checkAll == false)
|
||||
@ -77,11 +81,11 @@ function toggleAll(category)
|
||||
<%=intl._("Stat file")%>: <input type="text" name="filename" value="<%=statshelper.getFilename()%>" ><br>
|
||||
<%=intl._("Filter")%>: (<a href="javascript:void(null);" onclick="toggleAll('*')"><%=intl._("toggle all")%></a>)<br></p>
|
||||
<div class="wideload">
|
||||
<p><table>
|
||||
<table>
|
||||
<% while (statshelper.hasMoreStats()) {
|
||||
while (statshelper.groupRequired()) { %>
|
||||
<tr class="tablefooter">
|
||||
<td align="left" colspan="3">
|
||||
<td align="left" colspan="3" id=<%=statshelper.getCurrentGroupName()%>>
|
||||
<b><%=statshelper.getCurrentGroupName()%></b>
|
||||
(<a href="javascript:void(null);" onclick="toggleAll('<%=statshelper.getCurrentGroupName()%>')"><%=intl._("toggle all")%></a>)
|
||||
</td></tr>
|
||||
@ -93,11 +97,11 @@ function toggleAll(category)
|
||||
} // end iterating over required groups for the current stat %>
|
||||
<tr><td align="center">
|
||||
<a name="<%=statshelper.getCurrentStatName()%>"></a>
|
||||
<input id="<%=statshelper.getCurrentGroupName()%>" type="checkbox" class="optbox" name="statList" value="<%=statshelper.getCurrentStatName()%>" <%
|
||||
<input type="checkbox" class="optbox <%=statshelper.getCurrentGroupName()%>" name="statList" value="<%=statshelper.getCurrentStatName()%>" <%
|
||||
if (statshelper.getCurrentIsLogged()) { %>checked="true" <% } %> ></td>
|
||||
<td align="center">
|
||||
<% if (statshelper.getCurrentCanBeGraphed()) { %>
|
||||
<input id="<%=statshelper.getCurrentGroupName()%>" type="checkbox" class="optbox" name="graphList" value="<%=statshelper.getCurrentGraphName()%>" <%
|
||||
<input type="checkbox" class="optbox <%=statshelper.getCurrentGroupName()%>" name="graphList" value="<%=statshelper.getCurrentGraphName()%>" <%
|
||||
if (statshelper.getCurrentIsGraphed()) { %>checked="true" <% } %> ><% } %></td>
|
||||
<td align="left"><b><%=statshelper.getCurrentStatName()%>:</b><br>
|
||||
<%=statshelper.getCurrentStatDescription()%></td></tr><%
|
||||
@ -110,4 +114,4 @@ function toggleAll(category)
|
||||
<input type="reset" value="<%=intl._("Cancel")%>" >
|
||||
<input type="submit" name="shouldsave" value="<%=intl._("Save changes")%>" >
|
||||
</td></tr>
|
||||
</table></p></div></form></div></div></body></html>
|
||||
</table></div></form></div></div></body></html>
|
||||
|
@ -41,4 +41,4 @@
|
||||
<input type="reset" value="<%=intl._("Cancel")%>" >
|
||||
<input type="submit" name="shouldsave" value="<%=intl._("Save changes")%>" >
|
||||
</div>
|
||||
</form></p></div></div></div></body></html>
|
||||
</form></div></div></div></body></html>
|
||||
|
Reference in New Issue
Block a user