Skip to content

Commit

Permalink
perf: reduce file size reports
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrugman committed Jun 14, 2022
1 parent 4223e56 commit 5b36564
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
4 changes: 2 additions & 2 deletions popmon/visualization/templates/aggregated-overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<div class="tl-container">
{% for i in [2, 1, 0] %}
{% if vals[i] > 0 %}
<div style="width: calc({{ vals[i] }} / {{ vals['total'] }} * 100%)" class="tl-bar {% if i == 2%}red{%elif i == 1%}yellow{%else%}green{%endif%}">
<div style="width: calc({{ vals[i] }} / {{ vals['total'] }} * 100%)" class="tl-bar {% if i == 2%}r{%elif i == 1%}y{%else%}g{%endif%}">
{{ vals[i] }} ({{ "%d" % (vals[i] / (vals["total"] * 0.01))}}%)
</div>
{% else %}
<div style="width: 0%" class="white">&nbsp;</div>
<div style="width: 0%">&nbsp;</div>
{% endif %}
{% endfor %}
</div>
Expand Down
20 changes: 5 additions & 15 deletions popmon/visualization/templates/assets/css/custom-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ table.overview tbody td.metric{
min-width: max-content;
width: 200px;
}
table.overview tbody td.cell{
border: 1px solid #333333;
table.overview tbody td:not(.metric){
border: 1px solid #333;
text-align: center;
}
table.overview td.cell-green{
.g{
background: green;
}
table.overview td.cell-yellow{
.y{
background: rgba(255, 200, 0, 1.0);
}
table.overview td.cell-red{
.r{
background: rgba(255, 0, 0, 1.0);
}
table.overview tfoot td {
Expand All @@ -93,16 +93,6 @@ table.overview tfoot td span{
}

/* overview progress bars */
.tl-bar.green{
background-color: green;
}
.tl-bar.yellow{
background-color: rgba(255, 200, 0, 1.0);
}
.tl-bar.red{
background-color: rgba(255, 0, 0, 1.0);
}

.tl-bar{
padding-top:10px;
padding-bottom:10px;
Expand Down
6 changes: 3 additions & 3 deletions popmon/visualization/templates/table.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
{% for label in labels %}
{% if data[metric][label] | length == 1 %}
{% with class = data[metric][label][0] %}
<td class="cell cell-{{ class }}">&nbsp;</td>
<td class="{{ class }}">&nbsp;</td>
{% endwith %}
{% elif data[metric][label] | length == 2 %}
{% with rgba, value = data[metric][label] %}
<td class="cell" style="background-color: rgba({{ ', '.join(rgba) }})">{{ value }}</td>
<td style="background-color: rgba({{ ', '.join(rgba) }})">{{ value }}</td>
{% endwith %}
{% elif data[metric][label] | length == 3 %}
{% with text_color, rgba, value = data[metric][label] %}
<td class="cell" style="color: {{ text_color }}; background-color: rgba({{ ', '.join(rgba) }})">{{ value }}</td>
<td style="color: {{ text_color }}; background-color: rgba({{ ', '.join(rgba) }})">{{ value }}</td>
{% endwith %}
{% endif %}
{% endfor %}
Expand Down

0 comments on commit 5b36564

Please sign in to comment.