mirror of
https://github.com/cwinfo/yggdrasil-map
synced 2024-11-24 21:21:35 +00:00
gofmt and minor parsing fix
This commit is contained in:
parent
f094991677
commit
b744a6ab1a
@ -84,10 +84,10 @@ func doRumor(key string, out chan rumorResult) {
|
|||||||
results := make(map[string]interface{})
|
results := make(map[string]interface{})
|
||||||
if res, ok := getNodeInfo(key)["response"]; ok {
|
if res, ok := getNodeInfo(key)["response"]; ok {
|
||||||
for addr, v := range res.(map[string]interface{}) {
|
for addr, v := range res.(map[string]interface{}) {
|
||||||
vm, ok := v.(map[string]interface{})
|
vm, ok := v.(map[string]interface{})
|
||||||
if !ok {
|
if !ok {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
results["address"] = addr
|
results["address"] = addr
|
||||||
results["nodeinfo"] = vm
|
results["nodeinfo"] = vm
|
||||||
}
|
}
|
||||||
|
@ -38,11 +38,13 @@ def generate_graph(time_limit=60*60*3):
|
|||||||
ip = data[key]['address']
|
ip = data[key]['address']
|
||||||
coords = data[key]['coords']
|
coords = data[key]['coords']
|
||||||
info = NodeInfo(ip, coords)
|
info = NodeInfo(ip, coords)
|
||||||
if 'nodeinfo' in data[key]:
|
try:
|
||||||
if 'name' in data[key]['nodeinfo']:
|
if 'nodeinfo' in data[key]:
|
||||||
label = str(data[key]['nodeinfo']['name'])
|
if 'name' in data[key]['nodeinfo']:
|
||||||
if len(label) <= 32:
|
label = str(data[key]['nodeinfo']['name'])
|
||||||
info.label = label
|
if len(label) <= 32:
|
||||||
|
info.label = label
|
||||||
|
except: pass
|
||||||
info.label = cgi.escape(info.label)
|
info.label = cgi.escape(info.label)
|
||||||
toAdd.append(info)
|
toAdd.append(info)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user