freifunkmanager/js/init.js

27 lines
647 B
JavaScript
Raw Normal View History

2016-06-23 17:31:39 +02:00
send('GET',"config.json").then(function(config){
internal.config = config
2016-06-24 03:17:12 +02:00
createModel()
2016-06-24 09:37:37 +02:00
if(localStorageTest()){
2016-06-23 17:31:39 +02:00
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
2016-06-24 03:17:12 +02:00
internal.lastload = new Date()
2016-06-23 17:31:39 +02:00
})
}
if(!internal.aliases){
send('GET',internal.config.api+"/aliases").then(function(data){
internal.aliases = data
})
}
2016-06-24 03:17:12 +02:00
}else{
refreshData()
2016-06-23 17:31:39 +02:00
}
2016-06-24 03:17:12 +02:00
updateBange()
2016-06-23 17:31:39 +02:00
setInterval(function () {
refreshData()
}, config.reload);
route()
})