root / templates / user_routes.html @ 861e8360
History | View | Annotate | Download (13.2 kB)
1 | 064ecc91 | Leonidas Poulopoulos | {% extends "base.html" %} |
---|---|---|---|
2 | 064ecc91 | Leonidas Poulopoulos | {% load i18n %} |
3 | 064ecc91 | Leonidas Poulopoulos | {% block extrahead %} |
4 | bec1a51b | Leonidas Poulopoulos | {% if user.is_authenticated %} |
5 | bec1a51b | Leonidas Poulopoulos | <script type="text/javascript" src="{% url load-js 'poller' %}"></script> |
6 | bec1a51b | Leonidas Poulopoulos | {% endif %} |
7 | 548848ba | Leonidas Poulopoulos | <script type="text/javascript" src="/fodstatic/js/jquery.dataTables.js"></script> |
8 | 548848ba | Leonidas Poulopoulos | <script type="text/javascript" src="/fodstatic/js/datatables_bootstrap.js"></script> |
9 | 62ee35d6 | Leonidas Poulopoulos | |
10 | 064ecc91 | Leonidas Poulopoulos | <script type="text/javascript"> |
11 | 62ee35d6 | Leonidas Poulopoulos | |
12 | c78c4531 | Leonidas Poulopoulos | $(document).ready(function(){
|
13 | 62ee35d6 | Leonidas Poulopoulos | $('[rel=tooltip]').tooltip();
|
14 | c78c4531 | Leonidas Poulopoulos | $("#hid_mid").val('');
|
15 | c78c4531 | Leonidas Poulopoulos | $('#dialog').dialog({
|
16 | 2e52e8a5 | Leonidas Poulopoulos | height: 250,
|
17 | 2e52e8a5 | Leonidas Poulopoulos | width: 340,
|
18 | c78c4531 | Leonidas Poulopoulos | modal: true,
|
19 | c78c4531 | Leonidas Poulopoulos | autoOpen: false,
|
20 | c78c4531 | Leonidas Poulopoulos | buttons: {
|
21 | 82d8e9a1 | Leonidas Poulopoulos | '{% trans "Deactivate" %}': function(){
|
22 | c78c4531 | Leonidas Poulopoulos | route = $('#route_to_delete').text();
|
23 | c78c4531 | Leonidas Poulopoulos | route_url_id = '#del_route_' + route;
|
24 | c78c4531 | Leonidas Poulopoulos | url = $(route_url_id).attr('href');
|
25 | c78c4531 | Leonidas Poulopoulos | $.ajax({
|
26 | c78c4531 | Leonidas Poulopoulos | url: url,
|
27 | c78c4531 | Leonidas Poulopoulos | cache: false,
|
28 | c78c4531 | Leonidas Poulopoulos | success: function(data){
|
29 | c78c4531 | Leonidas Poulopoulos | $('#dialog').dialog('close');
|
30 | c78c4531 | Leonidas Poulopoulos | window.setTimeout('location.reload()', 1000);
|
31 | c78c4531 | Leonidas Poulopoulos | }
|
32 | c78c4531 | Leonidas Poulopoulos | });
|
33 | 9cad4715 | Leonidas Poulopoulos | },
|
34 | ab02d61c | Leonidas Poulopoulos | '{% trans "Cancel" %}': function(){
|
35 | c78c4531 | Leonidas Poulopoulos | $('#dialog').dialog('close');
|
36 | 3e99e2d1 | Leonidas Poulopoulos | },
|
37 | c78c4531 | Leonidas Poulopoulos | },
|
38 | c78c4531 | Leonidas Poulopoulos | close: function(){
|
39 | c78c4531 | Leonidas Poulopoulos | update_val = $("#hid_mid").val();
|
40 | c78c4531 | Leonidas Poulopoulos | if (update_val == 'UPDATED') {
|
41 | c78c4531 | Leonidas Poulopoulos | $("#hid_mid").val('');
|
42 | c78c4531 | Leonidas Poulopoulos | window.setTimeout('location.reload()', 500);
|
43 | c78c4531 | Leonidas Poulopoulos | }
|
44 | c78c4531 | Leonidas Poulopoulos | }
|
45 | c78c4531 | Leonidas Poulopoulos | });
|
46 | c78c4531 | Leonidas Poulopoulos | $('#console').dialog({
|
47 | c78c4531 | Leonidas Poulopoulos | height: 250,
|
48 | c78c4531 | Leonidas Poulopoulos | width: 800,
|
49 | c78c4531 | Leonidas Poulopoulos | modal: true,
|
50 | c78c4531 | Leonidas Poulopoulos | autoOpen: false,
|
51 | 083c9706 | Leonidas Poulopoulos | overlay: { opacity: 0.5, background: 'black'},
|
52 | c78c4531 | Leonidas Poulopoulos | close: function(){
|
53 | c78c4531 | Leonidas Poulopoulos | update_val = $("#hid_mid").val();
|
54 | c78c4531 | Leonidas Poulopoulos | if (update_val == 'UPDATED') {
|
55 | c78c4531 | Leonidas Poulopoulos | $("#hid_mid").val('');
|
56 | c78c4531 | Leonidas Poulopoulos | window.setTimeout('location.reload()', 500);
|
57 | c78c4531 | Leonidas Poulopoulos | }
|
58 | c78c4531 | Leonidas Poulopoulos | }
|
59 | c78c4531 | Leonidas Poulopoulos | });
|
60 | 083c9706 | Leonidas Poulopoulos | $('#console').parent().css('opacity', 0.9);
|
61 | 083c9706 | Leonidas Poulopoulos | $('#console').parent().css('filter', 'alpha(opacity=90)');
|
62 | 879c7fee | Leonidas Poulopoulos | $(".button_place #routebutton").button({
|
63 | 879c7fee | Leonidas Poulopoulos | icons: {
|
64 | 879c7fee | Leonidas Poulopoulos | primary: "ui-icon-circle-plus"
|
65 | 879c7fee | Leonidas Poulopoulos | },
|
66 | 879c7fee | Leonidas Poulopoulos | });
|
67 | 879c7fee | Leonidas Poulopoulos | $(".edit_button").button({
|
68 | 879c7fee | Leonidas Poulopoulos | icons: {
|
69 | 879c7fee | Leonidas Poulopoulos | primary: "ui-icon-wrench"
|
70 | 879c7fee | Leonidas Poulopoulos | },
|
71 | 62ee35d6 | Leonidas Poulopoulos | }).css('margin-bottom','2px');
|
72 | 879c7fee | Leonidas Poulopoulos | $(" .del_button").button({
|
73 | 879c7fee | Leonidas Poulopoulos | icons: {
|
74 | 879c7fee | Leonidas Poulopoulos | primary: "ui-icon-circle-close"
|
75 | 879c7fee | Leonidas Poulopoulos | },
|
76 | 879c7fee | Leonidas Poulopoulos | }).click(function(){
|
77 | 879c7fee | Leonidas Poulopoulos | $('#dialog').dialog('open');
|
78 | 879c7fee | Leonidas Poulopoulos | return false;
|
79 | 62ee35d6 | Leonidas Poulopoulos | });
|
80 | 62ee35d6 | Leonidas Poulopoulos | $("#consolebutton").button().click(function(){
|
81 | 879c7fee | Leonidas Poulopoulos | $("#consolebutton").stop().stop();
|
82 | 879c7fee | Leonidas Poulopoulos | $('#console').dialog('open');
|
83 | 879c7fee | Leonidas Poulopoulos | return false;
|
84 | 879c7fee | Leonidas Poulopoulos | });
|
85 | 62ee35d6 | Leonidas Poulopoulos | |
86 | 62ee35d6 | Leonidas Poulopoulos | |
87 | c78c4531 | Leonidas Poulopoulos | var oTable = $('#routes_table').dataTable({
|
88 | 62ee35d6 | Leonidas Poulopoulos | "sPaginationType": "bootstrap",
|
89 | 62ee35d6 | Leonidas Poulopoulos | "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>",
|
90 | c78c4531 | Leonidas Poulopoulos | "aoColumns": [{
|
91 | c78c4531 | Leonidas Poulopoulos | "bVisible": false,
|
92 | c78c4531 | Leonidas Poulopoulos | "bSearchable": false,
|
93 | c78c4531 | Leonidas Poulopoulos | "bSortable": false
|
94 | c78c4531 | Leonidas Poulopoulos | }, {
|
95 | c78c4531 | Leonidas Poulopoulos | "bSearchable": true,
|
96 | c78c4531 | Leonidas Poulopoulos | "bSortable": true
|
97 | c78c4531 | Leonidas Poulopoulos | }, {
|
98 | c78c4531 | Leonidas Poulopoulos | "bSearchable": true,
|
99 | c78c4531 | Leonidas Poulopoulos | "bSortable": true
|
100 | c78c4531 | Leonidas Poulopoulos | }, {
|
101 | c78c4531 | Leonidas Poulopoulos | "bSearchable": true,
|
102 | c78c4531 | Leonidas Poulopoulos | "bSortable": true
|
103 | c78c4531 | Leonidas Poulopoulos | }, {
|
104 | c78c4531 | Leonidas Poulopoulos | "bSearchable": true,
|
105 | c78c4531 | Leonidas Poulopoulos | "bSortable": true
|
106 | c78c4531 | Leonidas Poulopoulos | }, {
|
107 | c78c4531 | Leonidas Poulopoulos | "bSearchable": true,
|
108 | c78c4531 | Leonidas Poulopoulos | "bSortable": true
|
109 | c78c4531 | Leonidas Poulopoulos | }, {
|
110 | c78c4531 | Leonidas Poulopoulos | "bSearchable": true,
|
111 | c78c4531 | Leonidas Poulopoulos | "bSortable": true
|
112 | c78c4531 | Leonidas Poulopoulos | }, {
|
113 | c78c4531 | Leonidas Poulopoulos | "bSearchable": true,
|
114 | c78c4531 | Leonidas Poulopoulos | "bSortable": true
|
115 | c78c4531 | Leonidas Poulopoulos | }, {
|
116 | c78c4531 | Leonidas Poulopoulos | "bVisible": true,
|
117 | c78c4531 | Leonidas Poulopoulos | "bSearchable": false,
|
118 | c78c4531 | Leonidas Poulopoulos | "bSortable": false
|
119 | c78c4531 | Leonidas Poulopoulos | }],
|
120 | c78c4531 | Leonidas Poulopoulos | "aaSorting": [[0, 'desc']],
|
121 | c78c4531 | Leonidas Poulopoulos | "iDisplayLength": 25,
|
122 | 62ee35d6 | Leonidas Poulopoulos | "oSearch": {"bSmart": false, "bRegex":true},
|
123 | ab02d61c | Leonidas Poulopoulos | "oLanguage": {
|
124 | ab02d61c | Leonidas Poulopoulos | "sLengthMenu": '{% trans "Display" %} <select><option value="25">25</option><option value="50">50</option><option value="-1">{% trans "All" %}</option></select> {% trans "rules" %}',
|
125 | ab02d61c | Leonidas Poulopoulos | "sProcessing": "Processing...",
|
126 | ab02d61c | Leonidas Poulopoulos | "sZeroRecords": '{% trans "No records to display" %}',
|
127 | ab02d61c | Leonidas Poulopoulos | "sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
|
128 | ab02d61c | Leonidas Poulopoulos | "sInfoEmpty": "{% trans "Showing 0 to 0 of 0 entries" %}",
|
129 | ab02d61c | Leonidas Poulopoulos | "sInfoFiltered": "(filtered from _MAX_ total entries)",
|
130 | ab02d61c | Leonidas Poulopoulos | "sInfoPostFix": "",
|
131 | ab02d61c | Leonidas Poulopoulos | "sSearch": '{% trans "Search:" %}',
|
132 | ab02d61c | Leonidas Poulopoulos | "sUrl": "",
|
133 | ab02d61c | Leonidas Poulopoulos | "oPaginate": {
|
134 | ab02d61c | Leonidas Poulopoulos | "sFirst": '{% trans "First" %}',
|
135 | ab02d61c | Leonidas Poulopoulos | "sPrevious": '{% trans "Previous" %}',
|
136 | ab02d61c | Leonidas Poulopoulos | "sNext": '{% trans "Next" %}',
|
137 | ab02d61c | Leonidas Poulopoulos | "sLast": '{% trans "Last" %}'
|
138 | ab02d61c | Leonidas Poulopoulos | }
|
139 | ab02d61c | Leonidas Poulopoulos | }
|
140 | c78c4531 | Leonidas Poulopoulos | });
|
141 | 62ee35d6 | Leonidas Poulopoulos | |
142 | c78c4531 | Leonidas Poulopoulos | oTable.fnDraw();
|
143 | c78c4531 | Leonidas Poulopoulos |
|
144 | c78c4531 | Leonidas Poulopoulos | var reg_exp = '';
|
145 | c78c4531 | Leonidas Poulopoulos | var checkboxs = document.getElementsByName('status_filter');
|
146 | c78c4531 | Leonidas Poulopoulos | for (var i = 0, inp; inp = checkboxs[i]; i++) {
|
147 | c78c4531 | Leonidas Poulopoulos | checkCookie = readCookie("cookie_" + inp.value);
|
148 | c78c4531 | Leonidas Poulopoulos | if (checkCookie) {
|
149 | c78c4531 | Leonidas Poulopoulos | if (checkCookie == 'true') {
|
150 | 62ee35d6 | Leonidas Poulopoulos | $(inp).addClass('active');
|
151 | c78c4531 | Leonidas Poulopoulos | }
|
152 | c78c4531 | Leonidas Poulopoulos | else {
|
153 | 62ee35d6 | Leonidas Poulopoulos | $(inp).removeClass('active');
|
154 | c78c4531 | Leonidas Poulopoulos | }
|
155 | c78c4531 | Leonidas Poulopoulos | }
|
156 | c78c4531 | Leonidas Poulopoulos |
|
157 | 62ee35d6 | Leonidas Poulopoulos | if (inp.type.toLowerCase() == 'button' && $(inp).hasClass('active')) {
|
158 | c78c4531 | Leonidas Poulopoulos | reg_exp = reg_exp + inp.value + '|';
|
159 | c78c4531 | Leonidas Poulopoulos | }
|
160 | c78c4531 | Leonidas Poulopoulos |
|
161 | c78c4531 | Leonidas Poulopoulos | }
|
162 | c78c4531 | Leonidas Poulopoulos | if (reg_exp == '') {
|
163 | 62ee35d6 | Leonidas Poulopoulos | reg_exp = '|'
|
164 | c78c4531 | Leonidas Poulopoulos | }
|
165 | 442e21b6 | Leonidas Poulopoulos |
|
166 | 442e21b6 | Leonidas Poulopoulos |
|
167 | c78c4531 | Leonidas Poulopoulos | oTable.fnFilter(reg_exp.slice(0, -1), 4, true);
|
168 | c78c4531 | Leonidas Poulopoulos |
|
169 | 62ee35d6 | Leonidas Poulopoulos |
|
170 | 62ee35d6 | Leonidas Poulopoulos | $('button[name="status_filter"]').click(function(){
|
171 | 62ee35d6 | Leonidas Poulopoulos | var reg_exp = '';
|
172 | 62ee35d6 | Leonidas Poulopoulos | var checkboxs = document.getElementsByName('status_filter');
|
173 | 62ee35d6 | Leonidas Poulopoulos | $(this).button('toggle');
|
174 | 62ee35d6 | Leonidas Poulopoulos | for (var i = 0, inp; inp = checkboxs[i]; i++) {
|
175 | 62ee35d6 | Leonidas Poulopoulos | if (inp.type.toLowerCase() == 'button' && $(inp).hasClass('active')) {
|
176 | 62ee35d6 | Leonidas Poulopoulos | reg_exp = reg_exp + inp.value + '|';
|
177 | c78c4531 | Leonidas Poulopoulos | }
|
178 | 62ee35d6 | Leonidas Poulopoulos | createCookie("cookie_" + inp.value, $(inp).hasClass('active'), 30);
|
179 | 62ee35d6 | Leonidas Poulopoulos | }
|
180 | 62ee35d6 | Leonidas Poulopoulos | //passing an empty string will result in no filter
|
181 | 62ee35d6 | Leonidas Poulopoulos | //thus, it must be set to something that will not exist in the column
|
182 | 62ee35d6 | Leonidas Poulopoulos | if (reg_exp == '') {
|
183 | 62ee35d6 | Leonidas Poulopoulos | reg_exp = '|'
|
184 | 62ee35d6 | Leonidas Poulopoulos | }
|
185 | 62ee35d6 | Leonidas Poulopoulos | oTable.fnFilter(reg_exp.slice(0, -1), 4, regex=true);
|
186 | 62ee35d6 | Leonidas Poulopoulos | return false;
|
187 | c78c4531 | Leonidas Poulopoulos | });
|
188 | 62ee35d6 | Leonidas Poulopoulos | |
189 | 62ee35d6 | Leonidas Poulopoulos |
|
190 | c78c4531 | Leonidas Poulopoulos | });
|
191 | 9cad4715 | Leonidas Poulopoulos |
|
192 | 3e99e2d1 | Leonidas Poulopoulos | function delete_route(route){
|
193 | 3e99e2d1 | Leonidas Poulopoulos | route_name = route;
|
194 | 3e99e2d1 | Leonidas Poulopoulos | $('#route_to_delete').text(route_name);
|
195 | 3e99e2d1 | Leonidas Poulopoulos | return false;
|
196 | 3e99e2d1 | Leonidas Poulopoulos | }
|
197 | 9cad4715 | Leonidas Poulopoulos | |
198 | 9cad4715 | Leonidas Poulopoulos | |
199 | 9cad4715 | Leonidas Poulopoulos | |
200 | 064ecc91 | Leonidas Poulopoulos | </script>
|
201 | 3e99e2d1 | Leonidas Poulopoulos | <style type="text/css"> |
202 | 3e99e2d1 | Leonidas Poulopoulos | #console { |
203 | 3e99e2d1 | Leonidas Poulopoulos | background: none repeat scroll 0 0 #36102a !important; |
204 | 3e99e2d1 | Leonidas Poulopoulos | color: #edeae8 !important; |
205 | 3e99e2d1 | Leonidas Poulopoulos | font-family: monospace !important; |
206 | 3e99e2d1 | Leonidas Poulopoulos | } |
207 | 3e99e2d1 | Leonidas Poulopoulos | .message { |
208 | 3e99e2d1 | Leonidas Poulopoulos | font-family: monospace !important; |
209 | 3e99e2d1 | Leonidas Poulopoulos | } |
210 | 62ee35d6 | Leonidas Poulopoulos | |
211 | 3e99e2d1 | Leonidas Poulopoulos | |
212 | 3e99e2d1 | Leonidas Poulopoulos | </style>
|
213 | 064ecc91 | Leonidas Poulopoulos | {% endblock %} |
214 | 33e8f0b8 | Leonidas Poulopoulos | {% block title %}{% trans "My rules" %}{% endblock %} |
215 | 064ecc91 | Leonidas Poulopoulos | {% block content %} |
216 | ff8bc42e | Leonidas Poulopoulos | {% csrf_token %} |
217 | 62ee35d6 | Leonidas Poulopoulos | <div class="row-fluid"> |
218 | 62ee35d6 | Leonidas Poulopoulos | <div class="span2"> |
219 | 9cad4715 | Leonidas Poulopoulos | <div style="float:left"> |
220 | 62ee35d6 | Leonidas Poulopoulos | <h4>{% trans "My rules" %}</h4> |
221 | 62ee35d6 | Leonidas Poulopoulos | </div>
|
222 | 9cad4715 | Leonidas Poulopoulos | </div>
|
223 | 62ee35d6 | Leonidas Poulopoulos | |
224 | 62ee35d6 | Leonidas Poulopoulos | <div class="span10"> |
225 | 9cad4715 | Leonidas Poulopoulos | <div class='button_place' style="float:right"> |
226 | 82d8e9a1 | Leonidas Poulopoulos | <button id="consolebutton" class="btn btn-inverse"> |
227 | 62ee35d6 | Leonidas Poulopoulos | <i class="icon-tasks icon-white" style="align:left;"></i>{% trans "Console" %}</button> |
228 | 82d8e9a1 | Leonidas Poulopoulos | <a href="{% url add-route %}" id="routebutton" class="btn btn-primary"><i class="icon-plus-sign icon-white"></i>{% trans "Add Rule" %}</a> |
229 | 62ee35d6 | Leonidas Poulopoulos | </div>
|
230 | 9cad4715 | Leonidas Poulopoulos | </div>
|
231 | 62ee35d6 | Leonidas Poulopoulos | </div>
|
232 | bd647319 | Leonidas Poulopoulos | <hr>
|
233 | 62ee35d6 | Leonidas Poulopoulos | <div class="row-fluid" style="padding-top:30px;"> |
234 | c78c4531 | Leonidas Poulopoulos | |
235 | 62ee35d6 | Leonidas Poulopoulos | <div id='itoggle' class="span12" style="text-align:center;"> |
236 | 62ee35d6 | Leonidas Poulopoulos | <div class="btn-group" data-toggle="buttons-checkbox"> |
237 | 62ee35d6 | Leonidas Poulopoulos | <button type="button" class="btn btn-small" name="status_filter" value="ACTIVE" id="show_active">Active</button> |
238 | 82d8e9a1 | Leonidas Poulopoulos | <button type="button" class="btn btn-small" name="status_filter" value="DEACTIVATED" id="show_inactive">Deactivated</button> |
239 | 62ee35d6 | Leonidas Poulopoulos | <button type="button" class="btn btn-small" name="status_filter" value="ERROR" id="show_error">Error</button> |
240 | 62ee35d6 | Leonidas Poulopoulos | <button type="button" class="btn btn-small" name="status_filter" value="PENDING" id="show_pending">Pending</button> |
241 | 62ee35d6 | Leonidas Poulopoulos | </div>
|
242 | c78c4531 | Leonidas Poulopoulos | </div>
|
243 | 62ee35d6 | Leonidas Poulopoulos | |
244 | 62ee35d6 | Leonidas Poulopoulos | </div>
|
245 | 62ee35d6 | Leonidas Poulopoulos | |
246 | 62ee35d6 | Leonidas Poulopoulos | <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" width="100%" id="routes_table"> |
247 | 064ecc91 | Leonidas Poulopoulos | <thead>
|
248 | 064ecc91 | Leonidas Poulopoulos | <tr>
|
249 | b27537d5 | Leonidas Poulopoulos | <th>Id</th> |
250 | 064ecc91 | Leonidas Poulopoulos | <th>{% trans "Name" %}</th> |
251 | 064ecc91 | Leonidas Poulopoulos | <th>{% trans "Match" %}</th> |
252 | 064ecc91 | Leonidas Poulopoulos | <th style="text-align: center;">{% trans "Then" %}</th> |
253 | 7d408f6f | Leonidas Poulopoulos | <th style="text-align: center; ">{% trans "Status" %}</th> |
254 | 064ecc91 | Leonidas Poulopoulos | {% comment %}<th style="text-align: center;">{% trans "Details" %}</th>{% endcomment %} |
255 | 6ee21ffd | Leonidas Poulopoulos | <th style="text-align: center;">{% trans "Applier" %}</th> |
256 | 064ecc91 | Leonidas Poulopoulos | <th style="text-align: center;">{% trans "Expires" %}</th> |
257 | 9cad4715 | Leonidas Poulopoulos | <th style="text-align: center;">{% trans "Response" %}</th> |
258 | 6b747a1b | Leonidas Poulopoulos | <th style="text-align: center; width:180px;">{% trans "Actions" %}</th> |
259 | 064ecc91 | Leonidas Poulopoulos | </tr>
|
260 | 064ecc91 | Leonidas Poulopoulos | </thead>
|
261 | 064ecc91 | Leonidas Poulopoulos | |
262 | 064ecc91 | Leonidas Poulopoulos | <tbody>
|
263 | 064ecc91 | Leonidas Poulopoulos | {% for route in routes %} |
264 | 064ecc91 | Leonidas Poulopoulos | |
265 | 95450be6 | Leonidas Poulopoulos | <tr class="GradeC" > |
266 | b27537d5 | Leonidas Poulopoulos | <td>{{ route.pk }}</td> |
267 | 442e21b6 | Leonidas Poulopoulos | |
268 | 442e21b6 | Leonidas Poulopoulos | <td {% if %}style="color: #0088CC;"{% endif %}>{% if route.comments %}<span rel="tooltip" data-placement="top" title="{{route.comments}}">{{ route.name }}</span>{% else %}{{ route.name }}{% endif %}</td> |
269 | 442e21b6 | Leonidas Poulopoulos | |
270 | 064ecc91 | Leonidas Poulopoulos | <td>{{ route.get_match|safe|escape }}</td> |
271 | 442e21b6 | Leonidas Poulopoulos | |
272 | 064ecc91 | Leonidas Poulopoulos | <td style="text-align: center;">{{route.get_then|safe|escape}}</td> |
273 | 442e21b6 | Leonidas Poulopoulos | |
274 | 62ee35d6 | Leonidas Poulopoulos | <td style="text-align: center; ">{% if route.status == 'EXPIRED' or route.status == 'ADMININACTIVE' or route.status == 'INACTIVE' or route.status == 'OUTOFSYNC'%} |
275 | 861e8360 | Leonidas Poulopoulos | {% if route.status == 'EXPIRED' or route.status == 'ADMININACTIVE' or route.status == 'INACTIVE' %}<span class="label">DEACTIVATED</span>{% else %}{% if route.status == 'OUTOFSYNC' %}<span class="label label-important">ERROR</span>{% else %}{{route.status}}{% endif %}{% endif %}{% else %}{% if route.status == 'ACTIVE' %}<span class="label label-success">{{route.status}}</span>{% else %}{% if route.status == 'PENDING' %}<span class="label label-info">{{route.status}}</span>{% else %}<span class="label label-important">{{route.status}}</span>{% endif %}{% endif %}{% endif %}</td> |
276 | 442e21b6 | Leonidas Poulopoulos | |
277 | 442e21b6 | Leonidas Poulopoulos | {% comment %}<td style="text-align: center;">{{ route.response }}</td>{% endcomment %} |
278 | 442e21b6 | Leonidas Poulopoulos | |
279 | 442e21b6 | Leonidas Poulopoulos | <td style="text-align: center;">{{ route.applier }}</td> |
280 | 442e21b6 | Leonidas Poulopoulos | |
281 | 442e21b6 | Leonidas Poulopoulos | <td style="text-align: center;" nowrap |
282 | 442e21b6 | Leonidas Poulopoulos | <span {% if == 'EXPIRED' or == 'ADMININACTIVE' or == 'INACTIVE' or == 'OUTOFSYNC'%}{% else %}{% if %} |
283 | 442e21b6 | Leonidas Poulopoulos | data-placement="top" |
284 | 442e21b6 | Leonidas Poulopoulos | rel = 'tooltip' |
285 | 442e21b6 | Leonidas Poulopoulos | style="border-bottom:1px dashed red;" |
286 | 442e21b6 | Leonidas Poulopoulos | title="Expires {% ifequal route.days_to_expire '0' %}today{% else%}in {{route.days_to_expire}} day{{ route.days_to_expire|pluralize }}{% endifequal %}" |
287 | 442e21b6 | Leonidas Poulopoulos | {% endif %}{% endif %}>{{ route.expires|date:"d M y" }}</span></td> |
288 | 442e21b6 | Leonidas Poulopoulos | |
289 | 442e21b6 | Leonidas Poulopoulos | <td style="text-align: center; {% if route.status == 'EXPIRED' %} color: #0088CC; {% endif %}"> |
290 | 442e21b6 | Leonidas Poulopoulos | {% if route.status == 'EXPIRED' %} |
291 | 442e21b6 | Leonidas Poulopoulos | <span rel="tooltip" |
292 | 62ee35d6 | Leonidas Poulopoulos | {% if == 'EXPIRED' or == 'ADMININACTIVE' or == 'INACTIVE' or == 'OUTOFSYNC'%} |
293 | 62ee35d6 | Leonidas Poulopoulos | data-placement="top" |
294 | 62ee35d6 | Leonidas Poulopoulos | title = "{% ifequal route.status 'INACTIVE' %} |
295 | 82d8e9a1 | Leonidas Poulopoulos | {% trans 'Deactivated by user' %}
|
296 | 62ee35d6 | Leonidas Poulopoulos | {% else %}
|
297 | 62ee35d6 | Leonidas Poulopoulos | {% ifequal route.status 'ADMININACTIVE' %}
|
298 | 82d8e9a1 | Leonidas Poulopoulos | {% trans 'Deactivated by administrator' %}
|
299 | 62ee35d6 | Leonidas Poulopoulos | {% else %}
|
300 | 62ee35d6 | Leonidas Poulopoulos | {% ifequal route.status 'EXPIRED' %}
|
301 | 82d8e9a1 | Leonidas Poulopoulos | {% trans 'Deactivated due to expiration' %}
|
302 | 62ee35d6 | Leonidas Poulopoulos | {% else %}
|
303 | 62ee35d6 | Leonidas Poulopoulos | {% ifequal route.status 'OUTOFSYNC' %}
|
304 | 82d8e9a1 | Leonidas Poulopoulos | {% trans 'Syncronization error. Configuration in device differs from rule' %}
|
305 | 62ee35d6 | Leonidas Poulopoulos | {% endifequal %}
|
306 | 62ee35d6 | Leonidas Poulopoulos | {% endifequal %}
|
307 | 62ee35d6 | Leonidas Poulopoulos | {% endifequal %}
|
308 | 62ee35d6 | Leonidas Poulopoulos | {% endifequal %}"
|
309 | 82d8e9a1 | Leonidas Poulopoulos | {% endif %}>{% trans "Rule expired" %}</span>{% else %}{% if route.status == 'OUTOFSYNC' %}{% trans 'Syncronization error. Configuration in device differs from rule' %}{% else %}{% if route.status == 'ADMININACTIVE' %}{% trans "Deactivated by administrator" %}{% else %}{% if route.status == 'INACTIVE' %}{% trans "Deactivated by user" %}{% else %}{{ route.response }}{% if route.status == 'PENDING' %}<img src="/fodstatic/dots.gif">{% endif %}{% endif %}{% endif %}{% endif %}{% endif %}</td> |
310 | 442e21b6 | Leonidas Poulopoulos | |
311 | 6b747a1b | Leonidas Poulopoulos | <td style="text-align: center; width:180px;"> |
312 | 97e42c7d | Leonidas Poulopoulos | {% ifequal route.status 'ACTIVE' %} |
313 | 62ee35d6 | Leonidas Poulopoulos | <a href="{% url edit-route route.name %}" class="edit_button btn btn-small" id="edit_button_{{route.pk}}">{% trans "Edit" %}</a> |
314 | 82d8e9a1 | Leonidas Poulopoulos | <button class="del_button btn btn-small" id="{{route.name}}" onclick="javascript:delete_route(this.id)">{% trans "Deactivate" %}</button> |
315 | 62ee35d6 | Leonidas Poulopoulos | <a href="{% url delete-route route.name %}" style="display:none" id="del_route_{{route.name}}" class="btn btn btn-danger btn-small"></a> |
316 | 3e99e2d1 | Leonidas Poulopoulos | {% else %} |
317 | 2e52e8a5 | Leonidas Poulopoulos | {% if route.status == 'EXPIRED' or route.status == 'ADMININACTIVE' or route.status == 'INACTIVE' %} |
318 | 62ee35d6 | Leonidas Poulopoulos | <a href="{% url edit-route route.name %}" class="edit_button btn btn-small" id="edit_button_{{route.pk}}">{% trans "Reactivate" %}</a> |
319 | 97e42c7d | Leonidas Poulopoulos | {% else %} |
320 | 6a946adf | Leonidas Poulopoulos | {% ifequal route.status 'OUTOFSYNC' %} |
321 | 62ee35d6 | Leonidas Poulopoulos | <a href="{% url edit-route route.name %}" class="edit_button btn btn-small" id="edit_button_{{route.pk}}">{% trans "ReSync" %}</a> |
322 | 6a946adf | Leonidas Poulopoulos | {% else %} |
323 | 736b67bf | Leonidas Poulopoulos | {% ifequal route.status 'ERROR' %} |
324 | 62ee35d6 | Leonidas Poulopoulos | <a href="{% url edit-route route.name %}" class="edit_button btn btn-small" id="edit_button_{{route.pk}}">{% trans "Fix it!" %}</a> |
325 | 736b67bf | Leonidas Poulopoulos | {% else %} |
326 | 3e99e2d1 | Leonidas Poulopoulos | - |
327 | 97e42c7d | Leonidas Poulopoulos | {% endifequal %} |
328 | 736b67bf | Leonidas Poulopoulos | {% endifequal %} |
329 | 2e52e8a5 | Leonidas Poulopoulos | {% endif %} |
330 | fb67376a | Leonidas Poulopoulos | {% endifequal %} |
331 | fb67376a | Leonidas Poulopoulos | </td>
|
332 | 064ecc91 | Leonidas Poulopoulos | </tr>
|
333 | 064ecc91 | Leonidas Poulopoulos | |
334 | 064ecc91 | Leonidas Poulopoulos | {% endfor %} |
335 | 064ecc91 | Leonidas Poulopoulos | </tbody>
|
336 | 064ecc91 | Leonidas Poulopoulos | </table>
|
337 | 82d8e9a1 | Leonidas Poulopoulos | <div id="dialog" title="{% trans "Deactivate " %}"> |
338 | 82d8e9a1 | Leonidas Poulopoulos | <p>{% blocktrans %}You are about to deactivate rule{% endblocktrans %} <strong><span id="route_to_delete"></span></strong></p> |
339 | 82d8e9a1 | Leonidas Poulopoulos | <p>{% blocktrans %}Deactivating the rule will automatically remove the configuration from the network and mark this rule as inactive.{% endblocktrans %}</p> |
340 | ab02d61c | Leonidas Poulopoulos | <p>{% blocktrans %}Are you sure you want to proceed?{% endblocktrans %}</p> |
341 | 3e99e2d1 | Leonidas Poulopoulos | </div>
|
342 | ab02d61c | Leonidas Poulopoulos | <div id="console" title="{% trans "Console" %}"> |
343 | 3e99e2d1 | Leonidas Poulopoulos | {% include "poll.html" %} |
344 | 3e99e2d1 | Leonidas Poulopoulos | </div>
|
345 | 064ecc91 | Leonidas Poulopoulos | {% endblock %} |