diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHelper.java index 254a20728..61d496933 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHelper.java @@ -59,8 +59,16 @@ public class ConfigStatsHelper extends HelperBase { _filters.add(tok.nextToken().trim()); } - public ConfigStatsHelper() {} - + /** + * Just hide for everybody unless already set. + * To enable set advanced config stat.logFilters=foo before starting... + * it has to be set at startup anyway for logging to be enabled at all + * @since 0.9 + */ + public boolean shouldShowLog() { + return !_filters.isEmpty(); + } + public String getFilename() { return _context.statManager().getStatFile(); } /** diff --git a/apps/routerconsole/jsp/configstats.jsp b/apps/routerconsole/jsp/configstats.jsp index 7e548a113..94cf96833 100644 --- a/apps/routerconsole/jsp/configstats.jsp +++ b/apps/routerconsole/jsp/configstats.jsp @@ -78,8 +78,19 @@ function toggleAll(category) checked="true" <% } %> > (<%=intl._("change requires restart to take effect")%>)
- <%=intl._("Stat file")%>:
-<%=intl._("Filter")%>: (<%=intl._("toggle all")%>)

+<% + + // stats.log for devs only and grows without bounds, not recommended + boolean shouldShowLog = statshelper.shouldShowLog(); + if (shouldShowLog) { + +%><%=intl._("Stat file")%>:
+Warning - Log with care, stat file grows without limit.
+<% + + } // shouldShowLog + +%><%=intl._("Filter")%>: (<%=intl._("toggle all")%>)

<% while (statshelper.hasMoreStats()) { @@ -90,27 +101,51 @@ function toggleAll(category) (<%=intl._("toggle all")%>) - - +<% + + if (shouldShowLog) { + +%> +<% + + } // shouldShowLog + +%> <% } // end iterating over required groups for the current stat %> - +<% + + if (shouldShowLog) { + +%> - <% - } // end iterating over all stats %> - + } // end iterating over all stats + + if (shouldShowLog) { + +%> -
<%=intl._("Log")%><%=intl._("Graph")%><%=intl._("Log")%><%=intl._("Graph")%>
+
checked="true" <% } %> > +<% + + } // shouldShowLog + +%> <% if (statshelper.getCurrentCanBeGraphed()) { %> checked="true" <% } %> ><% } %> <%=statshelper.getCurrentStatName()%>:
<%=statshelper.getCurrentStatDescription()%>
<%=intl._("Advanced filter")%>:
+<% + + } // shouldShowLog + +%>
" > " >