From 0c46891f13c615e02d0b3952f760fd7b867ed146 Mon Sep 17 00:00:00 2001 From: madeofstown Date: Mon, 20 Jan 2025 20:23:27 -0800 Subject: [PATCH] Graphs and Dark Mode --- meshview/templates/base.html | 2 +- meshview/templates/chat.html | 4 +-- meshview/templates/firehose.html | 4 +-- meshview/templates/node.html | 19 +++++++------ meshview/templates/node_graphs.html | 43 +++++++++++++++++++++++------ meshview/templates/packet_list.html | 2 +- meshview/web.py | 25 +++++++++++++++++ requirements.txt | 1 - 8 files changed, 77 insertions(+), 23 deletions(-) diff --git a/meshview/templates/base.html b/meshview/templates/base.html index a1d207c..5e64342 100644 --- a/meshview/templates/base.html +++ b/meshview/templates/base.html @@ -1,5 +1,5 @@ - + MeshView - Bay Area Mesh - http://bayme.sh {% if node and node.short_name %}-- {{node.short_name}}{% endif %} diff --git a/meshview/templates/chat.html b/meshview/templates/chat.html index b40e7be..48eb783 100644 --- a/meshview/templates/chat.html +++ b/meshview/templates/chat.html @@ -5,10 +5,10 @@ min-width:10em; } .chat-packet:nth-of-type(odd){ - background-color:#CCC; + background-color:#1f1f1f; } .chat-packet:nth-of-type(even){ - background-color:#EEE; + background-color:#181818; } {% endblock %} diff --git a/meshview/templates/firehose.html b/meshview/templates/firehose.html index fcfe27f..c5e36b8 100644 --- a/meshview/templates/firehose.html +++ b/meshview/templates/firehose.html @@ -26,14 +26,14 @@
-
+
{% for packet in packets %} {% include 'packet.html' %} {% else %} No packets found. {% endfor %}
-
+
{% endblock %} diff --git a/meshview/templates/node.html b/meshview/templates/node.html index d5cb012..88f7da6 100644 --- a/meshview/templates/node.html +++ b/meshview/templates/node.html @@ -13,6 +13,9 @@ overflow: scroll; top: 3em; } + div.tab-pane > dl { + display: inline-block; + } {% endblock %} {% block body %} @@ -27,7 +30,7 @@ {% endif %} >
-
+
{% if node %}
@@ -35,11 +38,11 @@
-
short name
+
ShortName
{{node.short_name}}
-
hw model
+
HW Model
{{node.hw_model}}
-
role
+
Role
{{node.role}}
{% include "node_graphs.html" %} @@ -51,8 +54,8 @@ {% endif %}
-
-
+
+
@@ -63,10 +66,10 @@
+
{% include 'packet_list.html' %} -
-
+
diff --git a/meshview/templates/node_graphs.html b/meshview/templates/node_graphs.html index 7d27985..24fa0fe 100644 --- a/meshview/templates/node_graphs.html +++ b/meshview/templates/node_graphs.html @@ -11,7 +11,7 @@
  • - +
  • @@ -20,17 +20,44 @@
    - {{ graph("power") }} - {{ graph("chutil") }} +
    +
    Power
    +
    {{ graph("power") }}
    +
    +
    +
    ChUtil
    +
    {{ graph("chutil") }}
    +
    - {{ graph("temperature") }} - {{ graph("humidity") }} - {{ graph("wind_speed") }} - {{ graph("wind_direction") }} +
    +
    Temperature
    +
    {{ graph("temperature") }}
    +
    +
    +
    Humidity
    +
    {{ graph("humidity") }}
    +
    +
    +
    Pressure
    +
    {{ graph("pressure") }}
    +
    +
    +
    Indoor Air Quality
    +
    {{ graph("iaq") }}
    +
    +
    +
    Wind Speed
    +
    {{ graph("wind_speed") }}
    +
    +
    +
    Wind Direction
    +
    {{ graph("wind_direction") }}
    +
    {{ graph("power_metrics") }} diff --git a/meshview/templates/packet_list.html b/meshview/templates/packet_list.html index 42d1757..f90c58f 100644 --- a/meshview/templates/packet_list.html +++ b/meshview/templates/packet_list.html @@ -1,4 +1,4 @@ -
    +
    {% for packet in packets %} {% include 'packet.html' %} {% else %} diff --git a/meshview/web.py b/meshview/web.py index 10d9862..87d31e9 100644 --- a/meshview/web.py +++ b/meshview/web.py @@ -654,6 +654,31 @@ async def graph_humidity(request): ], ) +@routes.get("/graph/pressure/{node_id}") +async def graph_pressure(request): + return await graph_telemetry( + int(request.match_info['node_id']), + 'environment_metrics', + [ + { + 'label': 'barometric pressure', + 'fields': ['barometric_pressure'], + }, + ], + ) + +@routes.get("/graph/iaq/{node_id}") +async def graph_pressure(request): + return await graph_telemetry( + int(request.match_info['node_id']), + 'environment_metrics', + [ + { + 'label': 'IAQ', + 'fields': ['iaq'], + }, + ], + ) @routes.get("/graph/power_metrics/{node_id}") async def graph_power_metrics(request): diff --git a/requirements.txt b/requirements.txt index d27bc6a..e064e6a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,4 +11,3 @@ asyncpg seaborn pydot plotly -graphviz