add jump list to form

This commit is contained in:
zzz
2010-12-15 01:06:08 +00:00
parent c15c97f69c
commit 9d41e86866
4 changed files with 29 additions and 2 deletions

View File

@ -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://i2host.i2p/cgi-bin/i2hostjump?," +
"http://stats.i2p/cgi-bin/jump.cgi?a=," + "http://stats.i2p/cgi-bin/jump.cgi?a=," +
"http://i2jump.i2p/"; "http://i2jump.i2p/";

View File

@ -18,6 +18,7 @@ import net.i2p.data.Destination;
import net.i2p.data.PrivateKeyFile; import net.i2p.data.PrivateKeyFile;
import net.i2p.data.Signature; import net.i2p.data.Signature;
import net.i2p.data.SigningPrivateKey; import net.i2p.data.SigningPrivateKey;
import net.i2p.i2ptunnel.I2PTunnelHTTPClient;
import net.i2p.i2ptunnel.I2PTunnelHTTPClientBase; import net.i2p.i2ptunnel.I2PTunnelHTTPClientBase;
import net.i2p.i2ptunnel.TunnelController; import net.i2p.i2ptunnel.TunnelController;
import net.i2p.i2ptunnel.TunnelControllerGroup; import net.i2p.i2ptunnel.TunnelControllerGroup;
@ -183,6 +184,11 @@ public class EditBean extends IndexBean {
return getProperty(tunnel, "i2cp.accessList", "").replace(",", "\n"); 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) { public boolean getClose(int tunnel) {
return getBooleanProperty(tunnel, "i2cp.closeOnIdle"); return getBooleanProperty(tunnel, "i2cp.closeOnIdle");
} }

View File

@ -24,6 +24,7 @@ import net.i2p.data.Certificate;
import net.i2p.data.Destination; import net.i2p.data.Destination;
import net.i2p.data.PrivateKeyFile; import net.i2p.data.PrivateKeyFile;
import net.i2p.data.SessionKey; import net.i2p.data.SessionKey;
import net.i2p.i2ptunnel.I2PTunnelHTTPClient;
import net.i2p.i2ptunnel.I2PTunnelHTTPClientBase; import net.i2p.i2ptunnel.I2PTunnelHTTPClientBase;
import net.i2p.i2ptunnel.TunnelController; import net.i2p.i2ptunnel.TunnelController;
import net.i2p.i2ptunnel.TunnelControllerGroup; import net.i2p.i2ptunnel.TunnelControllerGroup;
@ -679,10 +680,17 @@ public class IndexBean {
if (val != null) if (val != null)
_otherOptions.put("i2cp.leaseSetKey", val.trim()); _otherOptions.put("i2cp.leaseSetKey", val.trim());
} }
public void setAccessList(String val) { public void setAccessList(String val) {
if (val != null) if (val != null)
_otherOptions.put("i2cp.accessList", val.trim().replace("\r\n", ",").replace("\n", ",").replace(" ", ",")); _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) { public void setCloseTime(String val) {
if (val != null) { if (val != null) {
try { try {
@ -954,7 +962,8 @@ public class IndexBean {
}; };
private static final String _otherClientOpts[] = { private static final String _otherClientOpts[] = {
"i2cp.reduceIdleTime", "i2cp.reduceQuantity", "i2cp.closeIdleTime", "i2cp.reduceIdleTime", "i2cp.reduceQuantity", "i2cp.closeIdleTime",
"proxyUsername", "proxyPassword", "outproxyUsername", "outproxyPassword" "proxyUsername", "proxyPassword", "outproxyUsername", "outproxyPassword",
I2PTunnelHTTPClient.PROP_JUMP_SERVERS
}; };
private static final String _otherServerOpts[] = { private static final String _otherServerOpts[] = {
"i2cp.reduceIdleTime", "i2cp.reduceQuantity", "i2cp.leaseSetKey", "i2cp.accessList", "i2cp.reduceIdleTime", "i2cp.reduceQuantity", "i2cp.leaseSetKey", "i2cp.accessList",

View File

@ -465,6 +465,18 @@
</div> </div>
<% } // httpclient || connect || socks || socksirc %> <% } // 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"> <div id="customOptionsField" class="rowItem">
<label for="customOptions" accesskey="u"> <label for="customOptions" accesskey="u">
<%=intl._("Custom options")%>(<span class="accessKey">u</span>): <%=intl._("Custom options")%>(<span class="accessKey">u</span>):