From ca04e89c3aefc534cf6a92750dfab20f4722a617 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 13 Oct 2022 22:40:48 +0200 Subject: [PATCH] Updated connectivity status --- sbapp/services/sidebandservice.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sbapp/services/sidebandservice.py b/sbapp/services/sidebandservice.py index a92768e..646cce5 100644 --- a/sbapp/services/sidebandservice.py +++ b/sbapp/services/sidebandservice.py @@ -196,6 +196,8 @@ class SidebandService(): ts = "Disabled" i2s = "Disabled" + stat = "[size=22dp][b]Connectivity Status[/b][/size]\n\n" + if self.sideband.interface_local != None: np = len(self.sideband.interface_local.peers) if np == 1: @@ -203,19 +205,33 @@ class SidebandService(): else: ws = str(np)+" reachable peers" + stat += "[b]Local[/b]\n{ws}\n\n".format(ws=ws) + + if self.sideband.interface_rnode != None: + if self.sideband.interface_rnode.online: + rs = "On-air at "+str(self.sideband.interface_rnode.bitrate_kbps)+" Kbps" + else: + rs = "Interface Down" + + stat += "[b]RNode[/b]\n{rs}\n\n".format(rs=rs) + if self.sideband.interface_tcp != None: if self.sideband.interface_tcp.online: ts = "Connected to "+str(self.sideband.interface_tcp.target_ip)+":"+str(self.sideband.interface_tcp.target_port) else: ts = "Interface Down" + stat += "[b]TCP[/b]\n{ts}\n\n".format(ts=ts) + if self.sideband.interface_i2p != None: if self.sideband.interface_i2p.online: i2s = "Connected" else: i2s = "Connecting to I2P" - return "[size=22dp][b]Connectivity Status[/b][/size]\n\n[b]Local[/b]\n{ws}\n\n[b]TCP[/b]\n{ts}\n\n[b]I2P[/b]\n{i2s}".format(ws=ws, ts=ts, i2s=i2s) + stat += "[b]I2P[/b]\n{i2s}".format(i2s=i2s) + + return stat def run(self): while self.should_run: