helpers: Treat spaces in query string more correctly

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2017-11-15 13:49:50 +01:00
parent a16c50124c
commit 3be0cd12b3
2 changed files with 3 additions and 3 deletions

View File

@ -61,9 +61,9 @@ def parse_router_list_search_query(args):
elif key == 'mac':
k = no + "mac = %s"
t.append(value.lower())
elif key == 'hardware':
elif (key == 'hardware') or (key == 'hood'):
k = key + " {} REGEXP %s".format(no)
t.append(value.replace("_"," "))
t.append(value.replace("_","."))
elif (key == 'hostname') or (key == 'firmware'):
k = key + " {} REGEXP %s".format(no)
t.append(value)

View File

@ -63,7 +63,7 @@
</tr>
{%- for hood, value in hoods|dictsort %}
<tr>
<td class="firstrow"><a href="{{ url_for('router_list', q='hood:%s' % hood) }}">{{ hood }}</a></td>
<td class="firstrow"><a href="{{ url_for('router_list', q='hood:%s' % hood.replace(' ','_')) }}">{{ hood }}</a></td>
<td class="success">{{ value["online"] or 0 }}</td>
<td class="danger">{{ value["offline"] or 0 }}</td>
<td class="warning">{{ value["unknown"] or 0 }}</td>