pygui: added support for a details pane, can be toggled on/off, can be used to quickly view details for nodes or links

This commit is contained in:
Blake Harnden 2020-06-25 10:35:01 -07:00
parent bb2ceaf993
commit f582306bb9
12 changed files with 226 additions and 17 deletions

10
daemon/core/gui/utils.py Normal file
View file

@ -0,0 +1,10 @@
def bandwidth_text(bandwidth: int) -> str:
size = {0: "bps", 1: "Kbps", 2: "Mbps", 3: "Gbps"}
unit = 1000
i = 0
while bandwidth > unit:
bandwidth /= unit
i += 1
if i == 3:
break
return f"{bandwidth} {size[i]}"