diff --git a/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java index 709c4505ff..d5d702e8ff 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/NewsHelper.java @@ -16,7 +16,7 @@ public class NewsHelper extends ContentHelper { if (!news.exists()) _page = (new File(_context.getBaseDir(), "docs/initialNews/initialNews.xml")).getAbsolutePath(); return super.getContent(); - } + } /** @since 0.8.12 */ public boolean shouldShowNews() { diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java index a61e543cc8..84f1401021 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java @@ -3,6 +3,9 @@ package net.i2p.router.web; import java.io.File; import java.io.IOException; import java.io.Writer; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; import net.i2p.data.DataHelper; import net.i2p.router.RouterContext; @@ -12,6 +15,32 @@ import net.i2p.router.RouterContext; * */ public class SummaryBarRenderer { + // Commented out because broken. Replaced by if-elseif blob below. + /*static final Map ALL_SECTIONS; + static { + Map aMap = new HashMap();; + try { + aMap.put("HelpAndFAQ", SummaryBarRenderer.class.getMethod("renderHelpAndFAQHTML")); + aMap.put("I2PServices", SummaryBarRenderer.class.getMethod("renderI2PServicesHTML")); + aMap.put("I2PInternals", SummaryBarRenderer.class.getMethod("renderI2PInternalsHTML")); + aMap.put("General", SummaryBarRenderer.class.getMethod("renderGeneralHTML")); + aMap.put("ShortGeneral", SummaryBarRenderer.class.getMethod("renderShortGeneralHTML")); + aMap.put("NetworkReachability", SummaryBarRenderer.class.getMethod("renderNetworkReachabilityHTML")); + aMap.put("UpdateStatus", SummaryBarRenderer.class.getMethod("renderUpdateStatusHTML")); + aMap.put("RestartStatus", SummaryBarRenderer.class.getMethod("renderRestartStatusHTMLHTML")); + aMap.put("Peers", SummaryBarRenderer.class.getMethod("renderPeersHTML")); + aMap.put("FirewallAndReseedStatus", SummaryBarRenderer.class.getMethod("renderFirewallAndReseedStatusHTML")); + aMap.put("Bandwidth", SummaryBarRenderer.class.getMethod("renderBandwidthHTML")); + aMap.put("Tunnels", SummaryBarRenderer.class.getMethod("renderTunnelsHTML")); + aMap.put("Congestion", SummaryBarRenderer.class.getMethod("renderCongestionHTML")); + aMap.put("TunnelStatus", SummaryBarRenderer.class.getMethod("renderTunnelStatusHTML")); + aMap.put("Destinations", SummaryBarRenderer.class.getMethod("renderDestinationsHTML")); + aMap.put("NewsHeadings", SummaryBarRenderer.class.getMethod("renderNewsHeadingsHTML")); + } catch (java.lang.NoSuchMethodException e) { + } + ALL_SECTIONS = Collections.unmodifiableMap(aMap); + }*/ + private final RouterContext _context; private final SummaryHelper _helper; @@ -26,147 +55,188 @@ public class SummaryBarRenderer { */ public void renderSummaryHTML(Writer out) throws IOException { StringBuilder buf = new StringBuilder(8*1024); - String theme = _context.getProperty(CSSHelper.PROP_THEME_NAME, CSSHelper.DEFAULT_THEME); - - // TODO - the bar would render more cleanly if we specified the img height and width here, - // but unfortunately the images in the different themes are different sizes. - // They range in height from 37 to 43 px. But there's a -2 bottom margin... - // So put it in a div. - buf.append("
\"")

") - - .append("

" + i + "
\n" + section); + } + } catch (Exception e) { + out.write("
" +i + " - Exception
\n" + e); + }*/ + buf.setLength(0); + + String section = sections[i]; + + buf.append("
\n"); + if ("HelpAndFAQ".equals(section)) + buf.append(renderHelpAndFAQHTML()); + else if ("I2PServices".equals(section)) + buf.append(renderI2PServicesHTML()); + else if ("I2PInternals".equals(section)) + buf.append(renderI2PInternalsHTML()); + else if ("General".equals(section)) + buf.append(renderGeneralHTML()); + else if ("ShortGeneral".equals(section)) + buf.append(renderShortGeneralHTML()); + else if ("NetworkReachability".equals(section)) + buf.append(renderNetworkReachabilityHTML()); + else if ("UpdateStatus".equals(section)) + buf.append(renderUpdateStatusHTML()); + else if ("RestartStatus".equals(section)) + buf.append(renderRestartStatusHTML()); + else if ("Peers".equals(section)) + buf.append(renderPeersHTML()); + else if ("FirewallAndReseedStatus".equals(section)) + buf.append(renderFirewallAndReseedStatusHTML()); + else if ("Bandwidth".equals(section)) + buf.append(renderBandwidthHTML()); + else if ("Tunnels".equals(section)) + buf.append(renderTunnelsHTML()); + else if ("Congestion".equals(section)) + buf.append(renderCongestionHTML()); + else if ("TunnelStatus".equals(section)) + buf.append(renderTunnelStatusHTML()); + else if ("Destinations".equals(section)) + buf.append(renderDestinationsHTML()); + else if ("NewsHeadings".equals(section)) + buf.append(renderNewsHeadingsHTML()); + + // Only output section if there's more than the
to print + if (buf.length() > 5) + out.write(buf.toString()); + } + } + + public String renderHelpAndFAQHTML() { + StringBuilder buf = new StringBuilder(512); + buf.append("

") .append(_("Help & FAQ")) - .append("


"); + .append("

"); + return buf.toString(); + } - File lpath = new File(_context.getBaseDir(), "docs/toolbar.html"); - // you better have target="_top" for the links in there... - if (lpath.exists()) { - ContentHelper linkhelper = new ContentHelper(); - linkhelper.setPage(lpath.getAbsolutePath()); - linkhelper.setMaxLines("100"); - buf.append(linkhelper.getContent()); - } else { - buf.append("

") - .append(_("I2P Services")) - .append("

\n" + + public String renderI2PServicesHTML() { + StringBuilder buf = new StringBuilder(512); + buf.append("

") + .append(_("I2P Services")) + .append("

\n" + - "
" + + "
" + - "") - .append(_("Email")) - .append("\n" + + "") + .append(_("Email")) + .append("\n" + - "") - .append(_("Torrents")) - .append("\n" + + "") + .append(_("Torrents")) + .append("\n" + - "") - .append(_("Website")) - .append("\n") + "") + .append(_("Website")) + .append("\n") - .append(NavHelper.getClientAppLinks(_context)) + .append(NavHelper.getClientAppLinks(_context)) - .append("
\n" + + .append("
\n"); + return buf.toString(); + } - "

") - .append(_("I2P Internals")) - .append("


\n" + + public String renderI2PInternalsHTML() { + StringBuilder buf = new StringBuilder(512); + buf.append("

") + .append(_("I2P Internals")) + .append("


\n" + - "
\n" + + "
\n" + - "") - .append(_("Tunnels")) - .append("\n" + + "") + .append(_("Tunnels")) + .append("\n" + - "") - .append(_("Peers")) - .append("\n" + + "") + .append(_("Peers")) + .append("\n" + - "") - .append(_("Profiles")) - .append("\n" + + "") + .append(_("Profiles")) + .append("\n" + - "") - .append(_("NetDB")) - .append("\n" + + "") + .append(_("NetDB")) + .append("\n" + - "") - .append(_("Logs")) - .append("\n"); + "") + .append(_("Logs")) + .append("\n"); - // "") - // .append(_("Jobs")) - // .append("\n" + + // "") + // .append(_("Jobs")) + // .append("\n" + - if (!StatSummarizer.isDisabled()) { - buf.append("") .append(_("Graphs")) .append("\n"); - } - - buf.append("") - .append(_("Stats")) - .append("\n" + - - "") - .append(_("I2PTunnel")) - .append("\n" + - - "") - .append(_("Addressbook")) - .append("\n"); - - File javadoc = new File(_context.getBaseDir(), "docs/javadoc/index.html"); - if (javadoc.exists()) - buf.append("Javadoc\n"); - buf.append("
\n"); - - out.write(buf.toString()); - buf.setLength(0); } + buf.append("") + .append(_("Stats")) + .append("\n" + + "") + .append(_("I2PTunnel")) + .append("\n" + - buf.append("

") + .append(_("Addressbook")) + .append("\n"); + + File javadoc = new File(_context.getBaseDir(), "docs/javadoc/index.html"); + if (javadoc.exists()) + buf.append("Javadoc\n"); + buf.append("

\n"); + return buf.toString(); + } + + public String renderGeneralHTML() { + if (_helper == null) return ""; + StringBuilder buf = new StringBuilder(512); + buf.append("

") .append(_("General")) @@ -202,24 +272,64 @@ public class SummaryBarRenderer { .append(":" + "") .append(_helper.getUptime()) - .append("\n" + + .append("\n"); + return buf.toString(); + } - "

" + + "") + .append(_("Version")) + .append(":" + + "") + .append(_helper.getVersion()) + .append("\n" + + + "" + + "") + .append(_("Uptime")) + .append(":" + + "") + .append(_helper.getUptime()) + .append("\n"); + return buf.toString(); + } + + public String renderNetworkReachabilityHTML() { + if (_helper == null) return ""; + StringBuilder buf = new StringBuilder(512); + buf.append("

") .append(_("Network")) .append(": ") .append(_helper.getReachability()) - .append("


\n") + .append("

\n"); + return buf.toString(); + } + public String renderUpdateStatusHTML() { + if (_helper == null) return ""; + StringBuilder buf = new StringBuilder(512); + buf.append(_helper.getUpdateStatus()); + return buf.toString(); + } - .append(_helper.getUpdateStatus()) + public String renderRestartStatusHTML() { + if (_helper == null) return ""; + StringBuilder buf = new StringBuilder(512); + buf.append(_helper.getRestartStatus()); + return buf.toString(); + } - - .append(_helper.getRestartStatus()) - - - .append("

") .append(_("Peers")) @@ -260,14 +370,20 @@ public class SummaryBarRenderer { .append(_helper.getAllPeers()) .append("\n" + - "
\n"); - - - out.write(buf.toString()); - buf.setLength(0); + "\n"); + return buf.toString(); + } + public String renderFirewallAndReseedStatusHTML() { + if (_helper == null) return ""; + StringBuilder buf = new StringBuilder(512); buf.append(_helper.getFirewallAndReseedStatus()); + return buf.toString(); + } + public String renderBandwidthHTML() { + if (_helper == null) return ""; + StringBuilder buf = new StringBuilder(512); buf.append("

") @@ -303,9 +419,16 @@ public class SummaryBarRenderer { .append(_helper.getInboundTransferred()) .append(SummaryHelper.THINSP) .append(_helper.getOutboundTransferred()) - .append("\n" + + .append("\n" + - "

\n"); + return buf.toString(); + } + + public String renderTunnelsHTML() { + if (_helper == null) return ""; + StringBuilder buf = new StringBuilder(512); + buf.append("

") .append(_("Tunnels")) @@ -336,7 +459,14 @@ public class SummaryBarRenderer { .append(_helper.getShareRatio()) .append("\n" + - "

\n"); + return buf.toString(); + } + + public String renderCongestionHTML() { + if (_helper == null) return ""; + StringBuilder buf = new StringBuilder(512); + buf.append("

") .append(_("Congestion")) @@ -369,16 +499,74 @@ public class SummaryBarRenderer { .append(_helper.getInboundBacklog()) .append("\n" + - "

") + "\n"); + return buf.toString(); + } + + public String renderTunnelStatusHTML() { + if (_helper == null) return ""; + StringBuilder buf = new StringBuilder(50); + buf.append("

") .append(_(_helper.getTunnelStatus())) - .append("


\n") + .append("

\n"); + return buf.toString(); + } - .append(_helper.getDestinations()) - .append("
\n"); + public String renderDestinationsHTML() { + if (_helper == null) return ""; + StringBuilder buf = new StringBuilder(512); + buf.append(_helper.getDestinations()); + return buf.toString(); + } - - - out.write(buf.toString()); + /** @since 0.9.1 */ + public String renderNewsHeadingsHTML() { + if (_helper == null) return ""; + NewsHelper newshelper = _helper.getNewsHelper(); + if (newshelper == null || newshelper.shouldShowNews()) return ""; + StringBuilder buf = new StringBuilder(512); + String consoleNonce = System.getProperty("router.consoleNonce"); + if (consoleNonce != null) { + // Set up title and pre-headings stuff. + buf.append("

") + .append(_("News & Updates")) + .append("


\n"); + // Get news content. + String newsContent = newshelper.getContent(); + if (newsContent != "") { + buf.append("
    \n"); + // Parse news content for headings. + int start = newsContent.indexOf("

    "); + while (start >= 0) { + // Add offset to start: + // 4 - gets rid of

    + // 16 - gets rid of the date as well (assuming form "

    yyyy-mm-dd: Foobarbaz...") + newsContent = newsContent.substring(start+16, newsContent.length()); + int end = newsContent.indexOf("

    "); + if (end >= 0) { + String heading = newsContent.substring(0, end); + buf.append("
  • ") + .append(heading) + .append("
  • \n"); + } + start = newsContent.indexOf("

    "); + } + buf.append("

\n"); + // Set up string containing to show news. + buf.append("") + .append(_("Show news")) + .append("\n"); + } else { + buf.append("
") + .append(_("none")) + .append("
"); + } + // Add post-headings stuff. + buf.append("
\n"); + } + return buf.toString(); } /** translate a string */ diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index 4e7d2f23fb..32d3b2bbc6 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -35,6 +35,35 @@ public class SummaryHelper extends HelperBase { // Opera 10.63 doesn't have the char, TODO check UA //static final String THINSP = " / "; static final String THINSP = " / "; + private static final char S = ','; + static final String PROP_SUMMARYBAR = "routerconsole.summaryBar"; + + static final String PRESET_FULL = + "HelpAndFAQ" + S + + "I2PServices" + S + + "I2PInternals" + S + + "General" + S + + "NetworkReachability" + S + + "UpdateStatus" + S + + "RestartStatus" + S + + "Peers" + S + + "FirewallAndReseedStatus" + S + + "Bandwidth" + S + + "Tunnels" + S + + "Congestion" + S + + "TunnelStatus" + S + + "Destinations" + S + + ""; + + static final String PRESET_SHORT = + "ShortGeneral" + S + + "NewsHeadings" + S + + "UpdateStatus" + S + + "NetworkReachability" + S + + "FirewallAndReseedStatus" + S + + "Destinations" + S + + "RestartStatus" + S + + ""; /** * Retrieve the shortened 4 character ident for the router located within @@ -651,7 +680,7 @@ public class SummaryHelper extends HelperBase { .append(_("Download Unsigned
Update {0}", getUnsignedUpdateVersion())) .append("
\n"); } - buf.append("\n"); + buf.append("
\n"); } } return buf.toString(); @@ -710,6 +739,22 @@ public class SummaryHelper extends HelperBase { return buf.toString(); } + private NewsHelper _newshelper; + public void storeNewsHelper(NewsHelper n) { _newshelper = n; } + public NewsHelper getNewsHelper() { return _newshelper; } + + public String[] getSummaryBarSections() { + String config = _context.getProperty(PROP_SUMMARYBAR, PRESET_FULL); + return config.split("" + S); + } + + public void saveSummaryBarSections(String[] sections) { + StringBuilder buf = new StringBuilder(512); + for(int i = 0; i < sections.length; i++) + buf.append(sections[i]).append(S); + _context.router().saveConfig(PROP_SUMMARYBAR, buf.toString()); + } + /** output the summary bar to _out */ public void renderSummaryBar() throws IOException { SummaryBarRenderer renderer = new SummaryBarRenderer(_context, this); diff --git a/apps/routerconsole/jsp/config.jsp b/apps/routerconsole/jsp/config.jsp index 70c0e64f00..9cc6f81a4d 100644 --- a/apps/routerconsole/jsp/config.jsp +++ b/apps/routerconsole/jsp/config.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("configure bandwidth")%> - + + + <%@include file="summary.jsi" %> diff --git a/apps/routerconsole/jsp/configadvanced.jsp b/apps/routerconsole/jsp/configadvanced.jsp index 1dbf23e7d4..27405c0c4c 100644 --- a/apps/routerconsole/jsp/configadvanced.jsp +++ b/apps/routerconsole/jsp/configadvanced.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("config advanced")%> - + + + <%@include file="summary.jsi" %> diff --git a/apps/routerconsole/jsp/configclients.jsp b/apps/routerconsole/jsp/configclients.jsp index c8575b490f..0662afffef 100644 --- a/apps/routerconsole/jsp/configclients.jsp +++ b/apps/routerconsole/jsp/configclients.jsp @@ -10,7 +10,14 @@ button span.hide{ display:none; } input.default { width: 1px; height: 1px; visibility: hidden; } - + + + + <%@include file="summary.jsi" %> diff --git a/apps/routerconsole/jsp/confighome.jsp b/apps/routerconsole/jsp/confighome.jsp index ca0dbdc6c3..5ddf6f2005 100644 --- a/apps/routerconsole/jsp/confighome.jsp +++ b/apps/routerconsole/jsp/confighome.jsp @@ -12,7 +12,13 @@ input.default { visibility: hidden; } - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Home Page Configuration")%>

diff --git a/apps/routerconsole/jsp/configkeyring.jsp b/apps/routerconsole/jsp/configkeyring.jsp index 7acdf1126f..2719fe3335 100644 --- a/apps/routerconsole/jsp/configkeyring.jsp +++ b/apps/routerconsole/jsp/configkeyring.jsp @@ -5,7 +5,13 @@ <%@include file="css.jsi" %> <%=intl.title("config keyring")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Keyring Configuration")%>

diff --git a/apps/routerconsole/jsp/configlogging.jsp b/apps/routerconsole/jsp/configlogging.jsp index 8274fcb438..d00d34321e 100644 --- a/apps/routerconsole/jsp/configlogging.jsp +++ b/apps/routerconsole/jsp/configlogging.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("config logging")%> - + + + " /> diff --git a/apps/routerconsole/jsp/confignet.jsp b/apps/routerconsole/jsp/confignet.jsp index 6e340a6592..e85c9e6df9 100644 --- a/apps/routerconsole/jsp/confignet.jsp +++ b/apps/routerconsole/jsp/confignet.jsp @@ -5,7 +5,13 @@ <%@include file="css.jsi" %> <%=intl.title("config networking")%> - + + + <%@include file="summary.jsi" %> diff --git a/apps/routerconsole/jsp/configpeer.jsp b/apps/routerconsole/jsp/configpeer.jsp index b5968abedc..0f9b98a21b 100644 --- a/apps/routerconsole/jsp/configpeer.jsp +++ b/apps/routerconsole/jsp/configpeer.jsp @@ -5,7 +5,13 @@ <%@include file="css.jsi" %> <%=intl.title("config peers")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Peer Configuration")%>

