4
0
mirror of https://github.com/cwinfo/yggdrasil-map synced 2025-07-03 10:47:45 +00:00

fix bug in name parsing, don't print info about time-out nodes, and gofmt

This commit is contained in:
Arceliar
2021-07-02 20:37:10 -05:00
parent a94e7c070f
commit f094991677
2 changed files with 140 additions and 127 deletions

View File

@ -40,8 +40,8 @@ def generate_graph(time_limit=60*60*3):
info = NodeInfo(ip, coords)
if 'nodeinfo' in data[key]:
if 'name' in data[key]['nodeinfo']:
label = data[key]['nodeinfo']['name']
if type(label) == str and len(label) <= 32:
label = str(data[key]['nodeinfo']['name'])
if len(label) <= 32:
info.label = label
info.label = cgi.escape(info.label)
toAdd.append(info)