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:
parent
bb2ceaf993
commit
f582306bb9
12 changed files with 226 additions and 17 deletions
10
daemon/core/gui/utils.py
Normal file
10
daemon/core/gui/utils.py
Normal 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]}"
|
Loading…
Add table
Add a link
Reference in a new issue