d3json: obscure client MACs
parent
5fba69de7a
commit
6d452fc149
|
@ -50,26 +50,27 @@ class Output:
|
||||||
"type": "vpn" if neighbor["neighbor"]["vpn"] or node["vpn"] else None,
|
"type": "vpn" if neighbor["neighbor"]["vpn"] or node["vpn"] else None,
|
||||||
"id": "-".join((node.id, neighbor["neighbor"].id)),
|
"id": "-".join((node.id, neighbor["neighbor"].id)),
|
||||||
}
|
}
|
||||||
|
clientcount = 0
|
||||||
for client in node.get("clients", []):
|
for client in node.get("clients", []):
|
||||||
if not client in indexes:
|
nodes.append({
|
||||||
nodes.append({
|
"id": "%s-%s" % (node.id, clientcount),
|
||||||
"id": client,
|
"flags": {
|
||||||
"flags": {
|
"client": True,
|
||||||
"client": True,
|
"online": True,
|
||||||
"online": True,
|
"gateway": False
|
||||||
"gateway": False
|
}
|
||||||
}
|
})
|
||||||
})
|
indexes[client] = count
|
||||||
indexes[client] = count
|
|
||||||
count += 1
|
|
||||||
|
|
||||||
links[(node.id, client)] = {
|
links[(node.id, client)] = {
|
||||||
"source": indexes[node.id],
|
"source": indexes[node.id],
|
||||||
"target": indexes[client],
|
"target": indexes[client],
|
||||||
"quality": "TT",
|
"quality": "TT",
|
||||||
"type": "client",
|
"type": "client",
|
||||||
"id": "-".join((node.id, client)),
|
"id": "%s-%i" % (node.id, clientcount),
|
||||||
}
|
}
|
||||||
|
count += 1
|
||||||
|
clientcount += 1
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"nodes": nodes,
|
"nodes": nodes,
|
||||||
|
|
Loading…
Reference in New Issue