infobox: handle directional links
This commit is contained in:
parent
d13b032b61
commit
f354a6fbc7
@ -6,7 +6,7 @@ define(function () {
|
|||||||
a1.onclick = router.node(d.source.node)
|
a1.onclick = router.node(d.source.node)
|
||||||
a1.textContent = d.source.node.nodeinfo.hostname
|
a1.textContent = d.source.node.nodeinfo.hostname
|
||||||
h2.appendChild(a1)
|
h2.appendChild(a1)
|
||||||
h2.appendChild(document.createTextNode(" – "))
|
h2.appendChild(document.createTextNode(" → "))
|
||||||
var a2 = document.createElement("a")
|
var a2 = document.createElement("a")
|
||||||
a2.href = "#"
|
a2.href = "#"
|
||||||
a2.onclick = router.node(d.target.node)
|
a2.onclick = router.node(d.target.node)
|
||||||
@ -19,7 +19,7 @@ define(function () {
|
|||||||
|
|
||||||
attributeEntry(attributes, "TQ", showTq(d))
|
attributeEntry(attributes, "TQ", showTq(d))
|
||||||
attributeEntry(attributes, "Entfernung", showDistance(d))
|
attributeEntry(attributes, "Entfernung", showDistance(d))
|
||||||
attributeEntry(attributes, "VPN", d.vpn ? "ja" : "nein")
|
attributeEntry(attributes, "VPN", d.vpn ? "ja" : null)
|
||||||
var hw1 = dictGet(d.source.node.nodeinfo, ["hardware", "model"])
|
var hw1 = dictGet(d.source.node.nodeinfo, ["hardware", "model"])
|
||||||
var hw2 = dictGet(d.target.node.nodeinfo, ["hardware", "model"])
|
var hw2 = dictGet(d.target.node.nodeinfo, ["hardware", "model"])
|
||||||
attributeEntry(attributes, "Hardware", (hw1 != null ? hw1 : "unbekannt") + " – " + (hw2 != null ? hw2 : "unbekannt"))
|
attributeEntry(attributes, "Hardware", (hw1 != null ? hw1 : "unbekannt") + " – " + (hw2 != null ? hw2 : "unbekannt"))
|
||||||
|
@ -259,10 +259,13 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"],
|
|||||||
a1.textContent = d.node.nodeinfo.hostname
|
a1.textContent = d.node.nodeinfo.hostname
|
||||||
a1.href = "#"
|
a1.href = "#"
|
||||||
a1.onclick = router.node(d.node)
|
a1.onclick = router.node(d.node)
|
||||||
|
td1.appendChild(document.createTextNode(d.incoming ? " ← " : " → "))
|
||||||
td1.appendChild(a1)
|
td1.appendChild(a1)
|
||||||
|
|
||||||
if (d.link.vpn)
|
if (d.link.vpn)
|
||||||
td1.appendChild(document.createTextNode(" (VPN)"))
|
td1.appendChild(document.createTextNode(" (VPN)"))
|
||||||
|
if (d.link.cable)
|
||||||
|
td1.appendChild(document.createTextNode(" (Kabel)"))
|
||||||
|
|
||||||
if (has_location(d.node)) {
|
if (has_location(d.node)) {
|
||||||
var span = document.createElement("span")
|
var span = document.createElement("span")
|
||||||
|
@ -100,8 +100,8 @@ function (moment, Router, L, GUI, numeral) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
links.forEach( function (d) {
|
links.forEach( function (d) {
|
||||||
d.source.node.neighbours.push({ node: d.target.node, link: d })
|
d.source.node.neighbours.push({ node: d.target.node, link: d, incoming: false })
|
||||||
d.target.node.neighbours.push({ node: d.source.node, link: d })
|
d.target.node.neighbours.push({ node: d.source.node, link: d, incoming: true })
|
||||||
if (!d.vpn) {
|
if (!d.vpn) {
|
||||||
d.source.node.meshlinks = d.source.node.meshlinks ? d.source.node.meshlinks + 1 : 1
|
d.source.node.meshlinks = d.source.node.meshlinks ? d.source.node.meshlinks + 1 : 1
|
||||||
d.target.node.meshlinks = d.target.node.meshlinks ? d.target.node.meshlinks + 1 : 1
|
d.target.node.meshlinks = d.target.node.meshlinks ? d.target.node.meshlinks + 1 : 1
|
||||||
|
Loading…
Reference in New Issue
Block a user