show all links
This commit is contained in:
parent
7ba16bb1c4
commit
7290e6c3e7
@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"dataPath": "https://map.luebeck.freifunk.net/data/",
|
"dataPath": "https://map.luebeck.freifunk.net/data/",
|
||||||
"longLinkPercentile": 0.1,
|
|
||||||
"showContact": true
|
"showContact": true
|
||||||
}
|
}
|
@ -259,9 +259,9 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h2>Längste Verbindungen</h2>
|
<h2>Verbindungen</h2>
|
||||||
<table>
|
<table>
|
||||||
<tbody id="longlinks">
|
<tbody id="links">
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
17
history.js
17
history.js
@ -149,13 +149,9 @@ function handle_data(config, map) {
|
|||||||
d.distance = d.latlngs[0].distanceTo(d.latlngs[1])
|
d.distance = d.latlngs[0].distanceTo(d.latlngs[1])
|
||||||
})
|
})
|
||||||
|
|
||||||
longlinks = graph.slice().filter( function (d) {
|
var links = graph.slice().sort( function (a, b) {
|
||||||
return "distance" in d
|
return (a.distance !== undefined ? a.distance : -1) - (b.distance !== undefined ? b.distance : -1)
|
||||||
}).sort( function (a, b) {
|
}).reverse()
|
||||||
return a.distance - b.distance
|
|
||||||
}).reverse().slice(0, Math.ceil(config.longLinkPercentile * graph.filter( function (d) {
|
|
||||||
return "distance" in d
|
|
||||||
}).length))
|
|
||||||
|
|
||||||
nodes.forEach( function (d) {
|
nodes.forEach( function (d) {
|
||||||
d.neighbours = []
|
d.neighbours = []
|
||||||
@ -174,7 +170,7 @@ function handle_data(config, map) {
|
|||||||
|
|
||||||
addToList(document.getElementById("newnodes"), config.showContact, "firstseen", gotoAnything.node, newnodes)
|
addToList(document.getElementById("newnodes"), config.showContact, "firstseen", gotoAnything.node, newnodes)
|
||||||
addToList(document.getElementById("lostnodes"), config.showContact, "lastseen", gotoAnything.node, lostnodes)
|
addToList(document.getElementById("lostnodes"), config.showContact, "lastseen", gotoAnything.node, lostnodes)
|
||||||
addToLongLinksList(document.getElementById("longlinks"), gotoAnything.link, longlinks)
|
addToLinksList(document.getElementById("links"), gotoAnything.link, links)
|
||||||
|
|
||||||
showMeshstats(document.getElementById("meshstats"), nodes)
|
showMeshstats(document.getElementById("meshstats"), nodes)
|
||||||
|
|
||||||
@ -333,7 +329,7 @@ function addLinksToMap(map, graph, gotoAnything) {
|
|||||||
return markersDict
|
return markersDict
|
||||||
}
|
}
|
||||||
|
|
||||||
function addToLongLinksList(el, gotoProxy, links) {
|
function addToLinksList(el, gotoProxy, links) {
|
||||||
links.forEach( function (d) {
|
links.forEach( function (d) {
|
||||||
var row = document.createElement("tr")
|
var row = document.createElement("tr")
|
||||||
var td1 = document.createElement("td")
|
var td1 = document.createElement("td")
|
||||||
@ -344,6 +340,9 @@ function addToLongLinksList(el, gotoProxy, links) {
|
|||||||
td1.appendChild(a)
|
td1.appendChild(a)
|
||||||
row.appendChild(td1)
|
row.appendChild(td1)
|
||||||
|
|
||||||
|
if (d.vpn)
|
||||||
|
td1.appendChild(document.createTextNode(" (VPN)"))
|
||||||
|
|
||||||
var td2 = document.createElement("td")
|
var td2 = document.createElement("td")
|
||||||
td2.textContent = showTq(d)
|
td2.textContent = showTq(d)
|
||||||
row.appendChild(td2)
|
row.appendChild(td2)
|
||||||
|
Loading…
Reference in New Issue
Block a user