mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-04-28 00:20:48 +00:00
implement api to get path table
This commit is contained in:
parent
0fbb1fed54
commit
4ce68dd9a0
1 changed files with 15 additions and 0 deletions
15
web.py
15
web.py
|
|
@ -217,6 +217,21 @@ class ReticulumWebChat:
|
|||
"interface_stats": interface_stats,
|
||||
})
|
||||
|
||||
# get path table
|
||||
@routes.get("/api/v1/path-table")
|
||||
async def index(request):
|
||||
|
||||
# get path table, making sure hash and via are in hex as json_response can't serialize bytes
|
||||
path_table = []
|
||||
for path in self.reticulum.get_path_table():
|
||||
path["hash"] = path["hash"].hex()
|
||||
path["via"] = path["via"].hex()
|
||||
path_table.append(path)
|
||||
|
||||
return web.json_response({
|
||||
"path_table": path_table,
|
||||
})
|
||||
|
||||
# delete lxmf message
|
||||
@routes.delete("/api/v1/lxmf-messages/{id}")
|
||||
async def index(request):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue