1 {% extends "base.html" %}
4 <script type="text/javascript" src="/static/js/jquery.dataTables.js"></script>
5 <script type="text/javascript">
6 $(document).ready( function(){
14 'Delete': function() {
15 route = $('#route_to_delete').text();
16 route_url_id = '#del_route_'+route;
17 url = $(route_url_id).attr('href');
21 success: function(data) {
22 $('#dialog').dialog('close');
23 window.setTimeout('location.reload()', 1000);
28 $('#dialog').dialog('close');
34 update_val = $("#hid_mid").val();
35 if (update_val == 'UPDATED'){
36 $("#hid_mid").val('');
37 window.setTimeout('location.reload()', 500);
41 $('#console').dialog({
47 update_val = $("#hid_mid").val();
48 if (update_val == 'UPDATED'){
49 $("#hid_mid").val('');
50 window.setTimeout('location.reload()', 500);
55 $('#routes_table').dataTable( {
58 "sLengthMenu": '{% trans "Display" %} <select><option value="25">25</option><option value="50">50</option><option value="-1">{% trans "All" %}</option></select> routes'
62 $( ".button_place #routebutton" ).button({
64 primary: "ui-icon-circle-plus"
67 $( " .edit_button" ).button({
69 primary: "ui-icon-wrench"
72 $( " .del_button" ).button({
74 primary: "ui-icon-circle-close"
78 $('#dialog').dialog('open');
81 $("#consolebutton").button({
83 primary: "ui-icon-image"
87 $("#consolebutton").stop().stop();
88 $("#consolebutton").css('color', '#555555');
89 $('#console').dialog('open');
95 function delete_route(route){
97 $('#route_to_delete').text(route_name);
104 <style type="text/css">
106 background: none repeat scroll 0 0 #36102a !important;
107 color: #edeae8 !important;
108 font-family: monospace !important;
111 font-family: monospace !important;
116 {% block title %}{% trans "My routes" %}{% endblock %}
118 <div style="float:left">
119 <h3 style="margin-top: 0px;">{% trans "My routes" %}</h3>
121 <div class='button_place' style="float:right">
122 <button id="consolebutton">Console</button> <a href="{% url add-route %}" id="routebutton">Add Route</a>
124 <table class="display" width="100%" id="routes_table">
127 <th>{% trans "Name" %}</th>
128 <th>{% trans "Match" %}</th>
129 <th style="text-align: center;">{% trans "Then" %}</th>
130 <th style="text-align: center;">{% trans "Status" %}</th>
131 {% comment %}<th style="text-align: center;">{% trans "Details" %}</th>{% endcomment %}
132 <th style="text-align: center;">{% trans "Applier" %}</th>
133 <th style="text-align: center;">{% trans "Expires" %}</th>
134 <th style="text-align: center;">{% trans "Response" %}</th>
135 <th style="text-align: center; width:140px;">{% trans "Actions" %}</th>
140 {% for route in routes %}
142 <tr {% ifequal route.status 'ACTIVE' %} class="GradeA" {% else %} class="GradeX" {% endifequal %}>
143 <td>{{ route.name }}</td>
144 <td>{{ route.get_match|safe|escape }}</td>
145 <td style="text-align: center;">{{route.get_then|safe|escape}}</td>
146 <td style="text-align: center;">{{route.status}}</td>
147 {% comment %}<td style="text-align: center;">{{ route.response }}</td>{% endcomment %}
148 <td style="text-align: center;">{{ route.applier }}</td>
149 <td style="text-align: center;">{{ route.expires }}</td>
150 <td style="text-align: center;">{{ route.response }}</td>
151 <td style="text-align: center;">
152 {% ifequal route.status 'ACTIVE' %}
153 <a href="{% url edit-route route.name %}" class="edit_button" id="edit_button_{{route.pk}}">Edit</a>
154 <button class="del_button" id="{{route.name}}" onclick="javascript:delete_route(this.id)">Del</button>
155 <a href="{% url delete-route route.name %}" style="display:none" id="del_route_{{route.name}}"></a>
157 {% ifequal route.status 'INACTIVE' %}
158 <a href="{% url edit-route route.name %}" class="edit_button" id="edit_button_{{route.pk}}">Reactivate</a>
160 {% ifequal route.status 'OUTOFSYNC' %}
161 <a href="{% url edit-route route.name %}" class="edit_button" id="edit_button_{{route.pk}}">ReSync</a>
166 {% endifequal %}</td>
173 <div id="dialog" title="Delete Route">
174 <p>You are about to delete route <strong><span id="route_to_delete"></span></strong></p>
175 <p>Deleting the route will automatically remove the configuration from the network and mark this route as inactive.</p>
176 <p>Are you sure you want to proceed?</p>
178 <div id="console" title="Console">
179 {% include "poll.html" %}