Skip to content
Snippets Groups Projects
Commit 30b0cb4f authored by capossele's avatar capossele
Browse files

:bug: fixes correct inbound order

parent d243f444
No related branches found
No related tags found
No related merge requests found
...@@ -157,7 +157,7 @@ func reportAcceptedNeighbors(dispatchers *EventDispatchers) { ...@@ -157,7 +157,7 @@ func reportAcceptedNeighbors(dispatchers *EventDispatchers) {
if autopeering.Selection != nil { if autopeering.Selection != nil {
for _, acceptedNeighbor := range autopeering.Selection.GetIncomingNeighbors() { for _, acceptedNeighbor := range autopeering.Selection.GetIncomingNeighbors() {
//dispatchers.AddNode(acceptedNeighbor.ID().Bytes()) //dispatchers.AddNode(acceptedNeighbor.ID().Bytes())
dispatchers.ConnectNodes(local.GetInstance().ID().Bytes(), acceptedNeighbor.ID().Bytes()) dispatchers.ConnectNodes(acceptedNeighbor.ID().Bytes(), local.GetInstance().ID().Bytes())
} }
} }
} }
......
...@@ -144,6 +144,8 @@ func index(w http.ResponseWriter, r *http.Request) { ...@@ -144,6 +144,8 @@ func index(w http.ResponseWriter, r *http.Request) {
var existingLinks = {}; var existingLinks = {};
let highlightNodes = []; let highlightNodes = [];
let highlightInbound = [];
let highlightOutbound = [];
let highlightLinks = []; let highlightLinks = [];
let highlightLink = null; let highlightLink = null;
...@@ -244,7 +246,7 @@ func index(w http.ResponseWriter, r *http.Request) { ...@@ -244,7 +246,7 @@ func index(w http.ResponseWriter, r *http.Request) {
} }
function connectNodes(sourceNodeId, targetNodeId) { function connectNodes(sourceNodeId, targetNodeId) {
if(existingLinks[sourceNodeId + targetNodeId] == undefined && existingLinks[targetNodeId + sourceNodeId] == undefined) { if(existingLinks[sourceNodeId + targetNodeId] == undefined) {
if (!(sourceNodeId in nodesById)) { if (!(sourceNodeId in nodesById)) {
addNode(sourceNodeId); addNode(sourceNodeId);
} }
...@@ -261,9 +263,8 @@ func index(w http.ResponseWriter, r *http.Request) { ...@@ -261,9 +263,8 @@ func index(w http.ResponseWriter, r *http.Request) {
} }
function disconnectNodes(sourceNodeId, targetNodeId) { function disconnectNodes(sourceNodeId, targetNodeId) {
data.links = data.links.filter(l => !(l.source.id == sourceNodeId && l.target.id == targetNodeId) && !(l.source.id == targetNodeId && l.target.id == sourceNodeId)); data.links = data.links.filter(l => !(l.source.id == sourceNodeId && l.target.id == targetNodeId));
delete existingLinks[sourceNodeId + targetNodeId]; delete existingLinks[sourceNodeId + targetNodeId];
delete existingLinks[targetNodeId + sourceNodeId];
updateGraph(); updateGraph();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment