router_list.html: Show last contact
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
parent
c581915076
commit
b9aab43459
|
@ -51,7 +51,7 @@ def router_list():
|
|||
mysql = FreifunkMySQL()
|
||||
|
||||
routers = mysql.fetchall("""
|
||||
SELECT router.id, hostname, status, hood, contact, nickname, hardware, router.created, sys_uptime, clients, reset, blocked, v2
|
||||
SELECT router.id, hostname, status, hood, contact, nickname, hardware, router.created, sys_uptime, last_contact, clients, reset, blocked, v2
|
||||
FROM router
|
||||
LEFT JOIN users ON router.contact = users.email
|
||||
LEFT JOIN (
|
||||
|
@ -65,6 +65,7 @@ def router_list():
|
|||
""".format(where),tuple)
|
||||
mysql.close()
|
||||
routers = mysql.utcawaretuple(routers,"created")
|
||||
routers = mysql.utcawaretuple(routers,"last_contact")
|
||||
|
||||
return render_template("router_list.html", query_str=query_str, routers=routers, numrouters=len(routers))
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
<th style="padding-right: 5px;">Hardware</th>
|
||||
<th style="padding-right: 5px;">Created</th>
|
||||
<th style="padding-right: 5px;">Uptime</th>
|
||||
<th style="padding-right: 5px;">Last contact</th>
|
||||
<th>Clients</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -51,6 +52,7 @@
|
|||
<td class="text-nowrap">{{ router.hardware }}</td>
|
||||
<td class="text-nowrap">{{ router.created|utc2local|format_dt_date }}</td>
|
||||
<td class="text-nowrap">{{ router.sys_uptime|format_ts_diff }}</td>
|
||||
<td class="text-nowrap">{{ router.last_contact|utc2local|format_dt_date }}</td>
|
||||
<td>{{ router.clients }}</td>
|
||||
</tr>
|
||||
{%- endfor %}
|
||||
|
@ -71,7 +73,7 @@
|
|||
},*/
|
||||
"columnDefs": [
|
||||
{"orderable": false, "targets": 1},
|
||||
{"orderable": false, "targets": -2},
|
||||
{"orderable": false, "targets": -3},
|
||||
]
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue