blob: 21c5a6d68aee70cbfb656248d9ebde1247377015 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
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())
async function requestPermission() {
console.log("Requesting permission...");
const onesig_res = await OneSignal.Notifications.requestPermission();
alert(onesig_res);
}
const notif = document.getElementById("notif-panel");
if (Notification.permission == 'granted') {
notif.remove();
}
|