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 eb7de9cf1ea2085bb8a8edbb1c96f479037bd9a5..90e5f7e201086c5f0c612f480561b8dfd612c559 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java @@ -41,11 +41,11 @@ public class EditBean extends IndexBean { if (tun != null) return tun.getTargetHost(); else - return ""; + return "127.0.0.1"; } public String getTargetPort(int tunnel) { TunnelController tun = getController(tunnel); - if (tun != null) + if (tun != null && tun.getTargetPort() != null) return tun.getTargetPort(); else return ""; @@ -59,7 +59,7 @@ public class EditBean extends IndexBean { } public String getPrivateKeyFile(int tunnel) { TunnelController tun = getController(tunnel); - if (tun != null) + if (tun != null && tun.getPrivKeyFile() != null) return tun.getPrivKeyFile(); else return ""; @@ -266,4 +266,4 @@ public class EditBean extends IndexBean { } return props; } -} \ No newline at end of file +} 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 48d265fc253054900ed3049e82ee3cba4efb6558..c8d321ea24589c1046b1a5cfa87e90df44f0a834 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java @@ -96,6 +96,7 @@ public class IndexBean { _curNonce = -1; } } + public void setPassphrase(String phrase) { _passphrase = phrase; } @@ -332,15 +333,15 @@ public class IndexBean { public String getTunnelName(int tunnel) { TunnelController tun = getController(tunnel); - if (tun != null) + if (tun != null && tun.getName() != null) return tun.getName(); else - return ""; + return "New Tunnel"; } public String getClientPort(int tunnel) { TunnelController tun = getController(tunnel); - if (tun != null) + if (tun != null && tun.getListenPort() != null) return tun.getListenPort(); else return ""; @@ -389,7 +390,7 @@ public class IndexBean { public String getTunnelDescription(int tunnel) { TunnelController tun = getController(tunnel); - if (tun != null) + if (tun != null && tun.getDescription() != null) return tun.getDescription(); else return ""; @@ -406,7 +407,12 @@ public class IndexBean { public String getClientDestination(int tunnel) { TunnelController tun = getController(tunnel); if (tun == null) return ""; - if ("client".equals(tun.getType())||"ircclient".equals(tun.getType())) return tun.getTargetDestination(); + if ("client".equals(tun.getType())||"ircclient".equals(tun.getType())) { + if (tun.getTargetDestination() != null) + return tun.getTargetDestination(); + else + return ""; + } else return tun.getProxyList(); } diff --git a/apps/i2ptunnel/jsp/editClient.jsp b/apps/i2ptunnel/jsp/editClient.jsp index 47fca53853a0094dfd79ee3d02c7f127527680ac..97f8adbe5ec9d3e2a24802e5cba4cee7fb135876 100644 --- a/apps/i2ptunnel/jsp/editClient.jsp +++ b/apps/i2ptunnel/jsp/editClient.jsp @@ -80,6 +80,10 @@ <div id="portField" class="rowItem"> <label for="port" accesskey="P"> <span class="accessKey">P</span>ort: + <% String value = editBean.getClientPort(curTunnel); + if (value == null || "".equals(value.trim())) + out.write(" <font color=\"red\">(required)</font>"); + %> </label> <input type="text" size="6" maxlength="5" id="port" name="port" title="Access Port Number" value="<%=editBean.getClientPort(curTunnel)%>" class="freetext" /> </div> @@ -123,6 +127,10 @@ %><div id="destinationField" class="rowItem"> <label for="targetDestination" accesskey="T"> <span class="accessKey">T</span>unnel Destination: + <% String value2 = editBean.getClientDestination(curTunnel); + if (value2 == null || "".equals(value2.trim())) + out.write(" <font color=\"red\">(required)</font>"); + %> </label> <input type="text" size="30" id="targetDestination" name="targetDestination" title="Destination of the Tunnel" value="<%=editBean.getClientDestination(curTunnel)%>" class="freetext" /> <span class="comment">(name or destination)</span> diff --git a/apps/i2ptunnel/jsp/editServer.jsp b/apps/i2ptunnel/jsp/editServer.jsp index 910088ce9452a7560614d7df674873a459e67484..0cdf5e0e9ec57bd2d8756fe41305f0b7aecd5858 100644 --- a/apps/i2ptunnel/jsp/editServer.jsp +++ b/apps/i2ptunnel/jsp/editServer.jsp @@ -93,6 +93,10 @@ <div id="portField" class="rowItem"> <label for="targetPort" accesskey="P"> <span class="accessKey">P</span>ort: + <% String value = editBean.getTargetPort(curTunnel); + if (value == null || "".equals(value.trim())) + out.write(" <font color=\"red\">(required)</font>"); + %> </label> <input type="text" size="6" maxlength="5" id="targetPort" name="targetPort" title="Target Port Number" value="<%=editBean.getTargetPort(curTunnel)%>" class="freetext" /> </div> @@ -112,6 +116,10 @@ %><div id="privKeyField" class="rowItem"> <label for="privKeyFile" accesskey="k"> Private <span class="accessKey">k</span>ey file: + <% String value2 = editBean.getPrivateKeyFile(curTunnel); + if (value2 == null || "".equals(value2.trim())) + out.write(" <font color=\"red\">(required)</font>"); + %> </label> <input type="text" size="30" id="privKeyFile" name="privKeyFile" title="Path to Private Key File" value="<%=editBean.getPrivateKeyFile(curTunnel)%>" class="freetext" /> </div>