diff --git a/apps/routerconsole/jsp/configreseed.jsp b/apps/routerconsole/jsp/configreseed.jsp index 67d2334c91..c0f3faaaed 100644 --- a/apps/routerconsole/jsp/configreseed.jsp +++ b/apps/routerconsole/jsp/configreseed.jsp @@ -5,7 +5,13 @@ <%@include file="css.jsi" %> <%=intl.title("config reseeding")%> - + + + <%@include file="summary.jsi" %> diff --git a/apps/routerconsole/jsp/configservice.jsp b/apps/routerconsole/jsp/configservice.jsp index 3ee1ef7967..21ae39a6bf 100644 --- a/apps/routerconsole/jsp/configservice.jsp +++ b/apps/routerconsole/jsp/configservice.jsp @@ -5,7 +5,13 @@ <%@include file="css.jsi" %> <%=intl.title("config service")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Service Configuration")%>

diff --git a/apps/routerconsole/jsp/configstats.jsp b/apps/routerconsole/jsp/configstats.jsp index d380d77839..6d75d673cc 100644 --- a/apps/routerconsole/jsp/configstats.jsp +++ b/apps/routerconsole/jsp/configstats.jsp @@ -6,10 +6,17 @@ <%@include file="css.jsi" %> <%=intl.title("config stats")%> + + + + <%@include file="summary.jsi" %> diff --git a/apps/routerconsole/jsp/configui.jsp b/apps/routerconsole/jsp/configui.jsp index 4a214c8524..c5b8c4d81a 100644 --- a/apps/routerconsole/jsp/configui.jsp +++ b/apps/routerconsole/jsp/configui.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("config UI")%> - + + + <%@include file="summary.jsi" %> diff --git a/apps/routerconsole/jsp/configupdate.jsp b/apps/routerconsole/jsp/configupdate.jsp index e2bd49ab27..dafac8d45e 100644 --- a/apps/routerconsole/jsp/configupdate.jsp +++ b/apps/routerconsole/jsp/configupdate.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("config update")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Update Configuration")%>

