[BUGFIX] Meshlink count

This commit is contained in:
Martin Geno 2017-05-09 15:22:32 +02:00 committed by Xaver Maierhofer
parent 69c6a75409
commit 6e9d30445b
No known key found for this signature in database
GPG Key ID: 7FDCE23FD2EC9FE8
2 changed files with 3 additions and 6 deletions

View File

@ -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]; 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.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 }); 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('-'); d.id = ids.join('-');

View File

@ -45,7 +45,7 @@ define(['sorttable', 'snabbdom', 'helper'], function (SortTable, V, helper) {
name: 'node.links', name: 'node.links',
class: 'ion-share-alt', class: 'ion-share-alt',
sort: function (a, b) { sort: function (a, b) {
return a.meshlinks - b.meshlinks; return a.neighbours.length - b.neighbours.length;
}, },
reverse: true reverse: true
}, { }, {
@ -82,7 +82,7 @@ define(['sorttable', 'snabbdom', 'helper'], function (SortTable, V, helper) {
var td0 = V.h('td', td0Content); var td0 = V.h('td', td0Content);
var td1 = V.h('td', td1Content); var td1 = V.h('td', td1Content);
var td2 = V.h('td', showUptime(d.uptime)); 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)); 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]); 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 data = d.nodes.all.map(function (e) {
var n = Object.create(e); var n = Object.create(e);
n.uptime = getUptime(d.now, e); n.uptime = getUptime(d.now, e);
n.meshlinks = e.meshlinks || 0; n.neighbours = e.neighbours;
return n; return n;
}); });