forked from I2P_Developers/i2p.i2p
Console: Fix bw cap display for P/X on /tunnels
This commit is contained in:
@ -333,7 +333,7 @@ class TunnelRenderer {
|
|||||||
_t("Tunnel identity") + "\">" + (id == null ? "" : "" + id) +
|
_t("Tunnel identity") + "\">" + (id == null ? "" : "" + id) +
|
||||||
"</span><b class=\"tunnel_cap\" title=\"" + _t("Bandwidth tier") + "\"></b></td>");
|
"</span><b class=\"tunnel_cap\" title=\"" + _t("Bandwidth tier") + "\"></b></td>");
|
||||||
} else {
|
} else {
|
||||||
String cap = getCapacity(peer);
|
char cap = getCapacity(peer);
|
||||||
out.write(" <td class=\"cells\" align=\"center\"><span class=\"tunnel_peer\">" + netDbLink(peer) +
|
out.write(" <td class=\"cells\" align=\"center\"><span class=\"tunnel_peer\">" + netDbLink(peer) +
|
||||||
"</span> <span class=\"nowrap\"><span class=\"tunnel_id\" title=\"" + _t("Tunnel identity") + "\">" +
|
"</span> <span class=\"nowrap\"><span class=\"tunnel_id\" title=\"" + _t("Tunnel identity") + "\">" +
|
||||||
(id == null ? "" : " " + id) + "</span><b class=\"tunnel_cap\" title=\"" + _t("Bandwidth tier") + "\">" +
|
(id == null ? "" : " " + id) + "</span><b class=\"tunnel_cap\" title=\"" + _t("Bandwidth tier") + "\">" +
|
||||||
@ -476,17 +476,18 @@ class TunnelRenderer {
|
|||||||
}
|
}
|
||||||
****/
|
****/
|
||||||
|
|
||||||
/** cap string */
|
/** @return cap char or ' ' */
|
||||||
private String getCapacity(Hash peer) {
|
private char getCapacity(Hash peer) {
|
||||||
RouterInfo info = _context.netDb().lookupRouterInfoLocally(peer);
|
RouterInfo info = _context.netDb().lookupRouterInfoLocally(peer);
|
||||||
if (info != null) {
|
if (info != null) {
|
||||||
String caps = info.getCapabilities();
|
String caps = info.getCapabilities();
|
||||||
for (char c = Router.CAPABILITY_BW12; c <= Router.CAPABILITY_BW256; c++) {
|
for (int i = 0; i < RouterInfo.BW_CAPABILITY_CHARS.length(); i++) {
|
||||||
|
char c = RouterInfo.BW_CAPABILITY_CHARS.charAt(i);
|
||||||
if (caps.indexOf(c) >= 0)
|
if (caps.indexOf(c) >= 0)
|
||||||
return " " + c;
|
return c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
private String netDbLink(Hash peer) {
|
private String netDbLink(Hash peer) {
|
||||||
|
Reference in New Issue
Block a user