From 0c272d3c369c52d7ef6f1fbb3cddce53db6c932b Mon Sep 17 00:00:00 2001 From: capossele <angelocapossele@gmail.com> Date: Thu, 23 Jan 2020 20:46:31 +0000 Subject: [PATCH] :art: makes node IDs shorter --- plugins/analysis/webinterface/httpserver/index.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/analysis/webinterface/httpserver/index.go b/plugins/analysis/webinterface/httpserver/index.go index f91ca4f6..ddda5270 100644 --- a/plugins/analysis/webinterface/httpserver/index.go +++ b/plugins/analysis/webinterface/httpserver/index.go @@ -113,13 +113,13 @@ func index(w http.ResponseWriter, r *http.Request) { break; case "C": - connectNodes(e.data.substr(1, 64), e.data.substr(65, 128)); - console.log("Connect nodes:",e.data.substr(1, 64), " - ", e.data.substr(65, 128)); + connectNodes(e.data.substr(1, 64), e.data.substr(65, 64)); + console.log("Connect nodes:",e.data.substr(1, 64), " - ", e.data.substr(65, 64)); break; case "c": - disconnectNodes(e.data.substr(1, 64), e.data.substr(65, 128)); - console.log("Disconnect nodes:",e.data.substr(1, 64), " - ", e.data.substr(65, 128)); + disconnectNodes(e.data.substr(1, 64), e.data.substr(65, 64)); + console.log("Disconnect nodes:",e.data.substr(1, 64), " - ", e.data.substr(65, 64)); break; case "O": @@ -230,18 +230,18 @@ func index(w http.ResponseWriter, r *http.Request) { } function showNodeID(node) { - document.getElementById("nodeId").innerHTML = "ID: " + node.id; + document.getElementById("nodeId").innerHTML = "ID: " + node.id.substr(0, 16); var incoming = data.links.filter(l => (l.target.id == node.id)); document.getElementById("in").innerHTML = "IN: " + incoming.length + "<br>"; incoming.forEach(function(link){ - document.getElementById("in").innerHTML += link.source.id + " → NODE <br>"; + document.getElementById("in").innerHTML += link.source.id.substr(0, 16) + " → NODE <br>"; }); var outgoing = data.links.filter(l => (l.source.id == node.id)); document.getElementById("out").innerHTML = "OUT: " + outgoing.length + "<br>"; outgoing.forEach(function(link){ - document.getElementById("out").innerHTML += "NODE → " + link.target.id + "<br>"; + document.getElementById("out").innerHTML += "NODE → " + link.target.id.substr(0, 16) + "<br>"; }); } </script> -- GitLab