From 9d41e86866e2e94630c673fde84d27b671511a2b Mon Sep 17 00:00:00 2001 From: zzz <zzz@mail.i2p> Date: Wed, 15 Dec 2010 01:06:08 +0000 Subject: [PATCH] add jump list to form --- .../src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java | 2 +- .../java/src/net/i2p/i2ptunnel/web/EditBean.java | 6 ++++++ .../java/src/net/i2p/i2ptunnel/web/IndexBean.java | 11 ++++++++++- apps/i2ptunnel/jsp/editClient.jsp | 12 ++++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java index 6c5c38e5e5..f747e48e73 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java @@ -901,7 +901,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn } } - private static String DEFAULT_JUMP_SERVERS = + public static final String DEFAULT_JUMP_SERVERS = "http://i2host.i2p/cgi-bin/i2hostjump?," + "http://stats.i2p/cgi-bin/jump.cgi?a=," + "http://i2jump.i2p/"; 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 696c652e2a..994f026dc6 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java @@ -18,6 +18,7 @@ import net.i2p.data.Destination; import net.i2p.data.PrivateKeyFile; import net.i2p.data.Signature; import net.i2p.data.SigningPrivateKey; +import net.i2p.i2ptunnel.I2PTunnelHTTPClient; import net.i2p.i2ptunnel.I2PTunnelHTTPClientBase; import net.i2p.i2ptunnel.TunnelController; import net.i2p.i2ptunnel.TunnelControllerGroup; @@ -183,6 +184,11 @@ public class EditBean extends IndexBean { return getProperty(tunnel, "i2cp.accessList", "").replace(",", "\n"); } + public String getJumpList(int tunnel) { + return getProperty(tunnel, I2PTunnelHTTPClient.PROP_JUMP_SERVERS, + I2PTunnelHTTPClient.DEFAULT_JUMP_SERVERS).replace(",", "\n"); + } + public boolean getClose(int tunnel) { return getBooleanProperty(tunnel, "i2cp.closeOnIdle"); } 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 510f550336..39e85d9869 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java @@ -24,6 +24,7 @@ import net.i2p.data.Certificate; import net.i2p.data.Destination; import net.i2p.data.PrivateKeyFile; import net.i2p.data.SessionKey; +import net.i2p.i2ptunnel.I2PTunnelHTTPClient; import net.i2p.i2ptunnel.I2PTunnelHTTPClientBase; import net.i2p.i2ptunnel.TunnelController; import net.i2p.i2ptunnel.TunnelControllerGroup; @@ -679,10 +680,17 @@ public class IndexBean { if (val != null) _otherOptions.put("i2cp.leaseSetKey", val.trim()); } + public void setAccessList(String val) { if (val != null) _otherOptions.put("i2cp.accessList", val.trim().replace("\r\n", ",").replace("\n", ",").replace(" ", ",")); } + + public void setJumpList(String val) { + if (val != null) + _otherOptions.put(I2PTunnelHTTPClient.PROP_JUMP_SERVERS, val.trim().replace("\r\n", ",").replace("\n", ",").replace(" ", ",")); + } + public void setCloseTime(String val) { if (val != null) { try { @@ -954,7 +962,8 @@ public class IndexBean { }; private static final String _otherClientOpts[] = { "i2cp.reduceIdleTime", "i2cp.reduceQuantity", "i2cp.closeIdleTime", - "proxyUsername", "proxyPassword", "outproxyUsername", "outproxyPassword" + "proxyUsername", "proxyPassword", "outproxyUsername", "outproxyPassword", + I2PTunnelHTTPClient.PROP_JUMP_SERVERS }; private static final String _otherServerOpts[] = { "i2cp.reduceIdleTime", "i2cp.reduceQuantity", "i2cp.leaseSetKey", "i2cp.accessList", diff --git a/apps/i2ptunnel/jsp/editClient.jsp b/apps/i2ptunnel/jsp/editClient.jsp index b6475f7543..f2b427542b 100644 --- a/apps/i2ptunnel/jsp/editClient.jsp +++ b/apps/i2ptunnel/jsp/editClient.jsp @@ -465,6 +465,18 @@ </div> <% } // httpclient || connect || socks || socksirc %> + <% if ("httpclient".equals(tunnelType)) { %> + <div id="optionsField" class="rowItem"> + <label><%=intl._("Jump URL List")%>:</label> + </div> + <div id="hostField" class="rowItem"> + <textarea rows="2" style="height: 8em;" cols="60" id="hostField" name="jumpList" title="List of helper URLs to offer when a host is not found in your addressbook" wrap="off"><%=editBean.getJumpList(curTunnel)%></textarea> + </div> + <div class="subdivider"> + <hr /> + </div> + <% } // httpclient %> + <div id="customOptionsField" class="rowItem"> <label for="customOptions" accesskey="u"> <%=intl._("Custom options")%>(<span class="accessKey">u</span>): -- GitLab