freifunkmanager/js/global.js

26 lines
580 B
JavaScript
Raw Normal View History

2016-06-23 17:31:39 +02:00
var toast = document.getElementById("toast")
function notify(key){
2016-06-24 03:17:12 +02:00
console.log("new node:",key)
2016-06-23 17:31:39 +02:00
toast.MaterialSnackbar.showSnackbar({
message:"New Nodes with nodeid '"+key+"'!",
actionHandler: function(event) {
2016-06-24 03:17:12 +02:00
editModel(key)
2016-06-23 17:31:39 +02:00
},
actionText: 'Edit',
timeout: 3000
});
}
var refreshButton = document.getElementById("refresh")
refreshButton.addEventListener('click', refreshData)
2016-06-24 03:17:12 +02:00
var lastload = document.getElementById("lastLoad")
function updateTimes(){
lastload.innerHTML = moment(internal.lastload).fromNow()
}
updateTimes();
setInterval(updateTimes, 1000);