diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java index b60dc289e..7c753e6ab 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java @@ -270,7 +270,14 @@ public class EditBean extends IndexBean { return false; } + /** @since 0.8.3 */ + public boolean isRouterContext() { + return _context.isRouterContext(); + } + public String getI2CPHost(int tunnel) { + if (_context.isRouterContext()) + return _("internal"); TunnelController tun = getController(tunnel); if (tun != null) return tun.getI2CPHost(); @@ -279,6 +286,8 @@ public class EditBean extends IndexBean { } public String getI2CPPort(int tunnel) { + if (_context.isRouterContext()) + return _("internal"); TunnelController tun = getController(tunnel); if (tun != null) return tun.getI2CPPort(); diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java index 0640c2a31..5e38b2b4e 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java @@ -537,11 +537,11 @@ public class IndexBean { public void setDescription(String description) { _description = (description != null ? description.trim() : null); } - /** I2CP host the router is on */ + /** I2CP host the router is on, ignored when in router context */ public void setClientHost(String host) { _i2cpHost = (host != null ? host.trim() : null); } - /** I2CP port the router is on */ + /** I2CP port the router is on, ignored when in router context */ public void setClientport(String port) { _i2cpPort = (port != null ? port.trim() : null); } @@ -929,12 +929,14 @@ public class IndexBean { config.setProperty("name", _name); if (_description != null) config.setProperty("description", _description); - if (_i2cpHost != null) - config.setProperty("i2cpHost", _i2cpHost); - if ( (_i2cpPort != null) && (_i2cpPort.trim().length() > 0) ) { - config.setProperty("i2cpPort", _i2cpPort); - } else { - config.setProperty("i2cpPort", "7654"); + if (!_context.isRouterContext()) { + if (_i2cpHost != null) + config.setProperty("i2cpHost", _i2cpHost); + if ( (_i2cpPort != null) && (_i2cpPort.trim().length() > 0) ) { + config.setProperty("i2cpPort", _i2cpPort); + } else { + config.setProperty("i2cpPort", "7654"); + } } if (_privKeyFile != null) config.setProperty("privKeyFile", _privKeyFile); @@ -1020,7 +1022,7 @@ public class IndexBean { } } - private String _(String key) { + protected String _(String key) { return Messages._(key, _context); } } diff --git a/apps/i2ptunnel/jsp/editClient.jsp b/apps/i2ptunnel/jsp/editClient.jsp index 2b69440ac..b6475f754 100644 --- a/apps/i2ptunnel/jsp/editClient.jsp +++ b/apps/i2ptunnel/jsp/editClient.jsp @@ -286,19 +286,19 @@ <% } // !streamrclient %>
- +
- + readonly="readonly" <% } %> />
- + readonly="readonly" <% } %> />
<% if (!"streamrclient".equals(tunnelType)) { // streamr client sends pings so it will never be idle %> diff --git a/apps/i2ptunnel/jsp/editServer.jsp b/apps/i2ptunnel/jsp/editServer.jsp index 773d323a2..5d3660453 100644 --- a/apps/i2ptunnel/jsp/editServer.jsp +++ b/apps/i2ptunnel/jsp/editServer.jsp @@ -305,19 +305,19 @@ <% } // !streamrserver %>
- +
- + readonly="readonly" <% } %> />
- + readonly="readonly" <% } %> />