This commit is contained in:
47
index.html
47
index.html
@@ -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() {
|
||||
|
6
scan.php
6
scan.php
@@ -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";
|
||||
|
Reference in New Issue
Block a user