Fixed node info view on non node hosting instances.

This commit is contained in:
Mark Qvist 2021-09-19 00:25:13 +02:00
parent 718e2ca859
commit 08f1d4cda7

View file

@ -700,6 +700,14 @@ class NodeInfo(urwid.WidgetWrap):
g = self.app.ui.glyphs g = self.app.ui.glyphs
self.dialog_open = False self.dialog_open = False
widget_style = ""
def show_peer_info(sender):
options = self.parent.left_pile.options(height_type="pack", height_amount=None)
self.parent.left_pile.contents[2] = (LocalPeer(self.app, self.parent), options)
if self.app.enable_node:
if self.app.node != None: if self.app.node != None:
display_name = self.app.node.name display_name = self.app.node.name
else: else:
@ -735,10 +743,6 @@ class NodeInfo(urwid.WidgetWrap):
options = self.parent.left_pile.options(height_type="pack", height_amount=None) options = self.parent.left_pile.options(height_type="pack", height_amount=None)
self.parent.left_pile.contents[2] = (overlay, options) self.parent.left_pile.contents[2] = (overlay, options)
def show_peer_info(sender):
options = self.parent.left_pile.options(height_type="pack", height_amount=None)
self.parent.left_pile.contents[2] = (LocalPeer(self.app, self.parent), options)
def connect_query(sender): def connect_query(sender):
self.parent.browser.retrieve_url(RNS.hexrep(self.app.node.destination.hash, delimit=False)) self.parent.browser.retrieve_url(RNS.hexrep(self.app.node.destination.hash, delimit=False))
@ -759,8 +763,6 @@ class NodeInfo(urwid.WidgetWrap):
announce_button = urwid.Button("Announce Now", on_press=announce_query) announce_button = urwid.Button("Announce Now", on_press=announce_query)
connect_button = urwid.Button("Browse", on_press=connect_query) connect_button = urwid.Button("Browse", on_press=connect_query)
widget_style = ""
if self.app.enable_node:
pile = urwid.Pile([ pile = urwid.Pile([
t_id, t_id,
e_name, e_name,
@ -788,6 +790,7 @@ class NodeInfo(urwid.WidgetWrap):
urwid.WidgetWrap.__init__(self, urwid.AttrMap(urwid.LineBox(self.display_widget, title="Local Node Info"), widget_style)) urwid.WidgetWrap.__init__(self, urwid.AttrMap(urwid.LineBox(self.display_widget, title="Local Node Info"), widget_style))
def start(self): def start(self):
if self.app.node != None:
self.t_last_announce.start() self.t_last_announce.start()
self.t_active_links.start() self.t_active_links.start()