diff --git a/flowspec/admin.py b/flowspec/admin.py index f6131d33766e4d8695080cd088d772f415acde7c..7ca2534ea06c30bfa8e19e838ab3b20585f98811 100644 --- a/flowspec/admin.py +++ b/flowspec/admin.py @@ -17,7 +17,8 @@ class RouteAdmin(admin.ModelAdmin): self.message_user(request, "Added request %s to job que. Check in a while for result" % response) deactivate.short_description = "Remove selected routes from network" - list_display = ('name', 'status', 'applier' , 'applier_peer', 'get_match', 'get_then', 'response') + list_display = ('name', 'status', 'applier' , 'applier_peer', 'get_match', 'get_then', 'response', "expires", "comments") + fieldsets = [ (None, {'fields': ['name','applier']}), ("Match", {'fields': ['source', 'sourceport', 'destination', 'destinationport', 'port']}), diff --git a/flowspec/models.py b/flowspec/models.py index b1f5ac5e45c082f41610ca34fc7d0311aa59d93b..9abea820c2f5129dda4a88232cf8ea0cbfa1afea 100644 --- a/flowspec/models.py +++ b/flowspec/models.py @@ -107,6 +107,8 @@ class Route(models.Model): class Meta: db_table = u'route' + verbose_name = "Rule" + verbose_name_plural = "Rules" def save(self, *args, **kwargs): if not self.pk: diff --git a/templates/user_routes.html b/templates/user_routes.html index 73ced250f433a955a0149380e7debbbd25faa4c8..efd48c9db6152a8d917bffc7ce6f99324ab414e4 100644 --- a/templates/user_routes.html +++ b/templates/user_routes.html @@ -140,7 +140,7 @@ function delete_route(route){ <th>{% trans "Name" %}</th> <th>{% trans "Match" %}</th> <th style="text-align: center;">{% trans "Then" %}</th> - <th style="text-align: center;">{% trans "Status" %}</th> + <th style="text-align: center; ">{% trans "Status" %}</th> {% comment %}<th style="text-align: center;">{% trans "Details" %}</th>{% endcomment %} <th style="text-align: center;">{% trans "Applier" %}</th> <th style="text-align: center;">{% trans "Expires" %}</th> @@ -157,12 +157,12 @@ function delete_route(route){ <td>{{ route.name }}</td> <td>{{ route.get_match|safe|escape }}</td> <td style="text-align: center;">{{route.get_then|safe|escape}}</td> - <td style="text-align: center;">{{route.status}}</td> + <td style="text-align: center; ">{{route.status}}</td> {% comment %}<td style="text-align: center;">{{ route.response }}</td>{% endcomment %} <td style="text-align: center;">{{ route.applier }}</td> <td style="text-align: center;">{{ route.expires }}</td> <td style="text-align: center;">{{ route.response }}</td> - <td style="text-align: center; width:140px;"> + <td style="text-align: center; width:150px;"> {% ifequal route.status 'ACTIVE' %} <a href="{% url edit-route route.name %}" class="edit_button" id="edit_button_{{route.pk}}">Edit</a> <button class="del_button" id="{{route.name}}" onclick="javascript:delete_route(this.id)">Del</button>