diff --git a/apps/routerconsole/jsp/console.jsp b/apps/routerconsole/jsp/console.jsp index 74e994bbbc..b9688aa0ec 100644 --- a/apps/routerconsole/jsp/console.jsp +++ b/apps/routerconsole/jsp/console.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("home")%> - + + + <% String consoleNonce = System.getProperty("router.consoleNonce"); if (consoleNonce == null) { @@ -15,16 +21,13 @@ } %> -<%@include file="summary.jsi" %>

<%=intl._("I2P Router Console")%>

+<%@include file="summary.jsi" %> + +

<%=intl._("I2P Router Console")%>

- - " /> <% if (newshelper.shouldShowNews()) { - java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml"); %> - -
<% diff --git a/apps/routerconsole/jsp/debug.jsp b/apps/routerconsole/jsp/debug.jsp index b9e66345f6..191d73e185 100644 --- a/apps/routerconsole/jsp/debug.jsp +++ b/apps/routerconsole/jsp/debug.jsp @@ -9,7 +9,13 @@ %> I2P Router Console - Debug <%@include file="css.jsi" %> - + + + <%@include file="summary.jsi" %>

Router SKM

diff --git a/apps/routerconsole/jsp/error.jsp b/apps/routerconsole/jsp/error.jsp index 69f9fbfa31..95218cc535 100644 --- a/apps/routerconsole/jsp/error.jsp +++ b/apps/routerconsole/jsp/error.jsp @@ -16,7 +16,13 @@ <%@include file="css.jsi" %> <%=intl.title("Page Not Found")%> - + + + <%@include file="summary.jsi" %>

