1
1
forked from iarv/meshview

Fix how we show the actual channel on the packet list.

This commit is contained in:
pablorevilla-meshtastic
2026-01-24 23:31:57 -08:00
parent 351c35ef42
commit bea6c8cd8e
4 changed files with 8 additions and 4 deletions

View File

@@ -86,7 +86,8 @@ if SECONDARY_KEYS:
else:
logger.info("Secondary keys: []")
# Thank you to "Robert Grizzell" for the decryption code!
# https://github.com/rgrizzell
def decrypt(packet, key):
if packet.HasField("decoded"):
return True

View File

@@ -100,6 +100,7 @@ async def process_envelope(topic, env):
utc_time = datetime.datetime.fromtimestamp(now_us / 1_000_000, datetime.UTC)
dialect = session.get_bind().dialect.name
stmt = None
if dialect == "sqlite":
stmt = (
sqlite_insert(Packet)

View File

@@ -55,6 +55,7 @@ class Packet:
from_node: models.Node
to_node_id: int
to_node: models.Node
channel: str
portnum: int
data: str
raw_mesh_packet: object
@@ -102,6 +103,7 @@ class Packet:
from_node_id=packet.from_node_id,
to_node=packet.to_node,
to_node_id=packet.to_node_id,
channel=packet.channel,
portnum=packet.portnum,
data=text_mesh_packet,
payload=text_payload, # now always a string
@@ -193,7 +195,6 @@ routes = web.RouteTableDef()
@routes.get("/")
async def index(request):
"""Redirect root URL to configured starting page."""
"""
Redirect root URL '/' to the page specified in CONFIG['site']['starting'].
Defaults to '/map' if not set.
@@ -209,6 +210,7 @@ async def redirect_packet_list(request):
packet_id = request.match_info["packet_id"]
raise web.HTTPFound(location=f"/node/{packet_id}")
# Generic static HTML route
@routes.get("/{page}")
async def serve_page(request):

View File

@@ -129,7 +129,7 @@ async def api_packets(request):
"portnum": int(p.portnum) if p.portnum is not None else None,
"payload": (p.payload or "").strip(),
"import_time_us": p.import_time_us,
"channel": getattr(p.from_node, "channel", ""),
"channel": p.channel,
"long_name": getattr(p.from_node, "long_name", ""),
}
return web.json_response({"packets": [data]})
@@ -214,7 +214,7 @@ async def api_packets(request):
packet_dict = {
"id": p.id,
"import_time_us": p.import_time_us,
"channel": getattr(p.from_node, "channel", ""),
"channel": p.channel,
"from_node_id": p.from_node_id,
"to_node_id": p.to_node_id,
"portnum": int(p.portnum),