mirror of
https://github.com/markqvist/NomadNet.git
synced 2024-10-01 01:26:07 -04:00
Added hops display to node info. Fixed node info display for unknown ops and addresses.
This commit is contained in:
parent
8b84864847
commit
4ff99688de
@ -131,7 +131,7 @@ class Node:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
RNS.log("Error while fetching list of allowed identities for request: "+str(e), RNS.LOG_ERROR)
|
RNS.log("Error while fetching list of allowed identities for request: "+str(e), RNS.LOG_ERROR)
|
||||||
|
|
||||||
if remote_identity.hash in allowed_list:
|
if hasattr(remote_identity, "hash") and remote_identity.hash in allowed_list:
|
||||||
request_allowed = True
|
request_allowed = True
|
||||||
else:
|
else:
|
||||||
request_allowed = False
|
request_allowed = False
|
||||||
|
@ -493,11 +493,29 @@ class KnownNodeInfo(urwid.WidgetWrap):
|
|||||||
]
|
]
|
||||||
|
|
||||||
node_ident = RNS.Identity.recall(source_hash)
|
node_ident = RNS.Identity.recall(source_hash)
|
||||||
|
if node_ident != None:
|
||||||
op_hash = RNS.Destination.hash_from_name_and_identity("lxmf.delivery", node_ident)
|
op_hash = RNS.Destination.hash_from_name_and_identity("lxmf.delivery", node_ident)
|
||||||
op_str = self.app.directory.simplest_display_str(op_hash)
|
op_str = self.app.directory.simplest_display_str(op_hash)
|
||||||
|
else:
|
||||||
|
op_str = "Unknown"
|
||||||
|
|
||||||
operator_entry = urwid.Text("Operator : "+op_str, align="left")
|
operator_entry = urwid.Text("Operator : "+op_str, align="left")
|
||||||
pile_widgets.insert(4, operator_entry)
|
pile_widgets.insert(4, operator_entry)
|
||||||
|
|
||||||
|
hops = RNS.Transport.hops_to(source_hash)
|
||||||
|
if hops == 1:
|
||||||
|
str_s = ""
|
||||||
|
else:
|
||||||
|
str_s = "s"
|
||||||
|
|
||||||
|
if hops != RNS.Transport.PATHFINDER_M:
|
||||||
|
hops_str = str(hops)+" hop"+str_s
|
||||||
|
else:
|
||||||
|
hops_str = "Unknown"
|
||||||
|
|
||||||
|
operator_entry = urwid.Text("Distance : "+hops_str, align="left")
|
||||||
|
pile_widgets.insert(5, operator_entry)
|
||||||
|
|
||||||
pile = urwid.Pile(pile_widgets)
|
pile = urwid.Pile(pile_widgets)
|
||||||
|
|
||||||
self.display_widget = urwid.Filler(pile, valign="top", height="pack")
|
self.display_widget = urwid.Filler(pile, valign="top", height="pack")
|
||||||
|
Loading…
Reference in New Issue
Block a user