Added link stats to object details

This commit is contained in:
Mark Qvist 2025-02-23 22:42:43 +01:00
parent f006f0d71a
commit 63030a6f48
2 changed files with 84 additions and 8 deletions

View file

@ -822,17 +822,23 @@ class RVDetails(MDRecycleView):
if nhi and nhi != "None":
self.entries.append({"icon": "routes", "text": f"Current path on [b]{nhi}[/b]", "on_release": pass_job})
try:
ler = self.delegate.app.sideband.get_destination_establishment_rate(self.delegate.object_hash)
if ler:
lers = RNS.prettyspeed(ler, "b")
self.entries.append({"icon": "lock-check-outline", "text": f"Direct link established, LER is [b]{lers}[/b]", "on_release": pass_job})
except Exception as e:
RNS.trace_exception(e)
if nh != RNS.Transport.PATHFINDER_M:
hs = "hop" if nh == 1 else "hops"
self.entries.append({"icon": "atom-variant", "text": f"Network distance is [b]{nh} {hs}[/b]", "on_release": pass_job})
try:
ler = self.delegate.app.sideband.get_destination_establishment_rate(self.delegate.object_hash)
mtu = self.delegate.app.sideband.get_destination_mtu(self.delegate.object_hash) or RNS.Reticulum.MTU
edr = self.delegate.app.sideband.get_destination_edr(self.delegate.object_hash)
if ler:
lers = RNS.prettyspeed(ler, "b")
mtus = RNS.prettysize(mtu)
edrs = f"{RNS.prettyspeed(edr)}" if edr != None else ""
self.entries.append({"icon": "lock-check-outline", "text": f"Link established, LER is [b]{lers}[/b], MTU is [b]{mtus}[/b]", "on_release": pass_job})
if edr: self.entries.append({"icon": "approximately-equal", "text": f"Expected data rate is [b]{edrs}[/b]", "on_release": pass_job})
except Exception as e:
RNS.trace_exception(e)
except Exception as e:
RNS.trace_exception(e)