diff options
Diffstat (limited to 'rpkid')
-rw-r--r-- | rpkid/rpki/gui/app/templates/app/route_detail.html | 4 | ||||
-rw-r--r-- | rpkid/rpki/gui/app/views.py | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/rpkid/rpki/gui/app/templates/app/route_detail.html b/rpkid/rpki/gui/app/templates/app/route_detail.html index 0477b4a6..84add4a8 100644 --- a/rpkid/rpki/gui/app/templates/app/route_detail.html +++ b/rpkid/rpki/gui/app/templates/app/route_detail.html @@ -1,5 +1,6 @@ {% extends "app/app_base.html" %} {% load app_extras %} +{% load bootstrap_pager %} {# template for displaying the list of ROAs covering a specific route #} @@ -40,7 +41,7 @@ </tr> </thead> <tbody> - {% for pfx in object.roa_prefixes %} + {% for pfx in roa_prefixes %} <tr> <td>{{ pfx.as_resource_range }}</td> <td>{{ pfx.max_length }}</td> @@ -51,6 +52,7 @@ {% endfor %} </tbody> </table> + {% bootstrap_pager request roa_prefixes %} </div> </div> {% endblock %} diff --git a/rpkid/rpki/gui/app/views.py b/rpkid/rpki/gui/app/views.py index ac4c0858..759da48e 100644 --- a/rpkid/rpki/gui/app/views.py +++ b/rpkid/rpki/gui/app/views.py @@ -952,7 +952,16 @@ def route_view(request): def route_detail(request, pk): """Show a list of ROAs that match a given IPv4 route.""" route = get_object_or_404(models.RouteOrigin, pk=pk) - return render(request, 'app/route_detail.html', {'object': route}) + # when running rootd, viewing the 0.0.0.0/0 route will cause a fetch of all + # roas, so we paginate here, even though in the general case the number of + # objects will be small enough to fit a single page + count = request.GET.get('count', 25) + page = request.GET.get('page', 1) + paginator = Paginator(route.roa_prefixes.all(), count) + return render(request, 'app/route_detail.html', { + 'object': route, + 'roa_prefixes': paginator.page(page), + }) def route_suggest(request): |