<%=ERROR_CODE%> <%=ERROR_MESSAGE%>

diff --git a/apps/routerconsole/jsp/graph.jsp b/apps/routerconsole/jsp/graph.jsp index 6147fd96d0..4be37b3394 100644 --- a/apps/routerconsole/jsp/graph.jsp +++ b/apps/routerconsole/jsp/graph.jsp @@ -12,7 +12,13 @@ <% graphHelper.storeWriter(out); %> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Performance Graphs")%>

diff --git a/apps/routerconsole/jsp/graphs.jsp b/apps/routerconsole/jsp/graphs.jsp index 4b65cca75c..e3287e98c8 100644 --- a/apps/routerconsole/jsp/graphs.jsp +++ b/apps/routerconsole/jsp/graphs.jsp @@ -19,7 +19,13 @@ out.print(graphHelper.getRefreshMeta()); } %> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Performance Graphs")%>

diff --git a/apps/routerconsole/jsp/help.jsp b/apps/routerconsole/jsp/help.jsp index 265bbfb628..8c68cb5e9a 100644 --- a/apps/routerconsole/jsp/help.jsp +++ b/apps/routerconsole/jsp/help.jsp @@ -9,7 +9,13 @@ %> I2P Router Console - help <%@include file="css.jsi" %> - + + + <%@include file="summary.jsi" %>

