d3json: obscure client MACs

rewrite
Jan-Philipp Litza 2014-09-06 13:48:03 +02:00
parent 5fba69de7a
commit 6d452fc149
1 changed files with 13 additions and 12 deletions

View File

@ -50,10 +50,10 @@ class Output:
"type": "vpn" if neighbor["neighbor"]["vpn"] or node["vpn"] else None,
"id": "-".join((node.id, neighbor["neighbor"].id)),
}
clientcount = 0
for client in node.get("clients", []):
if not client in indexes:
nodes.append({
"id": client,
"id": "%s-%s" % (node.id, clientcount),
"flags": {
"client": True,
"online": True,
@ -61,15 +61,16 @@ class Output:
}
})
indexes[client] = count
count += 1
links[(node.id, client)] = {
"source": indexes[node.id],
"target": indexes[client],
"quality": "TT",
"type": "client",
"id": "-".join((node.id, client)),
"id": "%s-%i" % (node.id, clientcount),
}
count += 1
clientcount += 1
return {
"nodes": nodes,