freifunkmanager/js/global.js

26 lines
580 B
JavaScript

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