diff --git a/README b/README index 7ac8311..1273ae6 100644 --- a/README +++ b/README @@ -28,5 +28,3 @@ Other Options: --topic MQTT Topic, default is 'msh/US/bayarea/#' - -Main Page diff --git a/meshview/store.py b/meshview/store.py index e0ff9df..3ff6118 100644 --- a/meshview/store.py +++ b/meshview/store.py @@ -524,7 +524,7 @@ async def get_nodes(role=None, channel=None, hw_model=None): """ try: async with database.async_session() as session: - print(channel) # Debugging output (consider replacing with logging) + #print(channel) # Debugging output (consider replacing with logging) # Start with a base query selecting all nodes query = select(Node) @@ -546,7 +546,6 @@ async def get_nodes(role=None, channel=None, hw_model=None): # Execute the query and retrieve results result = await session.execute(query) nodes = result.scalars().all() - return nodes # Return the list of nodes except Exception as e: diff --git a/meshview/templates/nodelist.html b/meshview/templates/nodelist.html index dd97b38..5f5436a 100644 --- a/meshview/templates/nodelist.html +++ b/meshview/templates/nodelist.html @@ -16,6 +16,7 @@ th, td { th { background-color: #1f1f1f; color: white; + cursor: pointer; } tr:nth-child(even) { @@ -25,37 +26,86 @@ tr:nth-child(even) { tr:nth-child(odd) { background-color: #222; } + +.search-container { + display: flex; + gap: 10px; + margin-bottom: 10px; +} + +.search, .filter-role, .filter-channel, .export-btn { + padding: 8px; + border: 1px solid #333; + border-radius: 4px; +} + +.filter-role, .filter-channel { + cursor: pointer; +} + +.export-btn { + background: #28a745; + color: white; + border: none; + cursor: pointer; +} + +.export-btn:hover { + background: #218838; +} {% endblock %} {% block body %} -
+
+
+ + + + + + + + + +
+ {% if nodes %} - +
- - - - - - - - - + + + + + + + + + - + {% for node in nodes %} - - - - - - - - - + + + + + + + + + {% endfor %} @@ -64,4 +114,56 @@ tr:nth-child(odd) {

No nodes found.

{% endif %} + + + {% endblock %} diff --git a/meshview/web.py b/meshview/web.py index 05a7658..63e42d7 100644 --- a/meshview/web.py +++ b/meshview/web.py @@ -1477,9 +1477,9 @@ async def nodelist(request): role = request.query.get("role") #print(role) channel = request.query.get("channel") - print(channel) + #print(channel) hw_model = request.query.get("hw_model") - print(hw_model) + #print(hw_model) nodes= await store.get_nodes(role,channel, hw_model) template = env.get_template("nodelist.html") return web.Response(
Long NameShort NameHW ModelFirmwareRoleLast LatitudeLast LongitudeChannelLast UpdateLong NameShort NameHW ModelFirmwareRoleLast LatitudeLast LongitudeChannelLast Update
{{node.long_name}}{{ node.short_name }}{{node.hw_model if node.hw_model else "N/A"}}{{ node.firmware }}{{node.role if node.role else "N/A"}}{{ "{:.7f}".format(node.last_lat / 10**7) if node.last_lat else "N/A" }}{{ "{:.7f}".format(node.last_long / 10**7) if node.last_long else "N/A" }}{{node.channel if node.channel else "N/A"}}{{ node.last_update.strftime('%-I:%M:%S %p - %m-%d-%Y') if node.last_update else "N/A" }} {{ node.long_name }}{{ node.short_name }}{{ node.hw_model if node.hw_model else "N/A" }}{{ node.firmware }}{{ node.role if node.role else "N/A" }}{{ "{:.7f}".format(node.last_lat / 10**7) if node.last_lat else "N/A" }}{{ "{:.7f}".format(node.last_long / 10**7) if node.last_long else "N/A" }}{{ node.channel if node.channel else "N/A" }}{{ node.last_update.strftime('%-I:%M:%S %p - %m-%d-%Y') if node.last_update else "N/A" }}