forked from I2P_Developers/i2p.i2p
* Console:
- Better IPv6 test, hopefully will work on Windows - Hide home page flags once language is selected - Home page shrinkage and other CSS tweaks
This commit is contained in:
@@ -27,6 +27,7 @@ public class HomeHelper extends HelperBase {
|
||||
static final String DEFAULT_SERVICES =
|
||||
_x("Addressbook") + S + _x("Manage your I2P hosts file here (I2P domain name resolution)") + S + "/susidns/index" + S + I + "book_addresses.png" + S +
|
||||
_x("Configure Bandwidth") + S + _x("I2P Bandwidth Configuration") + S + "/config" + S + I + "wrench_orange.png" + S +
|
||||
_x("Configure Language") + S + _x("Console Language Selection") + S + "/configui" + S + I + "wrench_orange.png" + S +
|
||||
_x("Customize Home Page") + S + _x("I2P Home Page Configuration") + S + "/confighome" + S + I + "wrench_orange.png" + S +
|
||||
_x("Email") + S + _x("Anonymous webmail client") + S + "/susimail/susimail" + S + I + "email.png" + S +
|
||||
_x("Help") + S + _x("I2P Router Help") + S + "/help" + S + I + "help.png" + S +
|
||||
@@ -57,6 +58,10 @@ public class HomeHelper extends HelperBase {
|
||||
"";
|
||||
|
||||
|
||||
public boolean shouldShowWelcome() {
|
||||
return _context.getProperty(Messages.PROP_LANG) == null;
|
||||
}
|
||||
|
||||
public String getServices() {
|
||||
List<App> plugins = NavHelper.getClientApps(_context);
|
||||
return homeTable(PROP_SERVICES, DEFAULT_SERVICES, plugins);
|
||||
|
@@ -7,6 +7,7 @@ import java.io.FilenameFilter;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.Inet4Address;
|
||||
import java.net.ServerSocket;
|
||||
import java.security.KeyStore;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -316,10 +317,16 @@ public class RouterConsoleRunner {
|
||||
// Test before we add the connector, because Jetty 6 won't start if any of the
|
||||
// connectors are bad
|
||||
InetAddress test = InetAddress.getByName(host);
|
||||
ServerSocket testSock = null;
|
||||
if ((!hasIPV6) && (!(test instanceof Inet4Address)))
|
||||
throw new IOException("IPv6 addresses unsupported, you may ignore this warning if the console is still available at http://127.0.0.1:7657");
|
||||
throw new IOException("IPv6 addresses unsupported");
|
||||
if ((!hasIPV4) && (test instanceof Inet4Address))
|
||||
throw new IOException("IPv4 addresses unsupported, you may ignore this warning if the console is still available at http://localhost:7657");
|
||||
throw new IOException("IPv4 addresses unsupported");
|
||||
try {
|
||||
testSock = new ServerSocket(0, 0, test);
|
||||
} finally {
|
||||
if (testSock != null) try { testSock.close(); } catch (IOException ioe) {}
|
||||
}
|
||||
//if (host.indexOf(":") >= 0) // IPV6 - requires patched Jetty 5
|
||||
// _server.addListener('[' + host + "]:" + _listenPort);
|
||||
//else
|
||||
@@ -332,8 +339,9 @@ public class RouterConsoleRunner {
|
||||
lsnr.setName("ConsoleSocket"); // all with same name will use the same thread pool
|
||||
_server.addConnector(lsnr);
|
||||
boundAddresses++;
|
||||
} catch (Exception ioe) { // this doesn't seem to work, exceptions don't happen until start() below
|
||||
System.err.println("Unable to bind routerconsole to " + host + " port " + _listenPort + ' ' + ioe);
|
||||
} catch (Exception ioe) {
|
||||
System.err.println("Unable to bind routerconsole to " + host + " port " + _listenPort + ": " + ioe);
|
||||
System.err.println("You may ignore this warning if the console is still available at http://localhost:" + _listenPort);
|
||||
}
|
||||
}
|
||||
// XXX: what if listenhosts do not include 127.0.0.1? (Should that ever even happen?)
|
||||
@@ -362,9 +370,15 @@ public class RouterConsoleRunner {
|
||||
// connectors are bad
|
||||
InetAddress test = InetAddress.getByName(host);
|
||||
if ((!hasIPV6) && (!(test instanceof Inet4Address)))
|
||||
throw new IOException("IPv6 addresses unsupported, you may ignore this warning if the console is still available at http://127.0.0.1:7657");
|
||||
throw new IOException("IPv6 addresses unsupported");
|
||||
if ((!hasIPV4) && (test instanceof Inet4Address))
|
||||
throw new IOException("IPv4 addresses unsupported, you may ignore this warning if the console is still available at http://localhost:7657");
|
||||
throw new IOException("IPv4 addresses unsupported");
|
||||
ServerSocket testSock = null;
|
||||
try {
|
||||
testSock = new ServerSocket(0, 0, test);
|
||||
} finally {
|
||||
if (testSock != null) try { testSock.close(); } catch (IOException ioe) {}
|
||||
}
|
||||
// TODO if class not found use SslChannelConnector
|
||||
// Sadly there's no common base class with the ssl methods in it
|
||||
SslSelectChannelConnector ssll = new SslSelectChannelConnector();
|
||||
@@ -379,8 +393,9 @@ public class RouterConsoleRunner {
|
||||
ssll.setName("ConsoleSocket"); // all with same name will use the same thread pool
|
||||
_server.addConnector(ssll);
|
||||
boundAddresses++;
|
||||
} catch (Exception e) { // probably no exceptions at this point
|
||||
} catch (Exception e) {
|
||||
System.err.println("Unable to bind routerconsole to " + host + " port " + sslPort + " for SSL: " + e);
|
||||
System.err.println("You may ignore this warning if the console is still available at https://localhost:" + sslPort);
|
||||
}
|
||||
}
|
||||
I2PAppContext.getGlobalContext().portMapper().register(PortMapper.SVC_HTTPS_CONSOLE,sslPort);
|
||||
|
@@ -72,7 +72,7 @@ public class SearchHelper extends HelperBase {
|
||||
}
|
||||
}
|
||||
StringBuilder buf = new StringBuilder(1024);
|
||||
buf.append("<select name=\"engine\">");
|
||||
buf.append("<select name=\"engine\" title=\"").append(_("Select search engine")).append("\">");
|
||||
for (String name : _engines.keySet()) {
|
||||
buf.append("<option value=\"").append(name).append('\"');
|
||||
if (name.equals(dflt))
|
||||
|
@@ -32,7 +32,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="welcome">
|
||||
<jsp:useBean class="net.i2p.router.web.HomeHelper" id="homehelper" scope="request" />
|
||||
<jsp:setProperty name="homehelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
|
||||
<% if (homehelper.shouldShowWelcome()) { %>
|
||||
<div class="welcome" title="Click a flag to select a language. Click 'configure language' below to change it later.">
|
||||
<div class="langbox" id="langbox">
|
||||
<a href="/home?lang=en&consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=us" title="English" alt="English"></a>
|
||||
<a href="/home?lang=ar&consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=lang_ar" title="عربية" alt="عربية"></a>
|
||||
@@ -55,6 +58,7 @@
|
||||
</div>
|
||||
<h2 class="app"><%=intl._("Welcome to I2P")%></h2>
|
||||
</div>
|
||||
<% } // shouldShowWelcome %>
|
||||
|
||||
<div class="news" id="news">
|
||||
<jsp:useBean class="net.i2p.router.web.NewsHelper" id="newshelper" scope="request" />
|
||||
@@ -63,7 +67,6 @@
|
||||
if (newshelper.shouldShowNews()) {
|
||||
java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml");
|
||||
%>
|
||||
<h3 class="app"><%=intl._("Latest I2P News")%></h3>
|
||||
<jsp:setProperty name="newshelper" property="page" value="<%=fpath.getAbsolutePath()%>" />
|
||||
<jsp:setProperty name="newshelper" property="maxLines" value="300" />
|
||||
<jsp:getProperty name="newshelper" property="content" />
|
||||
@@ -80,11 +83,9 @@
|
||||
<div class="search">
|
||||
<form action="/search.jsp" method="POST">
|
||||
<table class="search"><tr><td align="right">
|
||||
<input size="50" type="text" class="search" name="query" />
|
||||
<input size="40" type="text" class="search" name="query" />
|
||||
</td><td align="left">
|
||||
<button type="submit" value="search" class="search"><%=intl._("Search I2P")%></button>
|
||||
</td></tr><tr><td align="right">
|
||||
<b>Using search engine:</b>
|
||||
</td><td align="left">
|
||||
<jsp:useBean class="net.i2p.router.web.SearchHelper" id="searchhelper" scope="request" />
|
||||
<jsp:setProperty name="searchhelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
|
||||
@@ -92,8 +93,6 @@
|
||||
</td></tr></table>
|
||||
</form>
|
||||
</div>
|
||||
<jsp:useBean class="net.i2p.router.web.HomeHelper" id="homehelper" scope="request" />
|
||||
<jsp:setProperty name="homehelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
|
||||
<div class="ag2">
|
||||
<h4 class="app"><%=intl._("Eepsites of Interest")%></h4>
|
||||
<jsp:getProperty name="homehelper" property="favorites" /><br>
|
||||
|
Reference in New Issue
Block a user