- Fix erratic display of sidebar graph
- Add id to memory bar so we can target it for Chrome/blink display issue
This commit is contained in:
str4d
2017-11-02 10:09:10 +00:00
parent 670e56ded2
commit 31a52d2acc
4 changed files with 12 additions and 10 deletions

View File

@ -802,7 +802,7 @@ class SummaryBarRenderer {
.append("\"><td><span id=\"sb_graphstats\">")
.append(_helper.getSecondKBps())
.append("Bps</span></td></tr></table></a></div>\n");
// .append("<script src=\"/js/refreshGraph.js\" type=\"text/javascript\"></script>");
buf.append("<script src=\"/js/refreshGraph.js\" type=\"text/javascript\" id=\"refreshGraph\" async></script>");
return buf.toString();
}

View File

@ -316,7 +316,7 @@ public class SummaryHelper extends HelperBase {
// long free = Runtime.getRuntime().freeMemory()/1024/1024;
// return integerFormatter.format(used) + "MB (" + usedPc + "%)";
// return integerFormatter.format(used) + "MB / " + free + " MB";
return "<div class=\"percentBarOuter\"><div class=\"percentBarText\">RAM: " + integerFormatter.format(used) + " / " + total + "MB" +
return "<div class=\"percentBarOuter\" id=\"sb_memoryBar\"><div class=\"percentBarText\">RAM: " + integerFormatter.format(used) + " / " + total + "MB" +
"</div><div class=\"percentBarInner\" style=\"width: " + integerFormatter.format(usedPc) +
"%;\"></div></div>";
}

View File

@ -35,14 +35,10 @@ function ajaxDone(url, target, refresh) {
//document.getElementByClassName("hideifdown").style.display="none";
}
// conditionally load sidebar refreshGraph script
var graph = document.getElementById('sb_graphcontainer');
// conditionally display graph so ajax call doesn't interfere with refreshGraph.js
var graph = document.getElementById("sb_graphcontainer");
if (graph) {
var js_refreshGraph = document.createElement('script');
js_refreshGraph.type = "text/javascript";
js_refreshGraph.src = "/js/refreshGraph.js";
js_refreshGraph.async = true;
document.getElementsByTagName('head')[0].appendChild(js_refreshGraph);
graph.style.backgroundImage = "url(/viewstat.jsp?stat=bw.combined&periodCount=20&width=220&height=50&hideLegend=true&hideGrid=true&time=" + new Date().getTime();
}
setTimeout(function() {ajax(url, target, refresh);}, refresh);

View File

@ -1,3 +1,9 @@
2017-11-02 str4d
* Console:
- Sidebar:
- Fix erratic display of sidebar graph
- Add id to memory bar so we can target it for Chrome/blink display issue
2017-10-25 str4d
* Console:
- /graphs: