I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Unverified Commit 606961c7 authored by zzz's avatar zzz
Browse files

Console: Add ban counts to headers

parent 70bb63e8
No related branches found
No related tags found
No related merge requests found
......@@ -43,15 +43,16 @@ class BanlistRenderer {
public void renderStatusHTML(Writer out) throws IOException {
StringBuilder buf = new StringBuilder(1024);
// move to the jsp
//buf.append("<h2>Banned Peers</h2>");
Map<Hash, Banlist.Entry> entries = new TreeMap<Hash, Banlist.Entry>(new HashComparator());
entries.putAll(_context.banlist().getEntries());
buf.append("<h3 id=\"bannedpeers\">").append(_t("Banned Peers"));
if (entries.isEmpty()) {
buf.append("<i>").append(_t("none")).append("</i>");
buf.append("</h3><i>").append(_t("none")).append("</i>");
out.write(buf.toString());
return;
} else {
buf.append(" (").append(entries.size()).append(")</h3>");
}
buf.append("<ul id=\"banlist\">");
......
......@@ -21,9 +21,12 @@ public class ConfigPeerHelper extends HelperBase {
out.write("<table id=\"bannedips\"><tr><td>" +
"<table id=\"banneduntilrestart\"><tr><th align=\"center\"><b>");
out.write(_t("IPs Banned Until Restart"));
out.write("</b></th></tr>");
List<Integer> singles = bl.getTransientIPv4Blocks();
List<BigInteger> s6 = bl.getTransientIPv6Blocks();
int sz = singles.size() + s6.size();
if (sz > 0)
out.write(" (" + sz + ')');
out.write("</b></th></tr>");
if (!(singles.isEmpty() && s6.isEmpty())) {
if (!singles.isEmpty()) {
Collections.sort(singles);
......
......@@ -82,7 +82,7 @@
</tr>
</table>
</form>
<a name="banlist"> </a><h3 id="bannedpeers"><%=intl._t("Banned Peers")%></h3>
<%-- h3 in BanlistRenderer --%>
<jsp:useBean class="net.i2p.router.web.helpers.ProfilesHelper" id="profilesHelper" scope="request" />
<jsp:setProperty name="profilesHelper" property="contextId" value="<%=i2pcontextId%>" />
<% profilesHelper.storeWriter(out); %>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment