mirror of
https://github.com/pablorevilla-meshtastic/meshview.git
synced 2026-03-04 23:27:46 +01:00
Add a UI for the portnum filter.
There was some code to filter by portnum around in the node search so put a quick UI on it. It currently breaks if you click the TX/RX and Uplinked buttons.
This commit is contained in:
@@ -16,6 +16,9 @@
|
||||
.htmx-request .htmx-indicator{
|
||||
opacity:1
|
||||
}
|
||||
#search_form {
|
||||
z-index: 4000;
|
||||
}
|
||||
{% block css %}
|
||||
{% endblock %}
|
||||
</style>
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
id="node_options"
|
||||
>
|
||||
{% for option in node_options %}
|
||||
<option value="{{option.id}}">{{option.id}} -- {{option.long_name}} ({{option.short_name}})</option)>
|
||||
<option value="{{option.id}}">{{option.id}} -- {{option.long_name}} ({{option.short_name}})</option>
|
||||
{% endfor %}
|
||||
</datalist>
|
||||
|
||||
@@ -1,23 +1,44 @@
|
||||
<form
|
||||
class="container-fluid p-2 sticky-top mx-auto"
|
||||
class="container p-2 sticky-top mx-auto"
|
||||
id="search_form"
|
||||
style="width: 80%;"
|
||||
action="/node_search"
|
||||
>
|
||||
<input
|
||||
id="q"
|
||||
type="text"
|
||||
name="q"
|
||||
placeholder="Node id"
|
||||
autocomplete="off"
|
||||
size="100"
|
||||
list="node_options"
|
||||
value="{{raw_node_id}}"
|
||||
hx-trigger="input delay:100ms"
|
||||
hx-get="/node_match"
|
||||
hx-target="#node_options"
|
||||
/>
|
||||
{% include "datalist.html" %}
|
||||
<input type="submit"/>
|
||||
<input type="reset"/>
|
||||
<div class="row">
|
||||
<input
|
||||
class="col m-2"
|
||||
id="q"
|
||||
type="text"
|
||||
name="q"
|
||||
placeholder="Node id"
|
||||
autocomplete="off"
|
||||
list="node_options"
|
||||
value="{{raw_node_id}}"
|
||||
hx-trigger="input delay:100ms"
|
||||
hx-get="/node_match"
|
||||
hx-target="#node_options"
|
||||
/>
|
||||
{% include "datalist.html" %}
|
||||
{% set options = {
|
||||
1: "Text Message",
|
||||
3: "Position",
|
||||
4: "Node Info",
|
||||
67: "Telemetry",
|
||||
71: "Neighbor Info",
|
||||
}
|
||||
%}
|
||||
<select name="portnum" class="col-2 m-2">
|
||||
<option
|
||||
value = ""
|
||||
{% if portnum not in options %}selected{% endif %}
|
||||
>All</option>
|
||||
{% for value, name in options.items() %}
|
||||
<option
|
||||
value="{{value}}"
|
||||
{% if value == portnum %}selected{% endif %}
|
||||
>{{ name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input type="submit" class="col-2 m-2"/>
|
||||
<input type="reset" class="col-2 m-2"/>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -170,6 +170,7 @@ async def node_search(request):
|
||||
packets=packets,
|
||||
packet_event="packet",
|
||||
node_options=options,
|
||||
portnum=portnum,
|
||||
),
|
||||
content_type="text/html",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user