Don't show "Blocked" status for V2 routers

This affects only whether the status indication is SHOWN. It does
not affect the storage of this tag.

One can still en- or disable the blocked status of a V2 router via
the options menu.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2018-02-04 21:23:11 +01:00
parent d298cc7762
commit 7091cc5054
4 changed files with 6 additions and 6 deletions

View File

@ -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
SELECT router.id, hostname, status, hood, contact, nickname, hardware, router.created, sys_uptime, clients, reset, blocked, v2
FROM router
LEFT JOIN users ON router.contact = users.email
LEFT JOIN (
@ -346,7 +346,7 @@ def user_info(nickname):
else:
flash("<b>You are not authorized to perform this action!</b>", "danger")
routers = mysql.fetchall("""
SELECT id, hostname, status, hood, firmware, hardware, created, sys_uptime, clients, reset, blocked
SELECT id, hostname, status, hood, firmware, hardware, created, sys_uptime, clients, reset, blocked, v2
FROM router
LEFT JOIN (
SELECT router, blocked.mac AS blocked FROM router_netif

View File

@ -65,7 +65,7 @@
{%- endif %}
{%- if authadmin %}
<li><a href="#" onclick="$('#act').val('ban'); $('#actform').submit()">Ban Router</a></li>
<li><a href="#" onclick="$('#blockedform').submit()">Toggle blocked status</a></li>
<li><a href="#" onclick="$('#blockedform').submit()">{{ "Remove blocked status" if router.blocked else "Mark as blocked" }}</a></li>
{%- endif %}
<li><a href="#" onclick="$('#act').val('report'); $('#actform').submit()">Report abusive Router</a></li>
</ul>
@ -158,7 +158,7 @@
{%- endif %}
<tr><th>Hardware</th><td><span title="{{ router.chipset }}">{{ router.hardware }}</span></td></tr>
<tr><th>WAN Uplink</th><td><span class="{{ "glyphicon glyphicon-ok" if router.wan_uplink else "glyphicon glyphicon-remove" }}"></span>
{%- if router.blocked %}
{%- if router.blocked and not router.v2 %}
<span style="color:#d90000"> &nbsp; - &nbsp; Router BLOCKED by KeyXchange!</span>
{%- endif -%}
</td></tr>

View File

@ -43,7 +43,7 @@
{%- for router in routers %}
<tr>
<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 %} - <span style="color:#d90000">Blocked!</span>{%- endif %}
{%- 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>{{ router.hood }}</td>

View File

@ -104,7 +104,7 @@
{%- for router in routers %}
<tr>
<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 %} - <span style="color:#d90000">Blocked!</span>{%- endif %}
{%- 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>{{ router.hood }}</td>