I2P Router Help & Support

diff --git a/apps/routerconsole/jsp/help_ar.jsp b/apps/routerconsole/jsp/help_ar.jsp index 4b471f594f..7e058678fa 100644 --- a/apps/routerconsole/jsp/help_ar.jsp +++ b/apps/routerconsole/jsp/help_ar.jsp @@ -9,7 +9,13 @@ %> I2P مساعدة لوحة التحكم <%@include file="css.jsi" %> - + + + <%@include file="summary.jsi" %>

I2P مساعدة لوحة التحكم

diff --git a/apps/routerconsole/jsp/help_fr.jsp b/apps/routerconsole/jsp/help_fr.jsp index fd0f8bc268..01b000ac9b 100644 --- a/apps/routerconsole/jsp/help_fr.jsp +++ b/apps/routerconsole/jsp/help_fr.jsp @@ -9,7 +9,13 @@ %> Console du routeur I2P - Aide <%@include file="css.jsi" %> - + + + <%@include file="summary.jsi" %> Traduction de mars 2011 (magma@mail.i2p)

Aide et assistance du routeur I2P

diff --git a/apps/routerconsole/jsp/help_nl.jsp b/apps/routerconsole/jsp/help_nl.jsp index 944e65e7b9..20defacaa9 100644 --- a/apps/routerconsole/jsp/help_nl.jsp +++ b/apps/routerconsole/jsp/help_nl.jsp @@ -9,7 +9,13 @@ %> I2P Router Console - help <%@include file="css.jsi" %> - + + + <%@include file="summary.jsi" %>

