redo link type handling

This commit is contained in:
Milan Pässler 2016-02-18 19:26:05 +00:00
parent 3a7cc2bbc5
commit f77aabd37d
8 changed files with 67 additions and 33 deletions
lib/infobox

View file

@ -19,7 +19,7 @@ define(function () {
attributeEntry(attributes, "TQ", showTq(d))
attributeEntry(attributes, "Entfernung", showDistance(d))
attributeEntry(attributes, "VPN", d.vpn ? "ja" : null)
attributeEntry(attributes, "Typ", d.type)
var hw1 = dictGet(d.source.node.nodeinfo, ["hardware", "model"])
var hw2 = dictGet(d.target.node.nodeinfo, ["hardware", "model"])
attributeEntry(attributes, "Hardware", (hw1 != null ? hw1 : "unbekannt") + " " + (hw2 != null ? hw2 : "unbekannt"))

View file

@ -246,9 +246,13 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"],
tr.appendChild(th3)
var th4 = document.createElement("th")
th4.textContent = "Entfernung"
th4.textContent = "Typ"
tr.appendChild(th4)
var th5 = document.createElement("th")
th5.textContent = "Entfernung"
tr.appendChild(th5)
thead.appendChild(tr)
table.appendChild(thead)
@ -269,11 +273,6 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"],
a1.onclick = router.node(d.node)
td2.appendChild(a1)
if (d.link.vpn)
td1.appendChild(document.createTextNode(" (VPN)"))
if (d.link.cable)
td1.appendChild(document.createTextNode(" (Kabel)"))
if (has_location(d.node)) {
var span = document.createElement("span")
span.classList.add("icon")
@ -294,16 +293,25 @@ define(["moment", "numeral", "tablesort", "tablesort.numeric"],
var td4 = document.createElement("td")
var a3 = document.createElement("a")
a3.href = "#"
a3.textContent = showDistance(d.link)
a3.textContent = d.link.type
a3.onclick = router.link(d.link)
td4.appendChild(a3)
td4.setAttribute("data-sort", d.link.distance !== undefined ? -d.link.distance : 1)
tr.appendChild(td4)
var td5 = document.createElement("td")
var a4 = document.createElement("a")
a4.href = "#"
a4.textContent = showDistance(d.link)
a4.onclick = router.link(d.link)
td5.appendChild(a4)
td5.setAttribute("data-sort", d.link.distance !== undefined ? -d.link.distance : 1)
tr.appendChild(td5)
tbody.appendChild(tr)
})
table.appendChild(tbody)
table.className = "node-links"
new Tablesort(table)