freifunkmanager/js/init.js

27 lines
647 B
JavaScript

send('GET',"config.json").then(function(config){
internal.config = config
createModel()
if(localStorageTest()){
internal.nodes = JSON.parse(localStorage.getItem("nodes"))
internal.aliases = JSON.parse(localStorage.getItem("aliases"))
if(!internal.nodes){
send('GET',internal.config.api+"/nodes").then(function(data){
internal.nodes = data
internal.lastload = new Date()
})
}
if(!internal.aliases){
send('GET',internal.config.api+"/aliases").then(function(data){
internal.aliases = data
})
}
}else{
refreshData()
}
updateBange()
setInterval(function () {
refreshData()
}, config.reload);
route()
})