Changeset 653a68b8


Ignore:
Timestamp:
Dec 12, 2010 9:30:29 PM (10 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
384f1bd
Parents:
4a9f7b7
Message:

Disable I2CP host/port options when in router context

Location:
apps/i2ptunnel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java

    r4a9f7b7 r653a68b8  
    271271    }
    272272   
     273    /** @since 0.8.3 */
     274    public boolean isRouterContext() {
     275        return _context.isRouterContext();
     276    }
     277
    273278    public String getI2CPHost(int tunnel) {
     279        if (_context.isRouterContext())
     280            return _("internal");
    274281        TunnelController tun = getController(tunnel);
    275282        if (tun != null)
     
    280287   
    281288    public String getI2CPPort(int tunnel) {
     289        if (_context.isRouterContext())
     290            return _("internal");
    282291        TunnelController tun = getController(tunnel);
    283292        if (tun != null)
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java

    r4a9f7b7 r653a68b8  
    538538        _description = (description != null ? description.trim() : null);
    539539    }
    540     /** I2CP host the router is on */
     540    /** I2CP host the router is on, ignored when in router context */
    541541    public void setClientHost(String host) {
    542542        _i2cpHost = (host != null ? host.trim() : null);
    543543    }
    544     /** I2CP port the router is on */
     544    /** I2CP port the router is on, ignored when in router context */
    545545    public void setClientport(String port) {
    546546        _i2cpPort = (port != null ? port.trim() : null);
     
    930930        if (_description != null)
    931931            config.setProperty("description", _description);
    932         if (_i2cpHost != null)
    933             config.setProperty("i2cpHost", _i2cpHost);
    934         if ( (_i2cpPort != null) && (_i2cpPort.trim().length() > 0) ) {
    935             config.setProperty("i2cpPort", _i2cpPort);
    936         } else {
    937             config.setProperty("i2cpPort", "7654");
     932        if (!_context.isRouterContext()) {
     933            if (_i2cpHost != null)
     934                config.setProperty("i2cpHost", _i2cpHost);
     935            if ( (_i2cpPort != null) && (_i2cpPort.trim().length() > 0) ) {
     936                config.setProperty("i2cpPort", _i2cpPort);
     937            } else {
     938                config.setProperty("i2cpPort", "7654");
     939            }
    938940        }
    939941        if (_privKeyFile != null)
     
    10211023    }
    10221024
    1023     private String _(String key) {
     1025    protected String _(String key) {
    10241026        return Messages._(key, _context);
    10251027    }
  • apps/i2ptunnel/jsp/editClient.jsp

    r4a9f7b7 r653a68b8  
    287287
    288288            <div id="optionsField" class="rowItem">
    289                 <label><%=intl._("I2CP Options")%>:</label>
     289                <label><%=intl._("Router I2CP Address")%>:</label>
    290290            </div>
    291291            <div id="optionsHostField" class="rowItem">
     
    293293                    <%=intl._("Host")%>(<span class="accessKey">o</span>):
    294294                </label>
    295                 <input type="text" id="clientHost" name="clientHost" size="20" title="I2CP Hostname or IP" value="<%=editBean.getI2CPHost(curTunnel)%>" class="freetext" />               
     295                <input type="text" id="clientHost" name="clientHost" size="20" title="I2CP Hostname or IP" value="<%=editBean.getI2CPHost(curTunnel)%>" class="freetext" <% if (editBean.isRouterContext()) { %> readonly="readonly" <% } %> />               
    296296            </div>
    297297            <div id="optionsPortField" class="rowItem">
     
    299299                    <%=intl._("Port")%>(<span class="accessKey">r</span>):
    300300                </label>
    301                 <input type="text" id="port" name="clientport" size="20" title="I2CP Port Number" value="<%=editBean.getI2CPPort(curTunnel)%>" class="freetext" />               
     301                <input type="text" id="clientPort" name="clientport" size="20" title="I2CP Port Number" value="<%=editBean.getI2CPPort(curTunnel)%>" class="freetext" <% if (editBean.isRouterContext()) { %> readonly="readonly" <% } %> />               
    302302            </div>
    303303                 
  • apps/i2ptunnel/jsp/editServer.jsp

    r4a9f7b7 r653a68b8  
    306306
    307307            <div id="optionsField" class="rowItem">
    308                 <label><%=intl._("I2CP Options")%>:</label>
     308                <label><%=intl._("Router I2CP Address")%>:</label>
    309309            </div>
    310310            <div id="optionsHostField" class="rowItem">
     
    312312                    <%=intl._("Host")%>(<span class="accessKey">o</span>):
    313313                </label>
    314                 <input type="text" id="clientHost" name="clientHost" size="20" title="I2CP Hostname or IP" value="<%=editBean.getI2CPHost(curTunnel)%>" class="freetext" />               
     314                <input type="text" id="clientHost" name="clientHost" size="20" title="I2CP Hostname or IP" value="<%=editBean.getI2CPHost(curTunnel)%>" class="freetext" <% if (editBean.isRouterContext()) { %> readonly="readonly" <% } %> />               
    315315            </div>
    316316            <div id="optionsPortField" class="rowItem">
     
    318318                    <%=intl._("Port")%>(<span class="accessKey">r</span>):
    319319                </label>
    320                 <input type="text" id="clientPort" name="clientport" size="20" title="I2CP Port Number" value="<%=editBean.getI2CPPort(curTunnel)%>" class="freetext" />               
     320                <input type="text" id="clientPort" name="clientport" size="20" title="I2CP Port Number" value="<%=editBean.getI2CPPort(curTunnel)%>" class="freetext" <% if (editBean.isRouterContext()) { %> readonly="readonly" <% } %> />               
    321321            </div>
    322322           
Note: See TracChangeset for help on using the changeset viewer.