* Console:

- Summary bar tweaks
    - Config nav CSS tabs
    - CSS cleanups from last checkin
This commit is contained in:
zzz
2011-12-02 17:21:04 +00:00
parent 0a76a0db22
commit c9cccd7581
26 changed files with 197 additions and 133 deletions

View File

@ -3,6 +3,7 @@ package net.i2p.router.web;
import java.io.IOException;
/**
* Render the configuration menu at the top of all the config pages.
* refactored from confignav.jsp to reduce size and make translation easier
* @author zzz
*/
@ -19,20 +20,36 @@ public class ConfigNavHelper extends HelperBase {
_x("Clients"), _x("Peers"), _x("Keyring"), _x("Logging"), _x("Stats"),
_x("Reseeding"), _x("Advanced") };
public void renderNavBar(String requestURI) throws IOException {
/**
* @param graphical false for text-mode browsers
*/
public void renderNavBar(String requestURI, boolean graphical) throws IOException {
StringBuilder buf = new StringBuilder(1024);
// TODO fix up the non-light themes
String theme = _context.getProperty(CSSHelper.PROP_THEME_NAME);
boolean span = graphical && (theme == null || theme.equals(CSSHelper.DEFAULT_THEME));
if (!span)
buf.append("<center>");
for (int i = 0; i < pages.length; i++) {
String page = "config" + pages[i];
if (requestURI.endsWith(page) || requestURI.endsWith(page + ".jsp")) {
// we are there
if (span)
buf.append("<span class=\"tab2\">");
buf.append(_(titles[i]));
} else {
// we are not there, make a link
if (span)
buf.append("<span class=\"tab\">");
buf.append("<a href=\"").append(page).append("\">").append(_(titles[i])).append("</a>");
}
if (i != pages.length - 1)
if (span)
buf.append(" </span>\n");
else if (i != pages.length - 1)
buf.append(" |\n");
}
if (!span)
buf.append("</center>");
_out.write(buf.toString());
}
}

View File

@ -61,31 +61,25 @@ public class SummaryBarRenderer {
.append(_("I2P Services"))
.append("</a></h3>\n" +
"<hr><table>" +
"<hr class=\"b\"><table><tr><td>" +
"<tr><td><a href=\"/susidns/index\" target=\"_blank\" title=\"")
.append(_("Manage your I2P hosts file here (I2P domain name resolution)"))
"<a href=\"/susimail/susimail\" target=\"blank\" title=\"")
.append(_("Anonymous webmail client"))
.append("\">")
.append(_("Addressbook"))
.append(_("Email"))
.append("</a>\n" +
"<a href=\"/i2psnark/\" target=\"_blank\" title=\"")
.append(_("Built-in anonymous BitTorrent Client"))
.append("\">")
.append(_("Torrents"))
.append("</a>\n" +
"<a href=\"/susimail/susimail\" target=\"blank\" title=\"")
.append(_("Anonymous webmail client"))
.append("\">")
.append(_("Webmail"))
.append("</a>\n" +
"<a href=\"http://127.0.0.1:7658/\" target=\"_blank\" title=\"")
.append(_("Anonymous resident webserver"))
.append(_("Local web server"))
.append("\">")
.append(_("Webserver"))
.append("</a>")
.append(_("Website"))
.append("</a>\n")
.append(NavHelper.getClientAppLinks(_context))
@ -95,7 +89,7 @@ public class SummaryBarRenderer {
.append(_("Configure I2P Router"))
.append("\">")
.append(_("I2P Internals"))
.append("</a></h3><hr>\n" +
.append("</a></h3><hr class=\"b\">\n" +
"<table><tr><td>\n" +
@ -153,6 +147,12 @@ public class SummaryBarRenderer {
.append(_("Local Destinations"))
.append("\">")
.append(_("I2PTunnel"))
.append("</a>\n" +
"<a href=\"/susidns/index\" target=\"_blank\" title=\"")
.append(_("Manage your I2P hosts file here (I2P domain name resolution)"))
.append("\">")
.append(_("Addressbook"))
.append("</a>\n");
File javadoc = new File(_context.getBaseDir(), "docs/javadoc/index.html");
@ -170,7 +170,7 @@ public class SummaryBarRenderer {
.append(_("I2P Router Help"))
.append("\">")
.append(_("General"))
.append("</a></h3><hr>\n" +
.append("</a></h3><hr class=\"b\">\n" +
"<table><tr>" +
"<td align=\"left\"><b>")
@ -262,7 +262,7 @@ public class SummaryBarRenderer {
.append(_("Show all current peer connections"))
.append("\">")
.append(_("Peers"))
.append("</a></h3><hr>\n" +
.append("</a></h3><hr class=\"b\">\n" +
"<table>\n" +
@ -311,7 +311,7 @@ public class SummaryBarRenderer {
buf.append("<h4><a href=\"/confignet\" target=\"_top\" title=\"")
.append(_("Help with firewall configuration"))
.append("\">")
.append(_("Check NAT/firewall"))
.append(_("Check network connection and NAT/firewall"))
.append("</a></h4>");
anotherLine = true;
}
@ -351,7 +351,7 @@ public class SummaryBarRenderer {
.append(_("Configure router bandwidth allocation"))
.append("\" target=\"_top\">")
.append(_("Bandwidth in/out"))
.append("</a></h3><hr>" +
.append("</a></h3><hr class=\"b\">" +
"<table>\n" +
"<tr><td align=\"left\"><b>")
@ -388,7 +388,7 @@ public class SummaryBarRenderer {
.append(_("View existing tunnels and tunnel build status"))
.append("\">")
.append(_("Tunnels"))
.append("</a></h3><hr>" +
.append("</a></h3><hr class=\"b\">" +
"<table>\n" +
"<tr><td align=\"left\"><b>")
@ -419,7 +419,7 @@ public class SummaryBarRenderer {
.append(_("What's in the router's job queue?"))
.append("\">")
.append(_("Congestion"))
.append("</a></h3><hr>" +
.append("</a></h3><hr class=\"b\">" +
"<table>\n" +
"<tr><td align=\"left\"><b>")

View File

@ -367,7 +367,7 @@ public class SummaryHelper extends HelperBase {
List<Destination> clients = new ArrayList(_context.clientManager().listClients());
StringBuilder buf = new StringBuilder(512);
buf.append("<h3><a href=\"/i2ptunnel/\" target=\"_blank\" title=\"").append(_("Add/remove/edit &amp; control your client and server tunnels")).append("\">").append(_("Local Destinations")).append("</a></h3><hr><div class=\"tunnels\">");
buf.append("<h3><a href=\"/i2ptunnel/\" target=\"_blank\" title=\"").append(_("Add/remove/edit &amp; control your client and server tunnels")).append("\">").append(_("Local Destinations")).append("</a></h3><hr class=\"b\"><div class=\"tunnels\">");
if (!clients.isEmpty()) {
Collections.sort(clients, new AlphaComparator());
buf.append("<table>");