I2P Router Help & Support

diff --git a/apps/routerconsole/jsp/help_ru.jsp b/apps/routerconsole/jsp/help_ru.jsp index d14da01386..55ea530c7d 100644 --- a/apps/routerconsole/jsp/help_ru.jsp +++ b/apps/routerconsole/jsp/help_ru.jsp @@ -9,7 +9,13 @@ %> Консоль маршрутизатора I2P - справка <%@include file="css.jsi" %> - + + + <%@include file="summary.jsi" %>

Справка маршрутизатора I2P

diff --git a/apps/routerconsole/jsp/home.jsp b/apps/routerconsole/jsp/home.jsp index bd60d184d6..3bd3451519 100644 --- a/apps/routerconsole/jsp/home.jsp +++ b/apps/routerconsole/jsp/home.jsp @@ -6,9 +6,9 @@ <%=intl.title("home")%> <% @@ -20,6 +20,11 @@ %> " /> +<% + java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml"); +%> + + " /> @@ -28,19 +33,10 @@ -
<%@include file="xhr1.jsi" %>
-<% - if (!newshelper.shouldShowNews()) { -%> -

<%=intl._("News")%>


- -<% - } // !shouldShowNews() -%>
@@ -48,11 +44,8 @@ <% if (newshelper.shouldShowNews()) { - java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml"); %>
- -

diff --git a/apps/routerconsole/jsp/jars.jsp b/apps/routerconsole/jsp/jars.jsp index 4fa200b70b..dacd3d93fa 100644 --- a/apps/routerconsole/jsp/jars.jsp +++ b/apps/routerconsole/jsp/jars.jsp @@ -5,7 +5,13 @@ <%@include file="css.jsi" %> <%=intl.title("Jar File Dump")%> - + + + <%@include file="summary.jsi" %>

Jar File Dump

diff --git a/apps/routerconsole/jsp/jobs.jsp b/apps/routerconsole/jsp/jobs.jsp index 2e2e712484..247fa298ef 100644 --- a/apps/routerconsole/jsp/jobs.jsp +++ b/apps/routerconsole/jsp/jobs.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("job queue")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Router Job Queue")%>

diff --git a/apps/routerconsole/jsp/logs.jsp b/apps/routerconsole/jsp/logs.jsp index 373e386ebd..ed4b5c1216 100644 --- a/apps/routerconsole/jsp/logs.jsp +++ b/apps/routerconsole/jsp/logs.jsp @@ -5,7 +5,13 @@ <%@include file="css.jsi" %> <%=intl.title("logs")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Router Logs")%>

@@ -33,8 +39,10 @@

<%=intl._("Note that system information, log timestamps, and log messages may provide clues to your location; please review everything you include in a bug report.")%>

<%=intl._("Critical Logs")%>

+

<%=intl._("Router Logs")%> (<%=intl._("configure")%>)

+

<%=intl._("Service (Wrapper) Logs")%>


diff --git a/apps/routerconsole/jsp/netdb.jsp b/apps/routerconsole/jsp/netdb.jsp index 1a7a429991..af661c2043 100644 --- a/apps/routerconsole/jsp/netdb.jsp +++ b/apps/routerconsole/jsp/netdb.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("network database")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Network Database")%>

diff --git a/apps/routerconsole/jsp/nowebapp.jsp b/apps/routerconsole/jsp/nowebapp.jsp index f62ae6b162..c18b8e41af 100644 --- a/apps/routerconsole/jsp/nowebapp.jsp +++ b/apps/routerconsole/jsp/nowebapp.jsp @@ -7,7 +7,13 @@ <%@include file="css.jsi" %> <%=intl.title("WebApp Not Found")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("Web Application Not Running")%>

diff --git a/apps/routerconsole/jsp/oldconsole.jsp b/apps/routerconsole/jsp/oldconsole.jsp index 7edb762409..cb0c186630 100644 --- a/apps/routerconsole/jsp/oldconsole.jsp +++ b/apps/routerconsole/jsp/oldconsole.jsp @@ -9,7 +9,13 @@ %> I2P Router Console - internals <%@include file="css.jsi" %> - + + + <%@include file="summary.jsi" %> " /> diff --git a/apps/routerconsole/jsp/peers.jsp b/apps/routerconsole/jsp/peers.jsp index 6b0ed6b67b..e23e4f73b9 100644 --- a/apps/routerconsole/jsp/peers.jsp +++ b/apps/routerconsole/jsp/peers.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("peer connections")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Network Peers")%>

