mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Add 'type' to network.json. For https://github.com/LibreQoE/LibreQoS/issues/308
This commit is contained in:
@@ -63,6 +63,22 @@ class NodeType(enum.IntEnum):
|
||||
clientWithChildren = 5
|
||||
device = 6
|
||||
|
||||
def nodeTypeToString(integer):
|
||||
string = ''
|
||||
match integer:
|
||||
case 1:
|
||||
string = 'root'
|
||||
case 2:
|
||||
string = 'site'
|
||||
case 3:
|
||||
string = 'ap'
|
||||
case 4:
|
||||
string = 'client'
|
||||
case 5:
|
||||
string = 'clientWithChildren'
|
||||
case 6:
|
||||
string = 'device'
|
||||
return(string)
|
||||
|
||||
class NetworkNode:
|
||||
# Defines a node on a LibreQoS network graph.
|
||||
@@ -311,6 +327,7 @@ class NetworkGraph:
|
||||
node = {
|
||||
"downloadBandwidthMbps": self.nodes[idx].downloadMbps,
|
||||
"uploadBandwidthMbps": self.nodes[idx].uploadMbps,
|
||||
'type': nodeTypeToString(self.nodes[idx].type),
|
||||
}
|
||||
children = {}
|
||||
hasChildren = False
|
||||
|
||||
Reference in New Issue
Block a user