Changeset 21c7a341


Ignore:
Timestamp:
Feb 28, 2019 4:07:58 PM (17 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
d1617dd
Parents:
302adc2
Message:

Console: Change fallback client names to use b32
instead of truncated b64. Anchors remain b64.

Location:
apps/routerconsole/java/src/net/i2p/router/web/helpers
Files:
3 edited

Legend:

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

    r302adc2 r21c7a341  
    4747           
    4848            String name = in.getDestinationNickname();
    49             if (name == null)
     49            if (name == null) {
    5050                name = out.getDestinationNickname();
    51             if (name == null)
    52                 name = dest.calculateHash().toBase64().substring(0,6);
     51                if (name == null)
     52                    name = dest.calculateHash().toBase32();
     53            }
    5354       
    5455            String prefix = dest.calculateHash().toBase64().substring(0,4);
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/SummaryHelper.java

    r302adc2 r21c7a341  
    643643            name = (out != null ? out.getDestinationNickname() : null);
    644644            if (name == null)
    645                 name = d.calculateHash().toBase64().substring(0,6);
     645                name = d.toBase32();
    646646            else
    647647                name = _t(name);
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/TunnelRenderer.java

    r302adc2 r21c7a341  
    6868            if ( (name == null) && (outPool != null) )
    6969                name = outPool.getSettings().getDestinationNickname();
    70             if (name == null)
    71                 name = client.toBase64().substring(0,4);
    72             out.write("<h3 class=\"tabletitle\" id=\"" + client.toBase64().substring(0,4)
    73                       + "\" >" + _t("Client tunnels for") + ' ' + DataHelper.escapeHTML(_t(name)));
     70            String b64 = client.toBase64().substring(0, 4);
     71            String dname;
     72            if (name == null) {
     73                name = b64;
     74                dname = client.toBase32();
     75            } else {
     76                dname = DataHelper.escapeHTML(_t(name));
     77            }
     78            out.write("<h3 class=\"tabletitle\" id=\"" + b64
     79                      + "\" >" + _t("Client tunnels for") + ' ' + dname);
    7480            if (isLocal) {
    7581                // links are set to float:right in CSS so they will be displayed in reverse order
    76                 out.write(" <a href=\"/configtunnels#" + client.toBase64().substring(0,4) +"\" title=\"" + _t("Configure tunnels for session") + "\">[" + _t("configure") + "]</a>");
     82                out.write(" <a href=\"/configtunnels#" + b64 + "\" title=\"" + _t("Configure tunnels for session") + "\">[" + _t("configure") + "]</a>");
    7783                writeGraphLinks(out, in, outPool);
    7884                out.write("</h3>\n");
     
    8894                        if (ain != null) {
    8995                            String aname = ain.getSettings().getDestinationNickname();
     96                            String ab64 = a.toBase64().substring(0, 4);
    9097                            if (aname == null)
    91                                 aname = a.toBase64().substring(0,4);
    92                             out.write("<h3 class=\"tabletitle\" id=\"" + a.toBase64().substring(0,4)
     98                                aname = ab64;
     99                            out.write("<h3 class=\"tabletitle\" id=\"" + ab64
    93100                                      + "\" >" + _t("Client tunnels for") + ' ' + DataHelper.escapeHTML(_t(aname)));
    94101                            if (isLocal)
    95                                 out.write(" <a href=\"/configtunnels#" + client.toBase64().substring(0,4) +"\" title=\"" + _t("Configure tunnels for session") + "\">[" + _t("configure") + "]</a></h3>\n");
     102                                out.write(" <a href=\"/configtunnels#" + b64 + "\" title=\"" + _t("Configure tunnels for session") + "\">[" + _t("configure") + "]</a></h3>\n");
    96103                            else
    97104                                out.write(" (" + _t("dead") + ")</h3>\n");
Note: See TracChangeset for help on using the changeset viewer.