diff --git a/apps/routerconsole/jsp/profiles.jsp b/apps/routerconsole/jsp/profiles.jsp index 4c33bb1fea..5f149ec243 100644 --- a/apps/routerconsole/jsp/profiles.jsp +++ b/apps/routerconsole/jsp/profiles.jsp @@ -6,7 +6,14 @@ <%@include file="css.jsi" %> <%=intl.title("peer profiles")%> -<%@include file="summary.jsi" %> + + + +<%@include file="summary.jsi" %>

<%=intl._("I2P Network Peer Profiles")%>

diff --git a/apps/routerconsole/jsp/stats.jsp b/apps/routerconsole/jsp/stats.jsp index c0596f7961..5750fae1c1 100644 --- a/apps/routerconsole/jsp/stats.jsp +++ b/apps/routerconsole/jsp/stats.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("statistics")%> - + + + <%@include file="summary.jsi" %> " /> diff --git a/apps/routerconsole/jsp/summary.jsi b/apps/routerconsole/jsp/summary.jsi index 847e42d523..0eb9d77b0b 100644 --- a/apps/routerconsole/jsp/summary.jsi +++ b/apps/routerconsole/jsp/summary.jsi @@ -1,3 +1,10 @@ + +" /> +<% + java.io.File newspath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml"); +%> + +
<% // The refresh delay, 0 to disable @@ -15,7 +22,7 @@ newDelay = "?refresh=" + d; } if (!"0".equals(d)) - out.print("\n"); + out.print("
\n"); } else if (allowIFrame) { // since we don't have an iframe this will reload the base page, and // the new delay will be passed to the iframe above - out.print("
\n" + + out.print("
\n"); + "
\n"); } else { out.print("
\n"); } diff --git a/apps/routerconsole/jsp/summaryframe.jsp b/apps/routerconsole/jsp/summaryframe.jsp index bdd4a8cbc1..218e78ba6a 100644 --- a/apps/routerconsole/jsp/summaryframe.jsp +++ b/apps/routerconsole/jsp/summaryframe.jsp @@ -52,11 +52,18 @@ } %>
+ +" /> +<% + java.io.File newspath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml"); +%> + + <%@include file="summarynoframe.jsi" %> <% // d and shutdownSoon defined above if (!shutdownSoon) { - out.print("
\n"); + out.print("
\n
\n"); if ("0".equals(d)) { out.print(""); out.print(intl._("Refresh (s)")); diff --git a/apps/routerconsole/jsp/summarynoframe.jsi b/apps/routerconsole/jsp/summarynoframe.jsi index 63c39e6e54..6fae7c9016 100644 --- a/apps/routerconsole/jsp/summarynoframe.jsi +++ b/apps/routerconsole/jsp/summarynoframe.jsi @@ -1,35 +1,17 @@ -<%@page import="net.i2p.router.web.SummaryHelper" %> <% /* - * Note: - * This is included almost 30 times, so keep whitespace etc. to a minimum. + * TODO - the bar would render more cleanly if we specified the img height and width here, + * but unfortunately the images in the different themes are different sizes. + * They range in height from 37 to 43 px. But there's a -2 bottom margin... + * So put it in a div. */ %> - -" /> -" /> -" /> -" /> - -<% helper.storeWriter(out); %> -<% -/* - * The following is required for the reseed button to work, although we probably - * only need the reseedNonce property. - */ -%> - - -<% -/* - * The following is required for the update buttons to work, although we probably - * only need the updateNonce property. - */ -%> - - -" /> -<% - // moved to java for ease of translation and to avoid 30 copies - helper.renderSummaryBar(); -%> + +
+ +<%@include file="xhr1.jsi" %> +
diff --git a/apps/routerconsole/jsp/tunnels.jsp b/apps/routerconsole/jsp/tunnels.jsp index 32f86475ae..332381a95a 100644 --- a/apps/routerconsole/jsp/tunnels.jsp +++ b/apps/routerconsole/jsp/tunnels.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("tunnel summary")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("I2P Tunnel Summary")%>

