|
|
|
@ -60,12 +60,83 @@
|
|
|
|
|
list-style: none;
|
|
|
|
|
padding: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#preload {
|
|
|
|
|
position: fixed;
|
|
|
|
|
z-index: 9999;
|
|
|
|
|
display: flex;
|
|
|
|
|
inset: 0;
|
|
|
|
|
background: black;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
cursor: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#preload-icon {
|
|
|
|
|
width: 20%;
|
|
|
|
|
pointer-events: none;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<script>
|
|
|
|
|
let server = "http://192.168.1.121:8081/";
|
|
|
|
|
let admin = "6c89f976-0eee-4bd9-8f55-de961d4bd905";
|
|
|
|
|
|
|
|
|
|
window.preloadWaitInterval = null;
|
|
|
|
|
window.preloadWaitTimeout = null;
|
|
|
|
|
|
|
|
|
|
async function startPreloadUnlock() {
|
|
|
|
|
document.getElementById("preload-icon").src = "./unlock.svg";
|
|
|
|
|
document.getElementById("preload-icon").style.opacity = "1";
|
|
|
|
|
|
|
|
|
|
window.preloadWaitInterval = setInterval(() => {
|
|
|
|
|
if (document.getElementById("preload-icon").style.opacity === "0") {
|
|
|
|
|
document.getElementById("preload-icon").style.opacity = "1";
|
|
|
|
|
} else if (document.getElementById("preload-icon").style.opacity === "1") {
|
|
|
|
|
document.getElementById("preload-icon").style.opacity = "0";
|
|
|
|
|
}
|
|
|
|
|
}, 1000);
|
|
|
|
|
|
|
|
|
|
window.preloadWaitTimeout = setTimeout(() => {
|
|
|
|
|
clearInterval(window.preloadWaitInterval);
|
|
|
|
|
clearInterval(window.authApprovalInterval);
|
|
|
|
|
|
|
|
|
|
document.getElementById("preload-icon").src = "./logo.svg";
|
|
|
|
|
document.getElementById("preload-icon").style.opacity = "1";
|
|
|
|
|
}, 30000);
|
|
|
|
|
|
|
|
|
|
let data = JSON.parse(await (await window.fetch(server + "/dev.equestria.delta.kiosk.RequestApproval/?activate&id=" + admin)).text());
|
|
|
|
|
window.authId = data.id;
|
|
|
|
|
|
|
|
|
|
window.authApprovalInterval = setInterval(async () => {
|
|
|
|
|
let data = JSON.parse(await (await window.fetch(server + "/dev.equestria.delta.kiosk.CheckApproved/?id=" + window.authId)).text());
|
|
|
|
|
if (data['token']) {
|
|
|
|
|
clearInterval(window.preloadWaitInterval);
|
|
|
|
|
clearInterval(window.authApprovalInterval);
|
|
|
|
|
|
|
|
|
|
document.getElementById("preload-icon").src = "./logo.svg";
|
|
|
|
|
document.getElementById("preload-icon").style.opacity = "1";
|
|
|
|
|
document.getElementById("preload").style.display = "none";
|
|
|
|
|
document.getElementById("video").currentTime = 0;
|
|
|
|
|
} else if (data['token'] === false) {
|
|
|
|
|
clearInterval(window.preloadWaitInterval);
|
|
|
|
|
clearInterval(window.authApprovalInterval);
|
|
|
|
|
|
|
|
|
|
document.getElementById("preload-icon").src = "./logo.svg";
|
|
|
|
|
document.getElementById("preload-icon").style.opacity = "1";
|
|
|
|
|
}
|
|
|
|
|
}, 500);
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
</head>
|
|
|
|
|
<body style="position: fixed;inset: 0;margin: 0;">
|
|
|
|
|
<div id="preload" onclick="startPreloadUnlock();">
|
|
|
|
|
<img id="preload-icon" alt="" src="./logo.svg">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="welcome">
|
|
|
|
|
<video src="video.mp4" muted loop autoplay style="position: fixed;inset: 0;width: 100vw;height: 100vh;"></video>
|
|
|
|
|
<video id="video" src="video.mp4" muted loop autoplay style="position: fixed;inset: 0;width: 100vw;height: 100vh;"></video>
|
|
|
|
|
<div style="position: fixed; bottom: 20px; left: 0; right: 0; text-align: center; text-shadow: 0 0 5px white; font-size: 24px;">Cliquez n'importe où pour commencer</div>
|
|
|
|
|
<div id="version" style="position: fixed;bottom: 5px;left: 0;right: 5px;text-align: right;text-shadow: 0 0 5px white;font-size: 18px;opacity: .25;">-</div>
|
|
|
|
|
<div style="position: fixed; inset: 0; z-index: 999; cursor: pointer;" onclick="start();"></div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
@ -88,7 +159,6 @@
|
|
|
|
|
const remote = require('@electron/remote');
|
|
|
|
|
const { ipcRenderer } = require('electron');
|
|
|
|
|
|
|
|
|
|
let server = "http://192.168.1.121:8081/";
|
|
|
|
|
window.user = null;
|
|
|
|
|
window.authTimeout = null;
|
|
|
|
|
window.authApprovalInterval = null;
|
|
|
|
@ -97,6 +167,9 @@
|
|
|
|
|
window.browsingTimeout2 = null;
|
|
|
|
|
|
|
|
|
|
(async () => {
|
|
|
|
|
window.serverVersion = await (await window.fetch("https://delta.equestria.dev/version")).text();
|
|
|
|
|
document.getElementById("version").innerText = "v" + window.serverVersion;
|
|
|
|
|
|
|
|
|
|
let users = JSON.parse(await (await window.fetch(server + "/dev.equestria.delta.kiosk.GetUserList/")).text());
|
|
|
|
|
|
|
|
|
|
for (let user of users) {
|
|
|
|
@ -161,18 +234,29 @@
|
|
|
|
|
clearTimeout(window.authTimeout);
|
|
|
|
|
|
|
|
|
|
window.browsingTimeout1 = setInterval(() => {
|
|
|
|
|
if (document.getElementById("webview").getURL().endsWith("/login/")) {
|
|
|
|
|
if (document.getElementById("webview").getURL().includes("/login/")) {
|
|
|
|
|
end();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (document.getElementById("webview").getURL().endsWith("/_dev.equestria.delta.kiosk.ShutdownKiosk")) {
|
|
|
|
|
window.close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (document.getElementById("webview").getURL().endsWith("/_dev.equestria.delta.kiosk.DisableKiosk")) {
|
|
|
|
|
end();
|
|
|
|
|
document.getElementById("preload").style.display = "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (document.getElementById("webview").getURL().endsWith("/_dev.equestria.delta.kiosk.SessionEnd")) {
|
|
|
|
|
end();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
window.browsingTimeout2 = setTimeout(() => {
|
|
|
|
|
end();
|
|
|
|
|
}, 300000);
|
|
|
|
|
} else if (data['token'] === false) {
|
|
|
|
|
end();
|
|
|
|
|
}
|
|
|
|
|
}, 1000);
|
|
|
|
|
}
|
|
|
|
|