add nodelist

This commit is contained in:
Nils Schneider 2015-03-26 01:31:46 +01:00
commit ad56296a83
2 changed files with 105 additions and 3 deletions

View file

@ -1,9 +1,9 @@
require(["router", "map", "sidebar", "tabs", "container", "meshstats", "linklist", "simplenodelist", "infobox/main"],
function (Router, Map, Sidebar, Tabs, Container, Meshstats, Linklist, SimpleNodelist, Infobox) {
require(["router", "map", "sidebar", "tabs", "container", "meshstats", "linklist", "nodelist", "simplenodelist", "infobox/main"],
function (Router, Map, Sidebar, Tabs, Container, Meshstats, Linklist, Nodelist, SimpleNodelist, Infobox) {
getJSON("config.json").then(main)
function main(config) {
var linklist, lostnodeslist, map, meshstats, newnodeslist, router
var linklist, lostnodeslist, map, meshstats, newnodeslist, nodelist, router
function createGUI() {
moment.locale("de")
@ -22,6 +22,7 @@ function (Router, Map, Sidebar, Tabs, Container, Meshstats, Linklist, SimpleNode
meshstats = new Meshstats()
newnodeslist = new SimpleNodelist(config, "firstseen", router, "Neue Knoten")
lostnodeslist = new SimpleNodelist(config, "lastseen", router, "Verschwundene Knoten")
nodelist = new Nodelist(router)
linklist = new Linklist(linkScale, router)
sidebar.add(meshstats)
@ -29,6 +30,7 @@ function (Router, Map, Sidebar, Tabs, Container, Meshstats, Linklist, SimpleNode
newlost.add(newnodeslist)
newlost.add(lostnodeslist)
tabs.add("Neu & Verschwunden", newlost)
tabs.add("Alle Knoten", nodelist)
tabs.add("Verbindungen", linklist)
router.addTarget(infobox)
@ -111,6 +113,7 @@ function (Router, Map, Sidebar, Tabs, Container, Meshstats, Linklist, SimpleNode
map.setData(now, newnodes, lostnodes, onlinenodes, links)
meshstats.setData(nodes)
nodelist.setData(now, nodes)
linklist.setData(links)
newnodeslist.setData(newnodes)
lostnodeslist.setData(lostnodes)