diff --git a/apps/routerconsole/jsp/viewprofile.jsp b/apps/routerconsole/jsp/viewprofile.jsp index 8747a6d88b..635aafb348 100644 --- a/apps/routerconsole/jsp/viewprofile.jsp +++ b/apps/routerconsole/jsp/viewprofile.jsp @@ -6,7 +6,13 @@ <%@include file="css.jsi" %> <%=intl.title("Peer Profile")%> - + + + <%@include file="summary.jsi" %>

<%=intl._("Peer Profile")%>

diff --git a/apps/routerconsole/jsp/xhr1.jsi b/apps/routerconsole/jsp/xhr1.jsi index a171d0c852..1362cca1f7 100644 --- a/apps/routerconsole/jsp/xhr1.jsi +++ b/apps/routerconsole/jsp/xhr1.jsi @@ -1,24 +1,41 @@ +<%@page import="net.i2p.router.web.SummaryHelper" %> +<% +/* + * Note: + * This is included on every refresh, so keep whitespace etc. to a minimum. + */ +%> " /> " /> -
<%=intl._("Version")%>: - -
<%=intl._("Uptime")%>: - -

" /> " /> <% String reqURI = request.getRequestURI(); if (reqURI != null) - reqURI = reqURI.replace("/xhr1.jsp", "/home"); + reqURI = reqURI.replace("/xhr1.jsp", "/"); helper.setRequestURI(reqURI); %> -

"><%=intl._("Network")%>: -

-
- - -
- - +<% helper.storeWriter(out); %> +<% helper.storeNewsHelper(newshelper); %> +<% +/* + * The following is required for the reseed button to work, although we probably + * only need the reseedNonce property. + */ +%> + + +<% +/* + * The following is required for the update buttons to work, although we probably + * only need the updateNonce property. + */ +%> + + +" /> +<% + // moved to java for ease of translation + helper.renderSummaryBar(); +%> diff --git a/apps/routerconsole/jsp/xhr1.jsp b/apps/routerconsole/jsp/xhr1.jsp index 95c27683b7..b48e824421 100644 --- a/apps/routerconsole/jsp/xhr1.jsp +++ b/apps/routerconsole/jsp/xhr1.jsp @@ -11,4 +11,11 @@ %> " /> + +" /> +<% + java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getRouterDir(), "docs/news.xml"); +%> + + <%@include file="xhr1.jsi" %> diff --git a/installer/resources/themes/console/dark/console.css b/installer/resources/themes/console/dark/console.css index acc5d6b9b5..2c32a68f34 100644 --- a/installer/resources/themes/console/dark/console.css +++ b/installer/resources/themes/console/dark/console.css @@ -170,6 +170,10 @@ div.routersummary h4 { line-height: 100%; } +div.routersummary ul { + text-align: left !important; +} + div.routersummary table { border: 0; text-align: center !important; @@ -227,6 +231,11 @@ div routersummary hr:last-child { margin-bottom: -5px !important; } +div.newsheadings { + text-align: right; + margin: 0 0 0 10px; +} + div.tunnels { padding-top: 3px !important; margin-left: -4px;