Skip to content
Snippets Groups Projects
Commit ff53c7b1 authored by David Schmitz's avatar David Schmitz
Browse files

route_detail view: fix missing port in route summary

parent 378f1262
Branches
Tags
No related merge requests found
......@@ -823,7 +823,7 @@ def routedetails(request, route_slug):
route = get_object_or_404(Route, name=route_slug)
#return render(request, 'flowspy/route_details.html', {'route': route})
now = datetime.datetime.now()
return render(request, 'flowspy/route_details.html', {'route': route, 'mytime': now})
return render(request, 'flowspy/route_details.html', {'route': route, 'mytime': now, 'route_comments_len' : len(str(route.comments)) })
@login_required
def routestats(request, route_slug):
......
......@@ -35,17 +35,13 @@ function myreloadPage() {
{% endif %}
{% trans 'traffic from' %}
{{ route.source }}
{% if route.port.count %}, {% trans 'port' %}
{% for port in route.port.all %}
{{ port }} {% if not forloop.last %},{% endif %}
{% endfor %}
{% if route.sourceport %} {% trans 'port' %}
{{ route.sourceport }}
{% endif %}
{% trans 'to' %}
{{ route.destination }}
{% if route.destinationport.count %}, {% trans 'port' %}
{% for port in route.destinationport.all %}
{{ port }} {% if not forloop.last %},{% endif %}
{% endfor %}
{% if route.destinationport %} {% trans 'port' %}
{{ route.destinationport }}
{% endif %}
{% if route.fragmenttype.count %}
({% trans 'Fragmentypes' %}:
......@@ -72,6 +68,16 @@ function myreloadPage() {
<button class="del_button btn-warning btn btn-sm btn-outline" id="{{ route.name }}" data-routename="{{ route.name }}">{% trans "Deactivate" %}</button>
{% endif %}
{% endif %}
{% if route.comments %}
<p>
<div>
Comments: {{ route.comments|slice:"0:300" }}
{% if route_comments_len > 300 %}
...
{% endif %}
</div>
{% endif %}
</div>
<div>
<h2>Statistics</h2>
......@@ -105,6 +111,12 @@ function myreloadPage() {
</div>
</div>
{% endif %}
{% if route.comments %}
<p>
<div><h2>Comments</h2><pre>{{ route.comments }}</pre></div>
{% endif %}
</div>
{% endblock %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment