summaryrefslogtreecommitdiff
path: root/frontend/start.js
blob: f79033d41026b5d6d5b9e125f285ddb32cdf89c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
document.getElementById("startbtn").addEventListener("click", () => {
	start();
});

const urlParams = new URLSearchParams(window.location.search);
data.machine_id = urlParams.get('machine');
console.log(urlParams);

startUpdateMachines();

const notbtn = document.getElementById("notbtn")
notbtn.addEventListener("click", () => requestPermission())
function requestPermission() {
	console.log("Requesting permission...");
	OneSignal.Notifications.requestPermission();
}
const notif = document.getElementById("notif-panel");
if (Notification.permission == 'granted') {
	notif.remove();
}