[BUGFIX] Meshlink count
This commit is contained in:
parent
69c6a75409
commit
6e9d30445b
@ -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('-');
|
||||||
|
|
||||||
|
@ -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;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user