* 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:
zzz
2012-03-12 14:30:38 +00:00
parent 703f28e87d
commit 2415091a2f
7 changed files with 68 additions and 43 deletions

View File

@ -27,6 +27,7 @@ public class HomeHelper extends HelperBase {
static final String DEFAULT_SERVICES = 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("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 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("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("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 + _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() { public String getServices() {
List<App> plugins = NavHelper.getClientApps(_context); List<App> plugins = NavHelper.getClientApps(_context);
return homeTable(PROP_SERVICES, DEFAULT_SERVICES, plugins); return homeTable(PROP_SERVICES, DEFAULT_SERVICES, plugins);

View File

@ -7,6 +7,7 @@ import java.io.FilenameFilter;
import java.io.IOException; import java.io.IOException;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.Inet4Address; import java.net.Inet4Address;
import java.net.ServerSocket;
import java.security.KeyStore; import java.security.KeyStore;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; 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 // Test before we add the connector, because Jetty 6 won't start if any of the
// connectors are bad // connectors are bad
InetAddress test = InetAddress.getByName(host); InetAddress test = InetAddress.getByName(host);
ServerSocket testSock = null;
if ((!hasIPV6) && (!(test instanceof Inet4Address))) 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)) 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 //if (host.indexOf(":") >= 0) // IPV6 - requires patched Jetty 5
// _server.addListener('[' + host + "]:" + _listenPort); // _server.addListener('[' + host + "]:" + _listenPort);
//else //else
@ -332,8 +339,9 @@ public class RouterConsoleRunner {
lsnr.setName("ConsoleSocket"); // all with same name will use the same thread pool lsnr.setName("ConsoleSocket"); // all with same name will use the same thread pool
_server.addConnector(lsnr); _server.addConnector(lsnr);
boundAddresses++; boundAddresses++;
} catch (Exception ioe) { // this doesn't seem to work, exceptions don't happen until start() below } catch (Exception ioe) {
System.err.println("Unable to bind routerconsole to " + host + " port " + _listenPort + ' ' + 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?) // 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 // connectors are bad
InetAddress test = InetAddress.getByName(host); InetAddress test = InetAddress.getByName(host);
if ((!hasIPV6) && (!(test instanceof Inet4Address))) 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)) 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 // TODO if class not found use SslChannelConnector
// Sadly there's no common base class with the ssl methods in it // Sadly there's no common base class with the ssl methods in it
SslSelectChannelConnector ssll = new SslSelectChannelConnector(); SslSelectChannelConnector ssll = new SslSelectChannelConnector();
@ -379,8 +393,9 @@ public class RouterConsoleRunner {
ssll.setName("ConsoleSocket"); // all with same name will use the same thread pool ssll.setName("ConsoleSocket"); // all with same name will use the same thread pool
_server.addConnector(ssll); _server.addConnector(ssll);
boundAddresses++; 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("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); I2PAppContext.getGlobalContext().portMapper().register(PortMapper.SVC_HTTPS_CONSOLE,sslPort);

View File

@ -72,7 +72,7 @@ public class SearchHelper extends HelperBase {
} }
} }
StringBuilder buf = new StringBuilder(1024); 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()) { for (String name : _engines.keySet()) {
buf.append("<option value=\"").append(name).append('\"'); buf.append("<option value=\"").append(name).append('\"');
if (name.equals(dflt)) if (name.equals(dflt))

View File

@ -32,7 +32,10 @@
</div> </div>
</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"> <div class="langbox" id="langbox">
<a href="/home?lang=en&amp;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=en&amp;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&amp;consoleNonce=<%=consoleNonce%>"><img height="11" width="16" style="padding: 0 2px;" src="/flags.jsp?c=lang_ar" title="عربية" alt="عربية"></a> <a href="/home?lang=ar&amp;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> </div>
<h2 class="app"><%=intl._("Welcome to I2P")%></h2> <h2 class="app"><%=intl._("Welcome to I2P")%></h2>
</div> </div>
<% } // shouldShowWelcome %>
<div class="news" id="news"> <div class="news" id="news">
<jsp:useBean class="net.i2p.router.web.NewsHelper" id="newshelper" scope="request" /> <jsp:useBean class="net.i2p.router.web.NewsHelper" id="newshelper" scope="request" />
@ -63,7 +67,6 @@
if (newshelper.shouldShowNews()) { if (newshelper.shouldShowNews()) {
java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml"); 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="page" value="<%=fpath.getAbsolutePath()%>" />
<jsp:setProperty name="newshelper" property="maxLines" value="300" /> <jsp:setProperty name="newshelper" property="maxLines" value="300" />
<jsp:getProperty name="newshelper" property="content" /> <jsp:getProperty name="newshelper" property="content" />
@ -80,11 +83,9 @@
<div class="search"> <div class="search">
<form action="/search.jsp" method="POST"> <form action="/search.jsp" method="POST">
<table class="search"><tr><td align="right"> <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"> </td><td align="left">
<button type="submit" value="search" class="search"><%=intl._("Search I2P")%></button> <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"> </td><td align="left">
<jsp:useBean class="net.i2p.router.web.SearchHelper" id="searchhelper" scope="request" /> <jsp:useBean class="net.i2p.router.web.SearchHelper" id="searchhelper" scope="request" />
<jsp:setProperty name="searchhelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" /> <jsp:setProperty name="searchhelper" property="contextId" value="<%=(String)session.getAttribute(\"i2p.contextId\")%>" />
@ -92,8 +93,6 @@
</td></tr></table> </td></tr></table>
</form> </form>
</div> </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"> <div class="ag2">
<h4 class="app"><%=intl._("Eepsites of Interest")%></h4> <h4 class="app"><%=intl._("Eepsites of Interest")%></h4>
<jsp:getProperty name="homehelper" property="favorites" /><br> <jsp:getProperty name="homehelper" property="favorites" /><br>

View File

@ -1,8 +1,14 @@
2012-03-12 zzz
* Console:
- Better IPv6 test, hopefully will work on Windows
- Hide home page flags once language is selected
- Home page shrinkage and other CSS tweaks
2012-03-11 zzz 2012-03-11 zzz
* Build: * Build:
- Include old commons logging classes in commons-logging.jar - Include old commons logging classes in commons-logging.jar
- Preserve manifests in Jetty/Tomcat jars - Preserve manifests in Jetty/Tomcat jars
* Jetty Logger: Promote warns to erros when a Throwable is the second arg * Jetty Logger: Promote warns to errors when a Throwable is the second arg
2012-03-11 sponge 2012-03-11 sponge
* fix broken comment in jetty.xml * fix broken comment in jetty.xml

View File

@ -319,9 +319,9 @@ div.main {
width: auto; width: auto;
min-width: 500px; min-width: 500px;
border: 1px solid #447; border: 1px solid #447;
-moz-border-radius: 4px; -moz-border-radius: 8px;
-khtml-border-radius: 4px; -khtml-border-radius: 8px;
border-radius: 4px; border-radius: 8px;
-moz-box-shadow: inset 0px 0px 1px 1px #bbf; -moz-box-shadow: inset 0px 0px 1px 1px #bbf;
-khtml-box-shadow: inset 0px 0px 1px 1px #bbf; -khtml-box-shadow: inset 0px 0px 1px 1px #bbf;
box-shadow: inset 0px 0px 1px 1px #bbf; box-shadow: inset 0px 0px 1px 1px #bbf;
@ -351,16 +351,16 @@ div.news {
padding: 7px 20px 7px 20px; padding: 7px 20px 7px 20px;
border: 1px solid #447; border: 1px solid #447;
color: #224; color: #224;
border-radius: 4px; border-radius: 8px;
-moz-border-radius: 4px; -moz-border-radius: 8px;
-khtml-border-radius: 4px; -khtml-border-radius: 8px;
text-align: right !important; text-align: right !important;
font-size: 7.5pt; font-size: 7.5pt;
line-height: 140%; line-height: 140%;
-moz-box-shadow: inset 0px 0px 1px 1px #bbf; -moz-box-shadow: inset 0px 0px 1px 1px #bbf;
-khtml-box-shadow: inset 0px 0px 1px 1px #bbf; -khtml-box-shadow: inset 0px 0px 1px 1px #bbf;
box-shadow: inset 0px 0px 1px 1px #bbf; box-shadow: inset 0px 0px 1px 1px #bbf;
background: #f0f0f0; background: #f0f0f0 url("/themes/snark/ubergine/images/hat.png") no-repeat scroll right bottom;
min-width: 490px; min-width: 490px;
} }
@ -599,39 +599,39 @@ td {
border-bottom: 1px outset #99f; border-bottom: 1px outset #99f;
} }
/***********************************************************************************/ /* begin home page */
#appsummary { #appsummary {
margin-top: 53px; margin-top: 0;
} }
h2.app { h2.app {
margin: 15px 10px 15px 0 !important; margin: 15px 10px 15px 207px !important;
} }
h4.app { h4.app {
clear: left; clear: left;
margin: 12px 4px; margin: 0 4px 2px 0;
padding: 20px 0 8px 0; padding: 10px 0 8px 0;
} }
div.app { div.app {
float: left; float: left;
padding: 8px; padding: 2px;
height: 100px; height: 84px;
width: 112px; width: 112px;
} }
div.appgroup { div.appgroup {
clear: left; clear: left;
margin: 4px 20px; margin: 0;
padding: 16px 8px; padding: 16px 8px;
width: auto; width: auto;
} }
div.search { div.search {
margin: 20px 20px 20px 240px; margin: 10px 10px 0 207px;
padding: 8px; padding: 8px 8px 0 8px;
width: auto; width: auto;
} }
@ -644,14 +644,14 @@ table.search {
} }
img.app { img.app {
height: 40px; height: 32px;
width: 40px; width: 32px;
padding: 8px; padding: 6px;
} }
img.app2p { img.app2p {
height: 48px; height: 40px;
padding: 3px 8px; padding: 3px 6px 0 6px;
} }
table.app { table.app {
@ -686,7 +686,7 @@ div.applabel {
text-align: center; text-align: center;
} }
/***********************************************************************************/ /* end home page */
tt { tt {
font: bold 8pt "Lucida Console", "DejaVu Sans Mono", Courier, mono; font: bold 8pt "Lucida Console", "DejaVu Sans Mono", Courier, mono;
@ -811,9 +811,9 @@ h1 {
white-space: normal; white-space: normal;
background: #f0f0f0; background: #f0f0f0;
border: 1px solid #447; border: 1px solid #447;
border-radius: 8px 8px 4px 4px; border-radius: 8px;
-moz-border-radius: 8px 8px 4px 4px; -moz-border-radius: 8px;
-khtml-border-radius: 8px 8px 4px 4px; -khtml-border-radius: 8px;
min-width: 500px; min-width: 500px;
} }

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 11; public final static long BUILD = 12;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";