Changeset 8973325


Ignore:
Timestamp:
Nov 23, 2016 4:00:36 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
b72b768
Parents:
8146f6f
Message:

Console: Lookup RI by caps
stub out lookup by IP

Location:
apps/routerconsole
Files:
3 edited

Legend:

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

    r8146f6f r8973325  
    88    private String _version;
    99    private String _country;
    10     private String _family;
     10    private String _family, _caps, _ip;
    1111    private int _full;
    1212    private boolean _lease;
     
    5757    }
    5858
     59    /** @since 0.9.28 */
     60    public void setCaps(String c) {
     61        if (c != null)
     62            _caps = DataHelper.stripHTML(c);  // XSS
     63    }
     64
     65    /** @since 0.9.28 */
     66    public void setIp(String c) {
     67        if (c != null)
     68            _ip = DataHelper.stripHTML(c);  // XSS
     69    }
     70
    5971    public void setFull(String f) {
    6072        try {
     
    8395        try {
    8496            renderNavBar();
    85             if (_routerPrefix != null || _version != null || _country != null || _family != null)
    86                 renderer.renderRouterInfoHTML(_out, _routerPrefix, _version, _country, _family);
     97            if (_routerPrefix != null || _version != null || _country != null ||
     98                _family != null || _caps != null || _ip != null)
     99                renderer.renderRouterInfoHTML(_out, _routerPrefix, _version, _country, _family, _caps, _ip);
    87100            else if (_lease)
    88101                renderer.renderLeaseSetHTML(_out, _debug);
  • apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java

    r8146f6f r8973325  
    8989     */
    9090    public void renderRouterInfoHTML(Writer out, String routerPrefix, String version,
    91                                      String country, String family) throws IOException {
     91                                     String country, String family, String caps, String ip) throws IOException {
    9292        StringBuilder buf = new StringBuilder(4*1024);
    9393        if (".".equals(routerPrefix)) {
     
    101101                    (version != null && version.equals(ri.getVersion())) ||
    102102                    (country != null && country.equals(_context.commSystem().getCountry(key))) ||
    103                     (family != null && family.equals(ri.getOption("family")))) {
     103                    (family != null && family.equals(ri.getOption("family"))) ||
     104                    (caps != null && caps.equals(ri.getCapabilities()))) {
    104105                    renderRouterInfo(buf, ri, false, true);
    105106                    notFound = false;
     107                // } else { ip TODO
    106108                }
    107109            }
  • apps/routerconsole/jsp/netdb.jsp

    r8146f6f r8973325  
    2727 <jsp:setProperty name="netdbHelper" property="country" value="<%=request.getParameter(\"c\")%>" />
    2828 <jsp:setProperty name="netdbHelper" property="family" value="<%=request.getParameter(\"fam\")%>" />
     29 <jsp:setProperty name="netdbHelper" property="caps" value="<%=request.getParameter(\"caps\")%>" />
     30 <jsp:setProperty name="netdbHelper" property="ip" value="<%=request.getParameter(\"ip\")%>" />
    2931 <jsp:getProperty name="netdbHelper" property="netDbSummary" />
    3032</div></div></body></html>
Note: See TracChangeset for help on using the changeset viewer.