Changeset 31a52d2


Ignore:
Timestamp:
Nov 2, 2017 10:09:10 AM (3 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
a715d2b
Parents:
670e56d
Message:

Sidebar:

  • Fix erratic display of sidebar graph
  • Add id to memory bar so we can target it for Chrome/blink display issue
Files:
4 edited

Legend:

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

    r670e56d r31a52d2  
    803803               .append(_helper.getSecondKBps())
    804804               .append("Bps</span></td></tr></table></a></div>\n");
    805 //               .append("<script src=\"/js/refreshGraph.js\" type=\"text/javascript\"></script>");
     805        buf.append("<script src=\"/js/refreshGraph.js\" type=\"text/javascript\" id=\"refreshGraph\" async></script>");
    806806        return buf.toString();
    807807    }
  • apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java

    r670e56d r31a52d2  
    317317        // return integerFormatter.format(used) + "MB (" + usedPc + "%)";
    318318        // return integerFormatter.format(used) + "MB / " + free + " MB";
    319         return "<div class=\"percentBarOuter\"><div class=\"percentBarText\">RAM: " + integerFormatter.format(used) + " / " + total + "MB" +
     319        return "<div class=\"percentBarOuter\" id=\"sb_memoryBar\"><div class=\"percentBarText\">RAM: " + integerFormatter.format(used) + " / " + total + "MB" +
    320320        "</div><div class=\"percentBarInner\" style=\"width: " + integerFormatter.format(usedPc) +
    321321        "%;\"></div></div>";
  • apps/routerconsole/jsp/js/ajax.js

    r670e56d r31a52d2  
    3636    }
    3737
    38     // conditionally load sidebar refreshGraph script
    39     var graph = document.getElementById('sb_graphcontainer');
    40     if (graph) {
    41       var js_refreshGraph = document.createElement('script');
    42       js_refreshGraph.type = "text/javascript";
    43       js_refreshGraph.src = "/js/refreshGraph.js";
    44       js_refreshGraph.async = true;
    45       document.getElementsByTagName('head')[0].appendChild(js_refreshGraph);
     38    // conditionally display graph so ajax call doesn't interfere with refreshGraph.js
     39    var graph = document.getElementById("sb_graphcontainer");
     40      if (graph) {
     41      graph.style.backgroundImage = "url(/viewstat.jsp?stat=bw.combined&periodCount=20&width=220&height=50&hideLegend=true&hideGrid=true&time=" + new Date().getTime();
    4642    }
    4743
  • history.txt

    r670e56d r31a52d2  
     12017-11-02 str4d
     2 * Console:
     3   - Sidebar:
     4     - Fix erratic display of sidebar graph
     5     - Add id to memory bar so we can target it for Chrome/blink display issue
     6
    172017-10-25 str4d
    28 * Console:
Note: See TracChangeset for help on using the changeset viewer.