diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java index 36730d0238..b59870e301 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java @@ -269,7 +269,7 @@ public class ConfigServiceHandler extends FormHandler { try { WrapperManager.requestThreadDump(); } catch (Throwable t) { - addFormError("Warning: unable to contact the service manager - " + t.getMessage()); + addFormError("Warning: unable to contact the service manager - " + t.getLocalizedMessage()); } File wlog = wrapperLogFile(_context); addFormNotice(_t("Threads dumped to {0}", wlog.getAbsolutePath())); @@ -327,7 +327,7 @@ public class ConfigServiceHandler extends FormHandler { Runtime.getRuntime().exec("install_i2p_service_winnt.bat"); addFormNotice(_t("Service installed")); } catch (IOException ioe) { - addFormError(_t("Warning: unable to install the service") + " - " + ioe.getMessage()); + addFormError(_t("Warning: unable to install the service") + " - " + ioe.getLocalizedMessage()); } } @@ -336,7 +336,7 @@ public class ConfigServiceHandler extends FormHandler { Runtime.getRuntime().exec("uninstall_i2p_service_winnt.bat"); addFormNotice(_t("Service removed")); } catch (IOException ioe) { - addFormError(_t("Warning: unable to remove the service") + " - " + ioe.getMessage()); + addFormError(_t("Warning: unable to remove the service") + " - " + ioe.getLocalizedMessage()); } } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java index ac66e9105d..68e62e05fc 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java @@ -90,7 +90,7 @@ class SummaryRenderer { ImageIO.write(img, "png", ios); } catch (RrdException re) { //_log.error("Error rendering " + filename, re); - throw new IOException("Error plotting: " + re.getMessage()); + throw new IOException("Error plotting: " + re.getLocalizedMessage()); } catch (IOException ioe) { //_log.error("Error rendering " + filename, ioe); throw ioe; @@ -307,7 +307,7 @@ class SummaryRenderer { // ); // + ", data written to " + t.getAbsolutePath()); } catch (RrdException re) { _log.error("Error rendering", re); - throw new IOException("Error plotting: " + re.getMessage()); + throw new IOException("Error plotting: " + re.getLocalizedMessage()); } catch (IOException ioe) { // typically org.mortbay.jetty.EofException extends java.io.EOFException if (_log.shouldLog(Log.WARN)) @@ -315,7 +315,7 @@ class SummaryRenderer { throw ioe; } catch (OutOfMemoryError oom) { _log.error("Error rendering", oom); - throw new IOException("Error plotting: " + oom.getMessage()); + throw new IOException("Error plotting: " + oom.getLocalizedMessage()); } finally { // this does not close the underlying stream if (ios != null) try {ios.close();} catch (IOException ioe) {} diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigClientsHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigClientsHandler.java index e05d91c093..bb1388c459 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigClientsHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigClientsHandler.java @@ -501,7 +501,7 @@ public class ConfigClientsHandler extends FormHandler { if (status != null && status.length() > 0) addFormNoticeNoEscape(status); } catch (IOException ioe) { - addFormError(_t("Install from file failed") + " - " + ioe.getMessage()); + addFormError(_t("Install from file failed") + " - " + ioe.getLocalizedMessage()); } finally { // it's really a ByteArrayInputStream but we'll play along... if (in != null) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigKeyringHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigKeyringHandler.java index 4dea3e408b..e7deebcdb9 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigKeyringHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigKeyringHandler.java @@ -163,7 +163,7 @@ public class ConfigKeyringHandler extends FormHandler { addFormNotice(_t("Send key to server opererator.") + ' ' + pk.toPublic().toBase64()); } } catch (IllegalArgumentException iae) { - addFormError(_t("Invalid destination") + ": " + iae.getMessage()); + addFormError(_t("Invalid destination") + ": " + iae.getLocalizedMessage()); } } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigReseedHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigReseedHandler.java index 0c4f96aea1..5f3dc09171 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigReseedHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigReseedHandler.java @@ -72,7 +72,7 @@ public class ConfigReseedHandler extends FormHandler { } } } catch (IllegalArgumentException iae) { - addFormError(_t("Bad URL {0}", val) + " - " + iae.getMessage()); + addFormError(_t("Bad URL {0}", val) + " - " + iae.getLocalizedMessage()); } } else if (_action.equals(_t("Reseed from file"))) { // inline diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/HomeHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/HomeHelper.java index df1ef4fd88..bfad2780c7 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/HomeHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/HomeHelper.java @@ -44,6 +44,7 @@ public class HomeHelper extends HelperBase { _x("Addressbook") + S + _x("Manage your I2P hosts file here (I2P domain name resolution)") + S + "/dns" + S + I + "book_addresses.png" + S + ""; + /** @since 0.9.44 */ static final String DEFAULT_CONFIG = _x("Configure Homepage") + S + _x("Configure the contents of this page") + S + "/confighome" + S + I + "info/home.png" + S + _x("Configure Bandwidth") + S + _x("I2P Bandwidth Configuration") + S + "/config" + S + I + "info/bandwidth.png" + S + @@ -92,6 +93,7 @@ public class HomeHelper extends HelperBase { ""; // No commas allowed in text strings! + /** @since 0.9.44 */ static final String DEFAULT_MONITORING = _x("Logs") + S + _x("View the logs") + S + "/logs" + S + I + "billiard_marker.png" + S + _x("Graphs") + S + _x("Visualize information about the router") + S + "/graphs" + S + I + "chart_line.png" + S + @@ -113,10 +115,12 @@ public class HomeHelper extends HelperBase { return homeTable(PROP_SERVICES, DEFAULT_SERVICES, plugins); } + /** @since 0.9.44 */ public String getConfig(){ return homeTable(PROP_CONFIG, DEFAULT_CONFIG, null); } + /** @since 0.9.44 */ public String getMonitoring(){ return homeTable(PROP_MONITORING, DEFAULT_MONITORING, null); } @@ -129,10 +133,12 @@ public class HomeHelper extends HelperBase { return configTable(PROP_SERVICES, DEFAULT_SERVICES); } + /** @since 0.9.44 */ public String getConfigConfig() { return configTable(PROP_CONFIG, DEFAULT_CONFIG); } + /** @since 0.9.44 */ public String getConfigMonitoring() { return configTable(PROP_MONITORING, DEFAULT_MONITORING); } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/SummaryBarRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/SummaryBarRenderer.java index c14def2c95..f1e6eb7116 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/SummaryBarRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/SummaryBarRenderer.java @@ -221,14 +221,6 @@ class SummaryBarRenderer { } public String renderI2PServicesHTML() { - StringBuilder buf = new StringBuilder(512); - buf.append("

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

\n" + - "
"); - // Store all items in map so they are sorted by translated name, add the plugins, then output Map svcs = new TreeMap(Collator.getInstance()); StringBuilder rbuf = new StringBuilder(128); @@ -286,11 +278,22 @@ class SummaryBarRenderer { Map apps = NavHelper.getClientAppLinks(); if (apps != null) svcs.putAll(apps); - for (String row : svcs.values()) { - buf.append(row); + if (!svcs.isEmpty()) { + StringBuilder buf = new StringBuilder(128 * svcs.size()); + buf.append("

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

\n" + + "
"); + for (String row : svcs.values()) { + buf.append(row); + } + buf.append("
\n"); + return buf.toString(); + } else { + return ""; } - buf.append("\n"); - return buf.toString(); } /**