Changeset ff1e53a for apps


Ignore:
Timestamp:
Oct 6, 2018 5:09:14 PM (21 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
aafccc0
Parents:
b8d33f7
Message:

Console: Fix bw cap display for P/X on /tunnels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/TunnelRenderer.java

    rb8d33f7 rff1e53a  
    334334                              "</span><b class=\"tunnel_cap\" title=\"" + _t("Bandwidth tier") + "\"></b></td>");
    335335                } else {
    336                     String cap = getCapacity(peer);
     336                    char cap = getCapacity(peer);
    337337                    out.write(" <td class=\"cells\" align=\"center\"><span class=\"tunnel_peer\">" + netDbLink(peer) +
    338338                              "</span>&nbsp;<span class=\"nowrap\"><span class=\"tunnel_id\" title=\"" + _t("Tunnel identity") + "\">" +
     
    477477****/
    478478
    479     /** cap string */
    480     private String getCapacity(Hash peer) {
     479    /** @return cap char or ' ' */
     480    private char getCapacity(Hash peer) {
    481481        RouterInfo info = _context.netDb().lookupRouterInfoLocally(peer);
    482482        if (info != null) {
    483483            String caps = info.getCapabilities();
    484             for (char c = Router.CAPABILITY_BW12; c <= Router.CAPABILITY_BW256; c++) {
     484            for (int i = 0; i < RouterInfo.BW_CAPABILITY_CHARS.length(); i++) {
     485                char c = RouterInfo.BW_CAPABILITY_CHARS.charAt(i);
    485486                if (caps.indexOf(c) >= 0)
    486                     return " " + c;
    487             }
    488         }
    489         return "";
     487                    return c;
     488            }
     489        }
     490        return ' ';
    490491    }
    491492
Note: See TracChangeset for help on using the changeset viewer.