diff --git a/main.py b/main.py index c982bd2..f9a791e 100644 --- a/main.py +++ b/main.py @@ -5,9 +5,6 @@ from meshview import mqtt_reader from meshview import database from meshview import mqtt_store from meshview import web -from meshview import http -from meshview import models -import json @@ -19,26 +16,8 @@ async def load_database_from_mqtt(mqtt_server: str , mqtt_port: int, topic: list async def main(config): database.init_database(config["database"]["connection_string"]) - await database.create_tables() - mqtt_user = None - mqtt_passwd = None - if config["mqtt"]["username"] != "": - mqtt_user: str = config["mqtt"]["username"] - if config["mqtt"]["password"] != "": - mqtt_passwd: str = config["mqtt"]["password"] - mqtt_topics = json.loads(config["mqtt"]["topics"]) + #await database.create_tables() - # Create database with site configuration - async with database.async_session() as session: - site_config = models.SiteConfig( - site_domain = config["site"]["domain"], - site_title = config["site"]["title"], - site_message = config["site"]["message"] - ) - - session.add(site_config) - # print("Site configuration loaded to database") - async with asyncio.TaskGroup() as tg: tg.create_task( web.run_server( diff --git a/meshview/store.py b/meshview/store.py index 1b49e9e..d23f47c 100644 --- a/meshview/store.py +++ b/meshview/store.py @@ -318,6 +318,6 @@ async def get_site_config(): async with database.async_session() as session: query = select(SiteConfig) result = await session.execute(query) + #print(result.scalar()) site_config = result.scalars().all()[-1] - return site_config \ No newline at end of file diff --git a/meshview/templates/chat_packet.html b/meshview/templates/chat_packet.html index 9a6d833..8352215 100644 --- a/meshview/templates/chat_packet.html +++ b/meshview/templates/chat_packet.html @@ -1,6 +1,6 @@
- {{packet.import_time.strftime('%-I:%M:%S %p - %d-%m-%Y')}} - ✉️ {{packet.from_node.channel}} - {{packet.from_node.long_name or (packet.from_node_id | node_id_to_hex) }} - {{packet.payload}} + ✉️ {{packet.from_node.channel}}
{{packet.import_time.strftime('%-I:%M:%S %p - %d-%m-%Y')}}
+ + {{packet.from_node.long_name or (packet.from_node_id | node_id_to_hex) }} + {{packet.payload}}
\ No newline at end of file diff --git a/meshview/templates/node.html b/meshview/templates/node.html index 434bffe..caecc4e 100644 --- a/meshview/templates/node.html +++ b/meshview/templates/node.html @@ -41,18 +41,28 @@
{% if node %} -
- {{node.long_name}} ({{node.node_id|node_id_to_hex}}) -
-
-
-
ShortName
-
{{node.short_name}}
-
HW Model
-
{{node.hw_model}}
-
Role
-
{{node.role}}
-
+
+ {{node.short_name}} +

{{node.long_name}}

+
+
+
+ {% if trace %} +
+ {% endif %} +
NodeID
+
{{node.node_id|node_id_to_hex}}
+
Channel
+
{{node.channel}}
+
HW Model
+
{{node.hw_model}}
+
Role
+
{{node.role}}
+ {% if node.firmware %} +
Firmware
+
{{node.firmware}}
+ {% endif %} +
Get node traffic totals {% include "node_graphs.html" %}
@@ -63,11 +73,6 @@ {% endif %}
- -
- -
-
@@ -85,6 +90,29 @@
+ + {% if trace %}