4 ème essaie
continuous-integration/drone/push Build is passing Details

ServeurDeTest
Noé GARNIER 2 years ago
parent b4dd21390c
commit 0acee3ab42

@ -59,7 +59,7 @@
<div class="row"> <div class="row">
<div class="d-flex justify-content-center ltext-center" style="cursor: pointer; height: 20%"> <div class="d-flex justify-content-center ltext-center" style="cursor: pointer; height: 20%">
<div class="m-3"> <div class="m-3">
<a class="btn" href="index.php?action=addToQueue" onclick="waiting()"> <a class="btn" href="#" onclick="waiting()">
<span>LANCER</span> <span>LANCER</span>
</a> </a>
</div> </div>
@ -81,6 +81,16 @@
document.getElementsByClassName("btn").style.display = "none" document.getElementsByClassName("btn").style.display = "none"
} }
function addToQueue(){
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=addToQueue', true);
xhr.responseType = 'text';
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.onload = function () {
};
xhr.send(null);
}
function checkIsReady() { function checkIsReady() {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=waiting', true); xhr.open('POST', 'http://82.165.180.114/Scripted/WEB/index.php?action=waiting', true);
@ -93,8 +103,10 @@
}; };
xhr.send(null); xhr.send(null);
} }
function waiting(){ function waiting(){
displayWaiting(); displayWaiting();
addToQueue();
var countdownTimer = setInterval('checkIsReady()', 1000); var countdownTimer = setInterval('checkIsReady()', 1000);
} }
</script> </script>

Loading…
Cancel
Save