From 6e9d30445b3e05f99a2ca99f808a6754ddfdaa32 Mon Sep 17 00:00:00 2001 From: Martin Geno Date: Tue, 9 May 2017 15:22:32 +0200 Subject: [PATCH] [BUGFIX] Meshlink count --- lib/main.js | 3 --- lib/nodelist.js | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/main.js b/lib/main.js index 9014e02..5836c13 100644 --- a/lib/main.js +++ b/lib/main.js @@ -94,9 +94,6 @@ define(['moment', 'utils/router', 'leaflet', 'gui', 'helper', 'utils/language'], ids = [d.source.node.nodeinfo.node_id, d.target.node.nodeinfo.node_id]; d.source.node.neighbours.push({ node: d.target.node, link: d, incoming: false }); d.target.node.neighbours.push({ node: d.source.node, link: d, incoming: true }); - if (d.vpn) { - d.source.node.meshlinks = d.source.node.meshlinks ? d.source.node.meshlinks + 1 : 1; - } d.id = ids.join('-'); diff --git a/lib/nodelist.js b/lib/nodelist.js index 8cec0f4..b16c9c3 100644 --- a/lib/nodelist.js +++ b/lib/nodelist.js @@ -45,7 +45,7 @@ define(['sorttable', 'snabbdom', 'helper'], function (SortTable, V, helper) { name: 'node.links', class: 'ion-share-alt', sort: function (a, b) { - return a.meshlinks - b.meshlinks; + return a.neighbours.length - b.neighbours.length; }, reverse: true }, { @@ -82,7 +82,7 @@ define(['sorttable', 'snabbdom', 'helper'], function (SortTable, V, helper) { var td0 = V.h('td', td0Content); var td1 = V.h('td', td1Content); var td2 = V.h('td', showUptime(d.uptime)); - var td3 = V.h('td', d.meshlinks.toString()); + var td3 = V.h('td', d.neighbours.length); var td4 = V.h('td', Number('clients' in d.statistics ? d.statistics.clients : 0).toFixed(0)); return V.h('tr', [td0, td1, td2, td3, td4]); @@ -102,7 +102,7 @@ define(['sorttable', 'snabbdom', 'helper'], function (SortTable, V, helper) { var data = d.nodes.all.map(function (e) { var n = Object.create(e); n.uptime = getUptime(d.now, e); - n.meshlinks = e.meshlinks || 0; + n.neighbours = e.neighbours; return n; });