Fix repository link handling typo

This commit is contained in:
Mark Qvist 2025-01-02 11:17:21 +01:00
parent f49019c93e
commit 0c062ee16b

View File

@ -385,7 +385,8 @@ class SidebandApp(MDApp):
self.connectivity_updater = None
self.last_map_update = 0
self.last_telemetry_received = 0
self.reposository_url = None
self.repository_url = None
self.rnode_flasher_url = None
#################################################
@ -3705,9 +3706,9 @@ class SidebandApp(MDApp):
self.root.ids.screen_manager.transition = self.slide_transition
def repository_link_action(self, sender=None, event=None):
if self.reposository_url != None:
if self.repository_url != None:
def lj():
webbrowser.open(self.reposository_url)
webbrowser.open(self.repository_url)
threading.Thread(target=lj, daemon=True).start()
def repository_update_info(self, sender=None):
@ -3749,15 +3750,19 @@ class SidebandApp(MDApp):
ips = getIP()
if ips == None or len(ips) == 0:
info += "The repository server is running, but the local device IP address could not be determined.\n\nYou can access the repository by pointing a browser to: https://DEVICE_IP:4444/"
self.reposository_url = None
self.repository_url = None
else:
ipstr = ""
self.repository_url = None
for ip in ips:
ipstr += "[u][ref=link]https://" + str(ip) + ":4444/[/ref][u]\n"
self.repository_url = ipstr
ipurl = "https://" + str(ip) + ":4444/"
ipstr += "[u][ref=link]"+ipurl+"[/ref][u]\n"
if self.repository_url == None:
self.repository_url = ipurl
self.rnode_flasher_url = ipurl+"mirrors/rnode-flasher/index.html"
ms = "" if len(ips) == 1 else "es"
info += "The repository server is running at the following address" + ms +":\n"+ipstr
info += "The repository server is running at the following address" + ms +":\n\n"+ipstr
self.repository_screen.ids.repository_info.bind(on_ref_press=self.repository_link_action)
def cb(dt):
@ -3777,7 +3782,7 @@ class SidebandApp(MDApp):
Clock.schedule_once(self.repository_update_info, 1.0)
def repository_stop_action(self, sender=None):
self.reposository_url = None
self.repository_url = None
self.sideband.stop_webshare()
Clock.schedule_once(self.repository_update_info, 0.75)