summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-08-08 15:54:56 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-08-09 10:01:52 +0200
commit37efed8d30888d36461270a8c8d6d7f630c3a982 (patch)
tree91cccbfb46ce65c4b94b73390bf865bd1e556351
parent4b105b96b5e3702a7bfca016a749901f58f303f9 (diff)
template: prevent backtrace in /client/listv1.1.3-29
Don't access client.speed if the field is not present.
-rw-r--r--ogcp/templates/client_list.html10
1 files changed, 7 insertions, 3 deletions
diff --git a/ogcp/templates/client_list.html b/ogcp/templates/client_list.html
index 188cc2a..cd07118 100644
--- a/ogcp/templates/client_list.html
+++ b/ogcp/templates/client_list.html
@@ -34,10 +34,14 @@
<tr data-toggle="fieldset-entry">
<td>{{ client_data.addr }}</td>
<td>
- {% if client_data.speed >= 1000 %}
- {{ (client_data.speed / 1000) | int }} Gb/s
+ {% if client_data.speed is not none %}
+ {% if client_data.speed >= 1000 %}
+ {{ (client_data.speed / 1000) | int }} Gb/s
+ {% else %}
+ {{ client_data.speed }} Mb/s
+ {% endif %}
{% else %}
- {{ client_data.speed }} Mb/s
+ {{ _('Not available') }}
{% endif %}
</td>
<td><a href="{{ url_for('action_client_info', client_ip = client_data.addr) }}">{{ _('View details') }}</a></td>