redis check
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
root
2024-08-12 20:12:33 +02:00
parent 8399a6b3bb
commit 52164452b6
2 changed files with 36 additions and 17 deletions

View File

@@ -29,7 +29,7 @@
<br>
<br>
<div id="redis"></div>
<div id="previous">Scanning for previous install. Please wait...</div>
<div id="previous"></div>
</div>
</div>
<!-- Optional JavaScript -->
@@ -38,32 +38,49 @@
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.6/dist/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.2.1/dist/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
<script>
$(function() {
function start_init() {
var url = 'scan.php?op=init';
$.get(url, function(data){
if (data=='OK') {
$("#previous").html('Scanning for previous install. Please wait...');
check_init();
}
else {
$("#previous").html('Scanning for previous install has aborted...');
}
});
}
//$("#previous").html('Scanning for previous install. Please wait...');
function check_init() {
var url = 'scan.php?op=check_init';
$.get(url, function(data){
if (data=='NEW') {
$("#previous").html('No previous install has found...');
setTimeout(redirectToInstall, 3000);
}
else if (data=='EXISTS') {
$("#previous").html('Previous install has found...');
setTimeout(redirectToManage, 3000);
}
else {
setTimeout(check_init, 1000);
}
});
}
$(function() {
var url = 'scan.php?op=redis';
$.get(url, function(data){
if (data=='OK') {
$("#redis").html('Redis server - OK');
start_init();
}
else {
$("#redis").html('Redis server is not available...');
}
});
var url = 'scan.php?op=init';
$.get(url, function(data){
if (data=='OK') {
$("#previous").html('Previous install has found...');
setTimeout(redirectToManage, 3000);
}
else {
$("#previous").html('No previous install has found...');
setTimeout(redirectToInstall, 3000);
}
});
//setTimeout(redirectToManage, 10000);
$(".progress").each(function() {

View File

@@ -1,6 +1,6 @@
<?php
include "functions.php";
sleep(1);
switch ($_GET["op"]) {
case "redis":
try {
@@ -19,8 +19,10 @@ switch ($_GET["op"]) {
$op = "init:".date("YmdHis");
redis_set($op,$json);
echo "OK"; // TODO?
break;
case "init_check":
case "check_init":
echo "NEW";exit;// TEMP-TEST
$data = check_redis("web_out");
if ($data["STATUS"]==2) echo "NEW";
elseif ($data["STATUS"]==1) echo "EXISTS";