1 {% extends "base.html" %}
4 {% if user.is_authenticated %}
5 <script type="text/javascript" src="{% url load-js 'poller' %}"></script>
7 <script type="text/javascript" src="/static/js/jquery.dataTables.js"></script>
8 <script type="text/javascript">
9 $(document).ready( function(){
10 $("#hid_mid").val('');
17 'Delete': function() {
18 route = $('#route_to_delete').text();
19 route_url_id = '#del_route_'+route;
20 url = $(route_url_id).attr('href');
24 success: function(data) {
25 $('#dialog').dialog('close');
26 window.setTimeout('location.reload()', 1000);
31 $('#dialog').dialog('close');
37 update_val = $("#hid_mid").val();
38 if (update_val == 'UPDATED'){
39 $("#hid_mid").val('');
40 window.setTimeout('location.reload()', 500);
44 $('#console').dialog({
50 update_val = $("#hid_mid").val();
51 if (update_val == 'UPDATED'){
52 $("#hid_mid").val('');
53 window.setTimeout('location.reload()', 500);
58 $('#routes_table').dataTable( {
61 {"bVisible": false, "bSearchable": false,"bSortable": false },
62 {"bSearchable": true,"bSortable": true},
63 {"bSearchable": true,"bSortable": true},
64 {"bSearchable": true,"bSortable": true},
65 {"bSearchable": true,"bSortable": true},
66 {"bSearchable": true,"bSortable": true},
67 {"bSearchable": true,"bSortable": true},
68 {"bSearchable": true,"bSortable": true},
69 {"bVisible": true, "bSearchable": false,"bSortable": false}
71 "aaSorting": [[0,'desc']],
73 "sLengthMenu": '{% trans "Display" %} <select><option value="25">25</option><option value="50">50</option><option value="-1">{% trans "All" %}</option></select> rules'
77 $( ".button_place #routebutton" ).button({
79 primary: "ui-icon-circle-plus"
82 $( " .edit_button" ).button({
84 primary: "ui-icon-wrench"
87 $( " .del_button" ).button({
89 primary: "ui-icon-circle-close"
93 $('#dialog').dialog('open');
96 $("#consolebutton").button({
98 primary: "ui-icon-image"
102 $("#consolebutton").stop().stop();
103 $("#consolebutton").css('color', '#555555');
104 $('#console').dialog('open');
108 $(".expiresclass").tooltip();
112 function delete_route(route){
114 $('#route_to_delete').text(route_name);
121 <style type="text/css">
123 background: none repeat scroll 0 0 #36102a !important;
124 color: #edeae8 !important;
125 font-family: monospace !important;
128 font-family: monospace !important;
132 background:transparent url(/static/black_arrow.png);
142 {% block title %}{% trans "My rules" %}{% endblock %}
144 <div style="float:left">
145 <h3 style="margin-top: 0px;">{% trans "My rules" %}</h3>
147 <div class='button_place' style="float:right">
148 <button id="consolebutton">Console</button> <a href="{% url add-route %}" id="routebutton">Add Rule</a>
150 <table class="display" width="100%" id="routes_table">
154 <th>{% trans "Name" %}</th>
155 <th>{% trans "Match" %}</th>
156 <th style="text-align: center;">{% trans "Then" %}</th>
157 <th style="text-align: center; ">{% trans "Status" %}</th>
158 {% comment %}<th style="text-align: center;">{% trans "Details" %}</th>{% endcomment %}
159 <th style="text-align: center;">{% trans "Applier" %}</th>
160 <th style="text-align: center;">{% trans "Expires" %}</th>
161 <th style="text-align: center;">{% trans "Response" %}</th>
162 <th style="text-align: center; width:180px;">{% trans "Actions" %}</th>
167 {% for route in routes %}
169 <tr {% ifequal route.status 'ACTIVE' %} class="GradeA" {% else %} class="GradeX" {% endifequal %}>
170 <td>{{ route.pk }}</td>
171 <td>{{ route.name }}</td>
172 <td>{{ route.get_match|safe|escape }}</td>
173 <td style="text-align: center;">{{route.get_then|safe|escape}}</td>
174 <td style="text-align: center; ">
176 {% if route.days_to_expire %}
178 style="border-bottom:2px dashed red;"
179 title="Expires {% ifequal route.days_to_expire '0' %}today{% else%}in {{route.days_to_expire}} day{{ route.days_to_expire|pluralize }}{% endifequal %}"
180 {% endif %}>{{route.status}}
183 {% comment %}<td style="text-align: center;">{{ route.response }}</td>{% endcomment %}
184 <td style="text-align: center;">{{ route.applier }}</td>
185 <td style="text-align: center;">{{ route.expires }}</td>
186 <td style="text-align: center;">{{ route.response }}</td>
187 <td style="text-align: center; width:180px;">
188 {% ifequal route.status 'ACTIVE' %}
189 <a href="{% url edit-route route.name %}" class="edit_button" id="edit_button_{{route.pk}}">Edit</a>
190 <button class="del_button" id="{{route.name}}" onclick="javascript:delete_route(this.id)">Del</button>
191 <a href="{% url delete-route route.name %}" style="display:none" id="del_route_{{route.name}}"></a>
193 {% ifequal route.status 'INACTIVE' %}
194 <a href="{% url edit-route route.name %}" class="edit_button" id="edit_button_{{route.pk}}">Reactivate</a>
196 {% ifequal route.status 'OUTOFSYNC' %}
197 <a href="{% url edit-route route.name %}" class="edit_button" id="edit_button_{{route.pk}}">ReSync</a>
210 <div id="dialog" title="Delete Route">
211 <p>You are about to delete rule <strong><span id="route_to_delete"></span></strong></p>
212 <p>Deleting the rule will automatically remove the configuration from the network and mark this route as inactive.</p>
213 <p>Are you sure you want to proceed?</p>
215 <div id="console" title="Console">
216 {% include "poll.html" %}