Changeset f04b41c


Ignore:
Timestamp:
May 13, 2019 10:49:49 AM (11 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
ff71540
Parents:
847ebda
Message:

Console: Hide transport table unless advanced

File:
1 edited

Legend:

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

    r847ebda rf04b41c  
    4343import net.i2p.router.networkdb.kademlia.FloodfillNetworkDatabaseFacade;
    4444import static net.i2p.router.sybil.Util.biLog2;
     45import net.i2p.router.web.HelperBase;
    4546import net.i2p.router.web.Messages;
    4647import net.i2p.router.web.WebAppStarter;
     
    766767
    767768        // transports table
    768         buf.append("<table id=\"netdbtransports\">\n");
    769         buf.append("<tr><th align=\"left\">" + _t("Transports") + "</th><th>" + _t("Count") + "</th></tr>\n");
    770         for (int i = 0; i < TNAMES.length; i++) {
    771             int num = transportCount[i];
    772             if (num > 0) {
    773                 buf.append("<tr><td>").append(_t(TNAMES[i]));
    774                 buf.append("</td><td align=\"center\">").append(num).append("</td></tr>\n");
    775             }
    776         }
    777         buf.append("</table>\n");
    778         buf.append("</td><td style=\"vertical-align: top;\">");
    779         out.write(buf.toString());
    780         buf.setLength(0);
    781         end = System.currentTimeMillis();
    782         if (log.shouldWarn())
    783             log.warn("part 3 took " + (end - start));
    784         start = end;
     769        boolean showTransports = _context.getBooleanProperty(HelperBase.PROP_ADVANCED);
     770        if (showTransports) {
     771            buf.append("<table id=\"netdbtransports\">\n");
     772            buf.append("<tr><th align=\"left\">" + _t("Transports") + "</th><th>" + _t("Count") + "</th></tr>\n");
     773            for (int i = 0; i < TNAMES.length; i++) {
     774                int num = transportCount[i];
     775                if (num > 0) {
     776                    buf.append("<tr><td>").append(_t(TNAMES[i]));
     777                    buf.append("</td><td align=\"center\">").append(num).append("</td></tr>\n");
     778                }
     779            }
     780            buf.append("</table>\n");
     781            buf.append("</td><td style=\"vertical-align: top;\">");
     782            out.write(buf.toString());
     783            buf.setLength(0);
     784            end = System.currentTimeMillis();
     785            if (log.shouldWarn())
     786                log.warn("part 3 took " + (end - start));
     787            start = end;
     788        }
    785789
    786790        // country table
Note: See TracChangeset for help on using the changeset viewer.