|
@@ -15,19 +15,22 @@
|
|
<th>Contact</th>
|
|
<th>Contact</th>
|
|
<th>Date</th>
|
|
<th>Date</th>
|
|
</tr>
|
|
</tr>
|
|
|
|
+ {% macro color(packetloss) -%}
|
|
|
|
+ {% if packetloss >= 50 %}
|
|
|
|
+ "red"
|
|
|
|
+ {% elif packetloss > 0 %}
|
|
|
|
+ "orange"
|
|
|
|
+ {% endif %}
|
|
|
|
+ {%- endmacro %}
|
|
{% for r in results %}
|
|
{% for r in results %}
|
|
{% set packetloss = (100 * (r.probes_sent - r.probes_received) / r.probes_sent) %}
|
|
{% set packetloss = (100 * (r.probes_sent - r.probes_received) / r.probes_sent) %}
|
|
<tr>
|
|
<tr>
|
|
<td>{% if r.avgrtt is not none() %}{{ r.avgrtt }} ms{% endif %}</td>
|
|
<td>{% if r.avgrtt is not none() %}{{ r.avgrtt }} ms{% endif %}</td>
|
|
<td>{% if r.jitter is not none() %}{{ r.jitter }} ms{% endif %}</td>
|
|
<td>{% if r.jitter is not none() %}{{ r.jitter }} ms{% endif %}</td>
|
|
- <td><span {% if packetloss >= 50 %}
|
|
|
|
- class="red"
|
|
|
|
- {% elif packetloss > 0 %}
|
|
|
|
- class="orange"
|
|
|
|
- {% endif %}>
|
|
|
|
|
|
+ <td><span class={{ color(packetloss) }}>
|
|
{{ packetloss|round(2) }}%
|
|
{{ packetloss|round(2) }}%
|
|
</span>
|
|
</span>
|
|
- ({{ r.probes_sent - r.probes_received }}/{{ r.probes_sent }})
|
|
|
|
|
|
+ (<span class={{ color(packetloss) }}>{{ r.probes_sent - r.probes_received }}</span>/{{ r.probes_sent }})
|
|
</td>
|
|
</td>
|
|
<td>{{ r.participant.name }}
|
|
<td>{{ r.participant.name }}
|
|
{% if r.participant.country is not none() %}
|
|
{% if r.participant.country is not none() %}
|