diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigHomeHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigHomeHandler.java index eb0c7f74db2cc59afc3f3d218436d99faed84f05..1fdb4e43ab2bf9d5dbeb42d8f3d978109c32b47e 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigHomeHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigHomeHandler.java @@ -41,6 +41,12 @@ public class ConfigHomeHandler extends FormHandler { } else if ("3".equals(group)) { prop = SearchHelper.PROP_ENGINES; dflt = SearchHelper.ENGINES_DEFAULT; + } else if ("4".equals(group)) { + prop = HomeHelper.PROP_CONFIG; + dflt = HomeHelper.DEFAULT_CONFIG; + } else if ("5".equals(group)) { + prop = HomeHelper.PROP_MONITORING; + dflt = HomeHelper.DEFAULT_MONITORING; } else { addFormError("Bad group"); return; 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 d952da75d946c7f0c16c490551310ddd49512c7d..c0a20bf905870e0794911522af659b6096a33e38 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 @@ -30,23 +30,30 @@ public class HomeHelper extends HelperBase { private static final String I = "/themes/console/images/"; static final String PROP_SERVICES = "routerconsole.services"; static final String PROP_FAVORITES = "routerconsole.favorites"; + static final String PROP_CONFIG = "routerconsole.configopts"; + static final String PROP_MONITORING = "routerconsole.monitoring"; static final String PROP_OLDHOME = "routerconsole.oldHomePage"; private static final String PROP_SEARCH = "routerconsole.showSearch"; // No commas allowed in text strings! static final String DEFAULT_SERVICES = + _x("Email") + S + _x("Anonymous webmail client") + S + "/webmail" + S + I + "email.png" + S + + _x("I2P Tunnel") + S + _x("Port-Forwarding to and from I2P") + S + "/i2ptunnelmgr" + S + I + "itoopie_xsm.png" + S + + _x("Torrents") + S + _x("Built-in anonymous BitTorrent Client") + S + "/torrents" + S + I + "i2psnark.png" + S + + _x("Web Server") + S + _x("Local web server for hosting your own content on I2P") + S + "http://127.0.0.1:7658/" + S + I + "server_32x32.png" + S + _x("Addressbook") + S + _x("Manage your I2P hosts file here (I2P domain name resolution)") + S + "/dns" + S + I + "book_addresses.png" + S + + ""; + + 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 + // FIXME wasn't escaped //_x("Configure UI") + S + _x("Select console theme & language & set optional console password").replace("&", "&") + S + "/configui" + S + I + "info/ui.png" + S + //_x("Customize Home Page") + S + _x("I2P Home Page Configuration") + S + "/confighome" + S + I + "home_page.png" + S + //_x("Customize Sidebar") + S + _x("Customize the sidebar by adding or removing or repositioning elements") + S + "/configsidebar" + S + I + "info/sidebar.png" + S + - _x("Email") + S + _x("Anonymous webmail client") + S + "/webmail" + S + I + "email.png" + S + _x("Help") + S + _x("I2P Router Help") + S + "/help" + S + I + "support.png" + S + _x("Manage Plugins") + S + _x("Install and configure I2P plugins") + S + "/configplugins" + S + I + "plugin.png" + S + _x("Router Console") + S + _x("I2P Router Console") + S + "/console" + S + I + "info/console.png" + S + - _x("Torrents") + S + _x("Built-in anonymous BitTorrent Client") + S + "/torrents" + S + I + "i2psnark.png" + S + - _x("Web Server") + S + _x("Local web server for hosting your own content on I2P") + S + "http://127.0.0.1:7658/" + S + I + "server_32x32.png" + S + ""; // No commas allowed in text strings! @@ -87,6 +94,14 @@ public class HomeHelper extends HelperBase { //"sponge.i2p" + S + _x("Seedless and the Robert BitTorrent applications") + S + "http://sponge.i2p/" + S + I + "user_astronaut.png" + S + ""; + // No commas allowed in text strings! + static final String DEFAULT_MONITORING = + _x("Logs") + S + _x("View the logs") + S + "/logs" + S + I + "billiard_marker.png" + S + + _x("Router Stats") + S + _x("View router stats") + S + "/stats" + S + I + "info/bandwidth.png" + S + + _x("Charts and Graphs") + S + _x("Visualize information about the router") + S + "/graphs" + S + I + "chart_line.png" + S + + _x("Network Database") + S + _x("View the NetDB") + S + "/netdb" + S + I + "support.png" + S + + _x("Peers") + S + _x("View your known peers") + S + "/peers" + S + I + "group.png" + S + + ""; public boolean shouldShowWelcome() { return _context.getProperty(Messages.PROP_LANG) == null; @@ -101,6 +116,14 @@ public class HomeHelper extends HelperBase { return homeTable(PROP_SERVICES, DEFAULT_SERVICES, plugins); } + public String getConfig(){ + return homeTable(PROP_CONFIG, DEFAULT_CONFIG, null); + } + + public String getMonitoring(){ + return homeTable(PROP_MONITORING, DEFAULT_MONITORING, null); + } + public String getFavorites() { return homeTable(PROP_FAVORITES, DEFAULT_FAVORITES, null); } @@ -109,6 +132,14 @@ public class HomeHelper extends HelperBase { return configTable(PROP_SERVICES, DEFAULT_SERVICES); } + public String getConfigConfig() { + return configTable(PROP_CONFIG, DEFAULT_CONFIG); + } + + public String getConfigMonitoring() { + return configTable(PROP_MONITORING, DEFAULT_MONITORING); + } + public String getConfigFavorites() { return configTable(PROP_FAVORITES, DEFAULT_FAVORITES); } @@ -212,6 +243,9 @@ public class HomeHelper extends HelperBase { } else if (url.equals("/torrents")) { if (!pm.isRegistered("i2psnark")) continue; + } else if (url.equals("/i2ptunnelmgr")) { + if (!pm.isRegistered("i2ptunnel")) + continue; } else if (url.equals("/configplugins")) { if (!PluginStarter.pluginsEnabled(_context)) continue; diff --git a/apps/routerconsole/jsp/confighome.jsp b/apps/routerconsole/jsp/confighome.jsp index 82044d6d715548409e13667edab445ec830c2406..ae6f5ea218f3699dbb15e3c151559d8a79257588 100644 --- a/apps/routerconsole/jsp/confighome.jsp +++ b/apps/routerconsole/jsp/confighome.jsp @@ -62,7 +62,7 @@ input.default { <% } // shouldShowSearch() %> -<h3 class="tabletitle"><%=intl._t("Hidden Services of Interest")%></h3> +<h3 class="tabletitle"><%=intl._t("Blogs, Forums, and Web Sites")%></h3> <form action="" method="POST"> <input type="hidden" name="nonce" value="<%=pageNonce%>" > <input type="hidden" name="group" value="1"> @@ -76,7 +76,7 @@ input.default { </div> </form> -<h3 class="tabletitle"><%=intl._t("Applications and Configuration")%></h3> +<h3 class="tabletitle"><%=intl._t("Applications")%></h3> <form action="" method="POST"> <input type="hidden" name="nonce" value="<%=pageNonce%>" > <input type="hidden" name="group" value="2"> @@ -89,4 +89,32 @@ input.default { <input type="submit" name="action" class="add" value="<%=intl._t("Add item")%>" > </div> </form> + +<h3 class="tabletitle"><%=intl._t("Configuration")%></h3> +<form action="" method="POST"> + <input type="hidden" name="nonce" value="<%=pageNonce%>" > + <input type="hidden" name="group" value="4"> + <jsp:getProperty name="homehelper" property="configConfig" /> + <div class="formaction" id="homeconfig"> + <input type="submit" name="action" class="default" value="<%=intl._t("Add item")%>" > + <input type="submit" name="action" class="delete" value="<%=intl._t("Delete selected")%>" > + <input type="reset" class="cancel" value="<%=intl._t("Cancel")%>" > + <input type="submit" name="action" class="reload" value="<%=intl._t("Restore defaults")%>" > + <input type="submit" name="action" class="add" value="<%=intl._t("Add item")%>" > + </div> +</form> + +<h3 class="tabletitle"><%=intl._t("Monitoring")%></h3> +<form action="" method="POST"> + <input type="hidden" name="nonce" value="<%=pageNonce%>" > + <input type="hidden" name="group" value="5"> + <jsp:getProperty name="homehelper" property="configMonitoring" /> + <div class="formaction" id="homemonitor"> + <input type="submit" name="action" class="default" value="<%=intl._t("Add item")%>" > + <input type="submit" name="action" class="delete" value="<%=intl._t("Delete selected")%>" > + <input type="reset" class="cancel" value="<%=intl._t("Cancel")%>" > + <input type="submit" name="action" class="reload" value="<%=intl._t("Restore defaults")%>" > + <input type="submit" name="action" class="add" value="<%=intl._t("Add item")%>" > + </div> +</form> </div></body></html> diff --git a/apps/routerconsole/jsp/home.jsp b/apps/routerconsole/jsp/home.jsp index b5ee279781de9f550031a40f0fc17217ccfb6804..01ad5f1eae40153ed99bcd3a681c2215d8ec2747 100644 --- a/apps/routerconsole/jsp/home.jsp +++ b/apps/routerconsole/jsp/home.jsp @@ -86,16 +86,30 @@ } // shouldShowSearch() %> <div class="ag2"> - <h4 class="app2"><%=intl._t("Hidden Services of Interest")%></h4> + <h4 class="app"><%=intl._t("Applications")%></h4> + <div class="homeapps"> + <jsp:getProperty name="homehelper" property="services" /><br> + <div class="clearer"> </div> + </div> + </div> + <div class="ag2"> + <h4 class="app2"><%=intl._t("Blogs, Forums, and Web Sites")%></h4> <div class="homesites"> <jsp:getProperty name="homehelper" property="favorites" /><br> <div class="clearer"> </div> </div> </div> <div class="ag2"> - <h4 class="app"><%=intl._t("Applications and Configuration")%></h4> - <div class="homeapps"> - <jsp:getProperty name="homehelper" property="services" /><br> + <h4 class="app"><%=intl._t("Configuration")%></h4> + <div class="homeconfig"> + <jsp:getProperty name="homehelper" property="config" /><br> + <div class="clearer"> </div> + </div> + </div> + <div class="ag2"> + <h4 class="app"><%=intl._t("Monitoring")%></h4> + <div class="homedevs"> + <jsp:getProperty name="homehelper" property="monitoring" /><br> <div class="clearer"> </div> </div> </div>