Changeset 667bd466


Ignore:
Timestamp:
Feb 22, 2012 3:41:04 PM (10 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
a288fc5
Parents:
13731e7
Message:

hide stat log config unless already enabled

Location:
apps/routerconsole
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHelper.java

    r13731e7 r667bd466  
    6060    }
    6161
    62     public ConfigStatsHelper() {}
    63    
     62    /**
     63     *  Just hide for everybody unless already set.
     64     *  To enable set advanced config stat.logFilters=foo before starting...
     65     *  it has to be set at startup anyway for logging to be enabled at all
     66     *  @since 0.9
     67     */
     68    public boolean shouldShowLog() {
     69        return !_filters.isEmpty();
     70    }
     71
    6472    public String getFilename() { return _context.statManager().getStatFile(); }
    6573   
  • apps/routerconsole/jsp/configstats.jsp

    r13731e7 r667bd466  
    7979 if (statshelper.getIsFull()) { %>checked="true" <% } %> >
    8080 (<%=intl._("change requires restart to take effect")%>)<br>
    81  <%=intl._("Stat file")%>: <input type="text" name="filename" value="<%=statshelper.getFilename()%>" ><br>
    82 <%=intl._("Filter")%>: (<a href="javascript:void(null);" onclick="toggleAll('*')"><%=intl._("toggle all")%></a>)<br></p>
     81<%
     82
     83  // stats.log for devs only and grows without bounds, not recommended
     84  boolean shouldShowLog = statshelper.shouldShowLog();
     85  if (shouldShowLog) {
     86
     87%><%=intl._("Stat file")%>: <input type="text" name="filename" value="<%=statshelper.getFilename()%>" ><br>
     88Warning - Log with care, stat file grows without limit.<br>
     89<%
     90
     91  }  // shouldShowLog
     92
     93%><%=intl._("Filter")%>: (<a href="javascript:void(null);" onclick="toggleAll('*')"><%=intl._("toggle all")%></a>)<br></p>
    8394 <div class="wideload">
    8495 <table>
     
    91102     </td></tr>
    92103 <tr class="tablefooter">
    93     <td align="center"><b><%=intl._("Log")%></b></td>
    94     <td align="center"><b><%=intl._("Graph")%></b></td>
     104<%
     105
     106  if (shouldShowLog) {
     107
     108%>  <td align="center"><b><%=intl._("Log")%></b></td>
     109<%
     110
     111  }  // shouldShowLog
     112
     113%>    <td align="center"><b><%=intl._("Graph")%></b></td>
    95114    <td></td></tr>
    96115        <%
    97116     } // end iterating over required groups for the current stat %>
    98  <tr><td align="center">
     117 <tr>
     118<%
     119
     120  if (shouldShowLog) {
     121
     122%>   <td align="center">
    99123     <a name="<%=statshelper.getCurrentStatName()%>"></a>
    100124     <input type="checkbox" class="optbox <%=statshelper.getCurrentGroupName()%>" name="statList" value="<%=statshelper.getCurrentStatName()%>" <%
    101125     if (statshelper.getCurrentIsLogged()) { %>checked="true" <% } %> ></td>
    102      <td align="center">
     126<%
     127
     128  }  // shouldShowLog
     129
     130%>   <td align="center">
    103131     <% if (statshelper.getCurrentCanBeGraphed()) { %>
    104132       <input type="checkbox" class="optbox <%=statshelper.getCurrentGroupName()%>" name="graphList" value="<%=statshelper.getCurrentGraphName()%>" <%
     
    106134     <td align="left"><b><%=statshelper.getCurrentStatName()%>:</b><br>
    107135     <%=statshelper.getCurrentStatDescription()%></td></tr><%
    108     } // end iterating over all stats %>
    109  <tr><td colspan="3"></td></tr>
     136    } // end iterating over all stats
     137
     138  if (shouldShowLog) {
     139
     140%> <tr><td colspan="3"></td></tr>
    110141 <tr><td align="center"><input type="checkbox" class="optbox" name="explicitFilter" ></td>
    111142     <td colspan="2"><%=intl._("Advanced filter")%>:
    112143     <input type="text" name="explicitFilterValue" value="<%=statshelper.getExplicitFilter()%>" size="40" ></td></tr>
    113      <tr class="tablefooter"><td colspan="3" align="right">
     144<%
     145
     146  }  // shouldShowLog
     147
     148%>   <tr class="tablefooter"><td colspan="3" align="right">
    114149<input type="reset" class="cancel" value="<%=intl._("Cancel")%>" >
    115150<input type="submit" name="shouldsave" class="accept" value="<%=intl._("Save changes")%>" >
Note: See TracChangeset for help on using the changeset viewer.