mirror of
https://github.com/pablorevilla-meshtastic/meshview.git
synced 2026-03-04 23:27:46 +01:00
add API code for /api/packets
This commit is contained in:
@@ -1100,9 +1100,9 @@ async def api_packets(request):
|
||||
async def net(request):
|
||||
try:
|
||||
# Fetch packets for the given node ID and port number
|
||||
after_time = datetime.datetime.now() - timedelta(days=6)
|
||||
packets = await store.get_packets(
|
||||
node_id=0xFFFFFFFF, portnum=PortNum.TEXT_MESSAGE_APP, since=timedelta(days=3)
|
||||
)
|
||||
node_id=0xFFFFFFFF, portnum=PortNum.TEXT_MESSAGE_APP, after=after_time)
|
||||
|
||||
# Convert packets to UI packets
|
||||
ui_packets = [Packet.from_model(p) for p in packets]
|
||||
|
||||
Reference in New Issue
Block a user