forked from I2P_Developers/i2p.i2p
Console: Add tooltip to unban link
Don't show both ban and unban buttons if peer param provided Don't put hash in form again after ban/unban POST
This commit is contained in:
@@ -56,6 +56,7 @@ class BanlistRenderer {
|
||||
|
||||
buf.append("<ul id=\"banlist\">");
|
||||
|
||||
String unban = _t("unban now");
|
||||
for (Map.Entry<Hash, Banlist.Entry> e : entries.entrySet()) {
|
||||
Hash key = e.getKey();
|
||||
Banlist.Entry entry = e.getValue();
|
||||
@@ -82,8 +83,9 @@ class BanlistRenderer {
|
||||
buf.append(_t(entry.cause));
|
||||
}
|
||||
if (!key.equals(Hash.FAKE_HASH)) {
|
||||
// note: CSS hides anchor text
|
||||
buf.append(" <a href=\"configpeer?peer=").append(key.toBase64())
|
||||
.append("#unsh\">[").append(_t("unban now")).append("]</a>");
|
||||
.append("#unsh\" title=\"").append(unban).append("\">[").append(unban).append("]</a>");
|
||||
}
|
||||
buf.append("</li>\n");
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.math.BigInteger;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.i2p.data.Hash;
|
||||
import net.i2p.router.Blocklist;
|
||||
import net.i2p.router.web.HelperBase;
|
||||
import net.i2p.util.Addresses;
|
||||
@@ -132,6 +133,13 @@ public class ConfigPeerHelper extends HelperBase {
|
||||
return out.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 0.9.50
|
||||
*/
|
||||
public boolean isBanned(Hash h) {
|
||||
return _context.banlist().isBanlisted(h);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a (non-negative) two's complement IP to exactly 16 bytes
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user