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(){
13 'Delete': function() {
14 route = $('#route_to_delete').text();
15 route_url_id = '#del_route_'+route;
16 console.log(route_url_id);
17 url = $(route_url_id).attr('href');
18 console.log(route, url);
22 success: function(data) {
23 $('#dialog').dialog('close');
26 // $('#dialog').dialog('close');
29 $('#dialog').dialog('close');
33 $('#console').dialog({
39 $('#routes_table').dataTable( {
42 "sLengthMenu": '{% trans "Display" %} <select><option value="25">25</option><option value="50">50</option><option value="-1">{% trans "All" %}</option></select> routes'
46 $( ".button_place #routebutton" ).button({
48 primary: "ui-icon-circle-plus"
51 $( " .edit_button" ).button({
53 primary: "ui-icon-wrench"
56 $( " .del_button" ).button({
58 primary: "ui-icon-circle-close"
62 $('#dialog').dialog('open');
65 $("#consolebutton").button({
67 primary: "ui-icon-image"
71 $("#consolebutton").stop().stop();
72 $("#consolebutton").css('color', '#555555');
73 $('#console').dialog('open');
78 function delete_route(route){
80 $('#route_to_delete').text(route_name);
87 <style type="text/css">
89 background: none repeat scroll 0 0 #36102a !important;
90 color: #edeae8 !important;
91 font-family: monospace !important;
94 font-family: monospace !important;
99 {% block title %}{% trans "My routes" %}{% endblock %}
101 <div style="float:left">
102 <h3 style="margin-top: 0px;">{% trans "My routes" %}</h3>
104 <div class='button_place' style="float:right">
105 <button id="consolebutton">Console</button> <a href="{% url add-route %}" id="routebutton">Add Route</a>
107 <table class="display" width="100%" id="routes_table">
110 <th>{% trans "Name" %}</th>
111 <th>{% trans "Match" %}</th>
112 <th style="text-align: center;">{% trans "Then" %}</th>
113 <th style="text-align: center;">{% trans "Status" %}</th>
114 {% comment %}<th style="text-align: center;">{% trans "Details" %}</th>{% endcomment %}
115 <th style="text-align: center;">{% trans "Applier" %}</th>
116 <th style="text-align: center;">{% trans "Expires" %}</th>
117 <th style="text-align: center;">{% trans "Response" %}</th>
118 <th style="text-align: center; width:120px;">{% trans "Actions" %}</th>
123 {% for route in routes %}
125 <tr {% if route.is_online %} class="GradeA" {% else %} class="GradeX" {% endif %}>
126 <td>{{ route.name }}</td>
127 <td>{{ route.get_match|safe|escape }}</td>
128 <td style="text-align: center;">{{route.get_then|safe|escape}}</td>
129 <td style="text-align: center;">{% if route.is_online %}Online{% else %}Offline{% endif %}</td>
130 {% comment %}<td style="text-align: center;">{{ route.response }}</td>{% endcomment %}
131 <td style="text-align: center;">{{ route.applier }}</td>
132 <td style="text-align: center;">{{ route.expires }}</td>
133 <td style="text-align: center;">{{ route.response }}</td>
134 <td style="text-align: center;">
135 {% if route.is_active %}
136 <a href="{% url edit-route route.name %}" class="edit_button" id="edit_button_{{route.pk}}">Edit</a>
137 <button class="del_button" id="{{route.name}}" onclick="javascript:delete_route(this.id)">Del</button>
138 <a href="{% url delete-route route.name %}" style="display:none" id="del_route_{{route.name}}"></a>
148 <div id="dialog" title="Delete Route">
149 <p>You are about to delete route <strong><span id="route_to_delete"></span></strong></p>
150 <p>Deleting the route will automatically remove the configuration from the network and mark this route as inactive.</p>
151 <p>Are you sure you want to proceed?</p>
153 <div id="console" title="Console">
154 {% include "poll.html" %}