Add coloring to monitoring panel

coloring javascript added to
congress_dashboard/monitoring/templates/monitoring/index.html
None zero error cell colored red
None zero warning cell colored yellow

"monitoring" div id changed to "monitoring_panel" to
avoid clashing with the monitoring table of the same id.

screen shot example: https://imagebin.ca/v/3UAZHzzxqkwX

Implements blueprint enhance-congress-dashboard
Partial-Bug:#1670520

Change-Id: I8702b6dac75612449e0025b13a1db7f481b6c532
This commit is contained in:
Eric Kao 2017-07-19 19:06:28 -07:00
parent b1b8cf09c3
commit 318dd8dba4
1 changed files with 15 additions and 1 deletions

View File

@ -7,7 +7,21 @@
{% endblock page_header %}
{% block main %}
<div id="monitoring">
<div id="monitoring_panel">
{{ monitoring_table.render }}
</div>
<script type="text/javascript">
// color none 0 errors/warnings red/yellow
table_rows = document.getElementById("monitoring").childNodes[5];
num_rows = (table_rows.childNodes.length - 1)/2;
for (i = 0; i < num_rows; i++) {
row = table_rows.childNodes[1 + 2*i];
if (row.childNodes[1].innerHTML.trim() != "-") {
row.childNodes[1].style.backgroundColor = "rgba(255, 0, 0, 0.5)";
}
if (row.childNodes[2].innerHTML.trim() != "-") {
row.childNodes[2].style.backgroundColor = "rgba(255, 255, 0, 0.5)";
}
}
</script>
{% endblock %}