Skip to content
Snippets Groups Projects
Commit 7d408f6f authored by Leonidas Poulopoulos's avatar Leonidas Poulopoulos
Browse files

Added fields to admin interface. Minor changes with UI datatables

parent d50fd7b6
No related branches found
No related tags found
No related merge requests found
......@@ -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']}),
......
......@@ -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:
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment