router_list.html/user.html: Make status column sortable

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2018-08-31 23:01:46 +02:00
parent bdff2b74b0
commit 5c4360b944
2 changed files with 4 additions and 11 deletions

View File

@ -46,7 +46,7 @@
<td class="text-responsive"><a href="{{ url_for("router_info", dbid=router.id) }}">{{ router.hostname }}</a>
{%- if router.reset %} - <span style="color:#d90000">Reset!</span>{%- endif %}{%- if router.blocked and not router.v2 %} - <span style="color:#d90000">Blocked!</span>{%- endif %}
</td>
<td class="text-center"><span class="{{ router.status|status2css }}">{{ router.status }}</span></td>
<td class="text-center" data-order="{{ router.status }}"><span class="{{ router.status|status2css }}">{{ router.status }}</span></td>
<td{%- if router.local %} class="hoodlocal"{%- elif router.v2 %} class="hoodv2"{%- endif %}>{{ router.hood }}</td>
<td>{{ router.nickname if router.nickname else "" }}</td>
<td class="text-nowrap">{{ router.hardware }}</td>
@ -67,13 +67,7 @@
$("#routerlist").DataTable({
"paging": false,
"info": false,
"searching": false,
/*"responsive": {
"details": false
},*/
"columnDefs": [
{"orderable": false, "targets": 1},
]
"searching": false
});
});
</script>

View File

@ -106,7 +106,7 @@
<td class="text-nowrap-responsive"><a href="{{ url_for("router_info", dbid=router.id) }}">{{ router.hostname }}</a>
{%- if router.reset %} - <span style="color:#d90000">Reset!</span>{%- endif %}{%- if router.blocked and not router.v2 %} - <span style="color:#d90000">Blocked!</span>{%- endif %}
</td>
<td class="text-center"><span class="{{ router.status|status2css }}">{{ router.status }}</span></td>
<td class="text-center" data-order="{{ router.status }}"><span class="{{ router.status|status2css }}">{{ router.status }}</span></td>
<td{%- if router.local %} class="hoodlocal"{%- elif router.v2 %} class="hoodv2"{%- endif %}>{{ router.hood }}</td>
<td>{{ router.firmware }}</td>
<td class="text-nowrap">{{ router.get("hardware", "") }}</td>
@ -132,8 +132,7 @@
"details": false
},*/
"columnDefs": [
{"orderable": false, "targets": 1},
{"orderable": false, "targets": -2},
{"orderable": false, "targets": -2}
]
});
});