mirror of https://git.48k.eu/ogcp
Remove id from client's bubbles
Remove id from client's bubbles in the following commands: Power (Poweroff, Poweron, Reboot); Setup (Set boot mode, Set ogLive); Client (Start session) To make the string replacement, a custom jinja filter has been createdmaster
parent
52c5555f65
commit
555460f982
|
@ -34,3 +34,4 @@ def localeselector():
|
|||
return app.config.get('LANG', 'en')
|
||||
|
||||
import ogcp.views
|
||||
import ogcp.filters
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
from ogcp import app
|
||||
import re
|
||||
|
||||
@app.template_filter('remove_id')
|
||||
def remove_id(s):
|
||||
return re.sub(r'_\d+$', '', s)
|
||||
|
|
@ -104,7 +104,7 @@
|
|||
{% set max_clients = 50 %}
|
||||
{% for name_id, ip in selected_clients[:max_clients] %}
|
||||
<div id="pill-{{ name_id|replace(".", "_")|replace(" ", "_") }}" class="badge badge-pill og-pill badge-light">
|
||||
{{ name_id }}<br>{{ ip }}
|
||||
{{ name_id|remove_id }}<br>{{ ip }}
|
||||
</div>
|
||||
{% if loop.last and (selected_clients|length > max_clients) %}
|
||||
<div class="badge badge-pill badge-light">...</div>
|
||||
|
|
Loading…
Reference in New Issue