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))
|
||||
|
Reference in New Issue
Block a user