diff --git a/web/graphPlotter.py b/web/graphPlotter.py index dc3fb9c..dd014be 100644 --- a/web/graphPlotter.py +++ b/web/graphPlotter.py @@ -65,6 +65,8 @@ def get_graph_json(G): centrality = centralities.get(n.name, 0) size = 5*(1 + 1*centrality) name = db.get(canonalize_ip(n.name)) + # If label isn't the default value, set name to that instead + if n.attr['label'] != n.name.split(':')[-1]: name = n.attr['label'] out_data['nodes'].append({ 'id': n.name, diff --git a/web/updateGraph.py b/web/updateGraph.py index f445cbc..25b3776 100755 --- a/web/updateGraph.py +++ b/web/updateGraph.py @@ -35,6 +35,7 @@ def generate_graph(time_limit=60*60*3): toAdd = [] for ip in data: info = NodeInfo(ip, data[ip][0]) + if len(data[ip]) >= 3: info.label = data[ip][2] toAdd.append(info) nodes = dict()