<%@page contentType="text/html"%><%@page pageEncoding="UTF-8"%><% // note that for the helper we use a session scope, not a request scope, // so that we can access the NDT test results. // The MLabHelper singleton will prevent multiple simultaneous tests, even across sessions. // page ID final int LAST_PAGE = 7; String pg = request.getParameter("page"); int ipg; if (pg == null) { ipg = 1; } else { try { ipg = Integer.parseInt(pg); if (request.getParameter("prev") != null) { // previous button handling if (ipg == 6) ipg = 3; else ipg -= 2; } if (ipg <= 0 || ipg > LAST_PAGE) { ipg = 1; } else if (ipg == 4 && request.getParameter("skipbw") != null) { ipg++; // skip bw test } } catch (NumberFormatException nfe) { ipg = 1; } } // detect completion boolean done = request.getParameter("done") != null || request.getParameter("skip") != null; if (done) { // tell wizard helper we're done String i2pcontextId = request.getParameter("i2p.contextId"); try { if (i2pcontextId != null) { session.setAttribute("i2p.contextId", i2pcontextId); } else { i2pcontextId = (String) session.getAttribute("i2p.contextId"); } } catch (IllegalStateException ise) {} wizhelper.setContextId(i2pcontextId); wizhelper.complete(); // redirect to /home response.setStatus(307); response.setHeader("Cache-Control","no-cache"); String req = request.getRequestURL().toString(); int slash = req.indexOf("/welcome"); if (slash >= 0) req = req.substring(0, slash) + "/home"; else // shouldn't happen req = "http://127.0.0.1:7657/home"; response.setHeader("Location", req); // force commitment response.getOutputStream().close(); return; } %> <%@include file="css.jsi" %> <%=intl.title("New Install Wizard")%> <% wizhelper.setContextId(i2pcontextId); if (ipg == 4) { %> <% } %> <% if (ipg == 4) { %> <% } else { %> <% } %>

<%=intl._t("New Install Wizard")%> <%=ipg%>/<%=LAST_PAGE%>

<% // Bind the session-scope Helper to the request-scope Handler formhandler.setWizardHelper(wizhelper); %> <%@include file="formhandler.jsi" %>
<% if (ipg == 1) { // language selection %> <%-- needed for CSS: --%>
<%-- needed for lang setting in css.jsi: --%>

<%=uihelper._t("Router Console Language")%>

<% } else if (ipg == 2) { // I2P Philosophy // license info? %>

<%=intl._t("Why I2P?")%>

TODO

<% } else if (ipg == 3) { // Overview of bandwidth test %>

<%=intl._t("Bandwidth Test")%>

<%=intl._t("I2P will now test your internet connection to identify the optimal speed settings.")%> <%=intl._t("Applying these settings will maximize your download speed using the third-party M-Lab service.")%> <%=intl._t("M-Lab collects and publishes the IP address of the client that conducted the measurement.")%> <%=intl._t("FIXME! This is necessary to understand and describe experimental results, including to identify which Internet service provider the test was conducted from.")%> <%=intl._t("Please review the M-Lab privacy policies linked below.")%> <%=intl._t("If you do not wish to run the M-Lab bandwidth test, you may skip it by clicking the button below.")%>

<%=intl._t("M-Lab Privacy Policy")%>
<%=intl._t("M-Lab Name Server Privacy Policy")%>

<% } else if (ipg == 4) { // Bandwidth test in progress (w/ AJAX) %>

<%=intl._t("Bandwidth Test in Progress")%>

<%=intl._t("Javascript is disabled - wait 60 seconds for the bandwidth test to complete and then click Next")%>
<% } else if (ipg == 5) { // Bandwidth test results // and/or manual bw entry? %>

<%=intl._t("Bandwidth Test Results")%>

<%=intl._t("Test running?")%><%=wizhelper.isNDTRunning()%>
<%=intl._t("Test complete?")%><%=wizhelper.isNDTComplete()%>
<%=intl._t("Test server location")%><%=wizhelper.getServerLocation()%>
<%=intl._t("Completion status")%><%=wizhelper.getCompletionStatus()%>
<%=intl._t("Details")%><%=wizhelper.getDetailStatus()%>
<%=intl._t("Downstream Bandwidth")%><%=net.i2p.data.DataHelper.formatSize2Decimal(wizhelper.getDownBandwidth())%>Bps
<%=intl._t("Upstream Bandwidth")%><%=net.i2p.data.DataHelper.formatSize2Decimal(wizhelper.getUpBandwidth())%>Bps
<%=intl._t("Share of Bandwidth for I2P")%><%=Math.round(net.i2p.router.web.helpers.WizardHelper.BW_SCALE * 100)%>%

<%=intl._t("Bandwidth Configuration")%>

<%-- display burst, set standard, handler will fix up --%>
<%=intl._t("I2P will work best if you configure your rates to match the speed of your internet connection.")%>
" > <%=intl._t("KBps In")%> ()
" > <%=intl._t("KBps Out")%> ()
<%=intl._t("Share")%> ()
<% int share = Math.round(wizhelper.getShareBandwidth() * 1.024f); if (share < 12) { out.print(""); out.print(intl._t("NOTE")); out.print(": "); out.print(intl._t("You have configured I2P to share only {0} KBps.", share)); out.print("\n"); out.print(intl._t("I2P requires at least 12KBps to enable sharing. ")); out.print(intl._t("Please enable sharing (participating in tunnels) by configuring more bandwidth. ")); out.print(intl._t("It improves your anonymity by creating cover traffic, and helps the network.")); } else { out.print(intl._t("You have configured I2P to share {0} KBps.", share)); out.print("\n"); out.print(intl._t("The higher the share bandwidth the more you improve your anonymity and help the network.")); } %>
<% } else if (ipg == 6) { // Browser setup %>

<%=intl._t("Browser Setup")%>

TODO

<% } else if (ipg == LAST_PAGE) { // Done %>

<%=intl._t("Finished")%>

TODO

<% } else { %>

unknown wizard page

<% } %>
<% if (ipg != 1) { %> " > <% } if (ipg != LAST_PAGE) { %> " > <% if (ipg == 3) { %> " > <% } else if (ipg == 4) { %> " > <% } %> " > <% } else { %> " > <% } %>