link.js 849 B

1234567891011121314151617181920212223242526
  1. define(function () {
  2. return function (config, el, router, d) {
  3. var h2 = document.createElement("h2")
  4. var a1 = document.createElement("a")
  5. a1.href = "#"
  6. a1.onclick = router.node(d.source.node)
  7. a1.textContent = d.source.node.nodeinfo.hostname
  8. h2.appendChild(a1)
  9. h2.appendChild(document.createTextNode(" – "))
  10. var a2 = document.createElement("a")
  11. a2.href = "#"
  12. a2.onclick = router.node(d.target.node)
  13. a2.textContent = d.target.node.nodeinfo.hostname
  14. h2.appendChild(a2)
  15. el.appendChild(h2)
  16. var attributes = document.createElement("table")
  17. attributes.classList.add("attributes")
  18. attributeEntry(attributes, "TQ", showTq(d))
  19. attributeEntry(attributes, "Entfernung", showDistance(d))
  20. attributeEntry(attributes, "VPN", d.vpn ? "ja" : "nein")
  21. el.appendChild(attributes)
  22. }
  23. })