Changeset 66544f4


Ignore:
Timestamp:
May 1, 2016 2:16:46 AM (5 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
a7f789f
Parents:
82c55e6
Message:

Tweak /stats for theming

File:
1 edited

Legend:

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

    r82c55e6 r66544f4  
    3131    public void generateStatsPage(Writer out, boolean showAll) throws IOException {
    3232        StringBuilder buf = new StringBuilder(16*1024);
    33         buf.append("<div class=\"joblog\"><form action=\"\">");
    34         buf.append("<select name=\"go\" onChange='location.href=this.value'>");
     33
     34        buf.append("<div class=\"joblog\">\n");
     35        buf.append("<p id=\"gatherstats\">");
     36        buf.append(_t("Statistics gathered during this router's uptime")).append(" (");
     37        long uptime = _context.router().getUptime();
     38        buf.append(DataHelper.formatDuration2(uptime));
     39        buf.append(").  ").append( _t("The data gathered is quantized over a 1 minute period, so should just be used as an estimate."));
     40        buf.append(' ').append( _t("These statistics are primarily used for development and debugging."));
     41        buf.append("</p>");
     42
     43        buf.append("<form action=\"\"><b>");
     44        buf.append(_t("Jump to section")).append(":</b> <select name=\"go\" onChange='location.href=this.value'>");
    3545        out.write(buf.toString());
    3646        buf.setLength(0);
    37        
     47
    3848        Map<String, SortedSet<String>> unsorted = _context.statManager().getStatsByGroup();
    3949        Map<String, Set<String>> groups = new TreeMap<String, Set<String>>(new AlphaComparator());
     
    5767        buf.append("</select> <input type=\"submit\" value=\"").append(_t("GO")).append("\" />");
    5868        buf.append("</form>");
    59        
    60         buf.append(_t("Statistics gathered during this router's uptime")).append(" (");
    61         long uptime = _context.router().getUptime();
    62         buf.append(DataHelper.formatDuration2(uptime));
    63         buf.append(").  ").append( _t("The data gathered is quantized over a 1 minute period, so should just be used as an estimate."));
    64         buf.append(' ').append( _t("These statistics are primarily used for development and debugging."));
    6569
    6670        out.write(buf.toString());
    6771        buf.setLength(0);
    68        
     72
    6973        for (Map.Entry<String, Set<String>> entry : groups.entrySet()) {
    7074            String group = entry.getKey();
     
    8387                buf.append("\">");
    8488                buf.append(stat);
    85                 buf.append("</a></b><br>");
     89                buf.append("</a>:</b>&nbsp;");
    8690                if (_context.statManager().isFrequency(stat))
    8791                    renderFrequency(stat, buf);
     
    215219            }
    216220            if (curRate.getSummaryListener() != null) {
    217                 buf.append(" <a href=\"graph?stat=").append(name)
     221                buf.append("<br><a href=\"graph?stat=").append(name)
    218222                   .append('.').append(periods[i]);
    219223                buf.append("\">").append(_t("Graph Data")).append("</a> - ");
Note: See TracChangeset for help on using the changeset viewer.