This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$REDIS_HOST='redis-server';
|
$REDIS_HOST='redis-server';
|
||||||
$SHARED_DIR = "shared";
|
$SHARED_DIR = "/var/tmp/shared";
|
||||||
$INTERFACE = "directory"; // redis OR directory
|
$INTERFACE = "directory"; // redis OR directory
|
||||||
|
//$INTERFACE = "redis";
|
||||||
|
|
||||||
function ping_redis() {
|
function ping_redis() {
|
||||||
|
|
||||||
@@ -282,25 +283,68 @@ function put_install_envs() {
|
|||||||
|
|
||||||
function set_output($op,$output) {
|
function set_output($op,$output) {
|
||||||
|
|
||||||
global $SHARED_DIR;
|
global $INTERFACE, $SHARED_DIR;
|
||||||
|
|
||||||
|
if ($INTERFACE=="redis") {
|
||||||
redis_set($op,$output);
|
redis_set($op,$output);
|
||||||
|
}
|
||||||
file_put_contents($SHARED_DIR."/".$op,$output);
|
else {
|
||||||
|
file_put_contents($SHARED_DIR."/input/".$op,$output);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function check_files($dir,$key) {
|
||||||
|
|
||||||
|
global $SHARED_DIR;
|
||||||
|
|
||||||
|
if (file_exists($SHARED_DIR."/{$dir}/".$key)) {
|
||||||
|
$arr[$key] = file_get_contents($SHARED_DIR."/{$dir}/".$key);
|
||||||
|
}
|
||||||
|
else $arr = "";
|
||||||
|
|
||||||
|
return $arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
function check_request($key="") {
|
||||||
|
|
||||||
|
global $INTERFACE;
|
||||||
|
|
||||||
|
if ($INTERFACE=="redis") {
|
||||||
|
$arr = check_redis("web_in",$key);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$arr = check_files("input",$key);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $arr;
|
||||||
|
}
|
||||||
|
|
||||||
function check_response($key="") {
|
function check_response($key="") {
|
||||||
|
|
||||||
|
global $INTERFACE;
|
||||||
|
|
||||||
|
if ($INTERFACE=="redis") {
|
||||||
$arr = check_redis("web_out",$key);
|
$arr = check_redis("web_out",$key);
|
||||||
//$arr = check_files("web_out",$key);
|
}
|
||||||
|
else {
|
||||||
|
$arr = check_files("output",$key);
|
||||||
|
}
|
||||||
|
|
||||||
return $arr;
|
return $arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove_response($key) {
|
function remove_response($key) {
|
||||||
|
|
||||||
|
global $INTERFACE, $SHARED_DIR;
|
||||||
|
|
||||||
|
if ($INTERFACE=="redis") {
|
||||||
redis_remove("$key");
|
redis_remove("$key");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//unlink($SHARED_DIR."/".$key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
154
manage.html
154
manage.html
@@ -91,6 +91,52 @@
|
|||||||
<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 src="https://cdn.jsdelivr.net/npm/bootstrap@4.2.1/dist/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
function check_deployments() {
|
||||||
|
var url = 'scan.php?op=check_deployments';
|
||||||
|
jQuery.get(url, function(data) {
|
||||||
|
console.log('check_deployments: '+data);
|
||||||
|
if (data=="WAIT" || data=="") {
|
||||||
|
setTimeout(check_deployments, 1000);
|
||||||
|
}
|
||||||
|
else jQuery("#deployments").html(data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_deployments() {
|
||||||
|
var url = 'scan.php?op=deployments';
|
||||||
|
jQuery.get(url, function(data) {
|
||||||
|
console.log('deployments: '+data);
|
||||||
|
if (data=="OK") {
|
||||||
|
setTimeout(check_deployments, 1000);
|
||||||
|
}
|
||||||
|
else jQuery("#deployments").html(data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function check_system() {
|
||||||
|
var url = 'scan.php?op=check_system&services=1';
|
||||||
|
jQuery.get(url, function(data) {
|
||||||
|
console.log('check_system: '+data);
|
||||||
|
if (data=="WAIT" || data=="") {
|
||||||
|
setTimeout(check_system, 1000);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
jQuery("#system").html(data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_system() {
|
||||||
|
var url = 'scan.php?op=system';
|
||||||
|
jQuery.get(url, function(data) {
|
||||||
|
console.log('system: '+data);
|
||||||
|
if (data=="OK") {
|
||||||
|
setTimeout(check_system, 1000);
|
||||||
|
}
|
||||||
|
else alert(data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function check_repositories() {
|
function check_repositories() {
|
||||||
var url = 'scan.php?op=check_repositories';
|
var url = 'scan.php?op=check_repositories';
|
||||||
jQuery.get(url, function(data) {
|
jQuery.get(url, function(data) {
|
||||||
@@ -107,6 +153,7 @@ function check_repositories() {
|
|||||||
function get_repositories() {
|
function get_repositories() {
|
||||||
var url = 'scan.php?op=repositories';
|
var url = 'scan.php?op=repositories';
|
||||||
jQuery.get(url, function(data) {
|
jQuery.get(url, function(data) {
|
||||||
|
console.log('repositories: '+data);
|
||||||
if (data=="OK") {
|
if (data=="OK") {
|
||||||
setTimeout(check_repositories, 500);
|
setTimeout(check_repositories, 500);
|
||||||
}
|
}
|
||||||
@@ -117,37 +164,17 @@ function get_repositories() {
|
|||||||
function add_repository() {
|
function add_repository() {
|
||||||
var url = 'scan.php?op=add_repository&repo='+jQuery('#repository').val();
|
var url = 'scan.php?op=add_repository&repo='+jQuery('#repository').val();
|
||||||
jQuery.get(url, function(data) {
|
jQuery.get(url, function(data) {
|
||||||
|
console.log('add_repository: '+data);
|
||||||
if (data=="OK") {
|
if (data=="OK") {
|
||||||
}
|
}
|
||||||
get_repositories();
|
get_repositories();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_system() {
|
|
||||||
var url = 'scan.php?op=check_system&services=1';
|
|
||||||
jQuery.get(url, function(data) {
|
|
||||||
if (data=="WAIT" || data=="") {
|
|
||||||
setTimeout(check_system, 1000);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
jQuery("#system").html(data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_system() {
|
|
||||||
var url = 'scan.php?op=system';
|
|
||||||
jQuery.get(url, function(data) {
|
|
||||||
if (data=="OK") {
|
|
||||||
setTimeout(check_system, 1000);
|
|
||||||
}
|
|
||||||
else alert(data);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function check_updates() {
|
function check_updates() {
|
||||||
var url = 'scan.php?op=check_updates';
|
var url = 'scan.php?op=check_updates';
|
||||||
jQuery.get(url, function(data) {
|
jQuery.get(url, function(data) {
|
||||||
|
console.log('check_updates: '+data);
|
||||||
if (data=="WAIT" || data=="") {
|
if (data=="WAIT" || data=="") {
|
||||||
setTimeout(check_updates, 1000);
|
setTimeout(check_updates, 1000);
|
||||||
}
|
}
|
||||||
@@ -160,54 +187,28 @@ function check_updates() {
|
|||||||
function get_updates() {
|
function get_updates() {
|
||||||
var url = 'scan.php?op=updates';
|
var url = 'scan.php?op=updates';
|
||||||
jQuery.get(url, function(data) {
|
jQuery.get(url, function(data) {
|
||||||
|
console.log('updates: '+data);
|
||||||
if (data=="OK") {
|
if (data=="OK") {
|
||||||
setTimeout(check_updates, 1000);
|
setTimeout(check_updates, 1000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_deployments() {
|
|
||||||
var url = 'scan.php?op=check_deployments';
|
|
||||||
jQuery.get(url, function(data) {
|
|
||||||
if (data!="") {
|
|
||||||
jQuery("#deployments").html(data);
|
|
||||||
}
|
|
||||||
else setTimeout(check_deployments, 1000);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_deployments() {
|
|
||||||
var url = 'scan.php?op=deployments';
|
|
||||||
jQuery.get(url, function(data) {
|
|
||||||
if (data=="OK") {
|
|
||||||
setTimeout(check_deployments, 1000);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function load_template(additional) {
|
function load_template(additional) {
|
||||||
jQuery("#"+additional).html('Loading...');
|
jQuery("#"+additional).html('Loading '+additional+' template...');
|
||||||
var url = 'scan.php?op=deployment&additional='+additional;
|
var url = 'scan.php?op=deployment&additional='+additional;
|
||||||
jQuery.get(url, function(data) {
|
jQuery.get(url, function(data) {
|
||||||
|
console.log('load_template: '+data);
|
||||||
if (data=="OK") {
|
if (data=="OK") {
|
||||||
setTimeout(check_deployment, 1000, additional);
|
setTimeout(check_deployment, 1000, additional);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function reinstall(additional) {
|
|
||||||
jQuery("#"+additional).html('Loading...');
|
|
||||||
var url = 'scan.php?op=reinstall&additional='+additional;
|
|
||||||
jQuery.get(url, function(data) {
|
|
||||||
if (data=="OK") {
|
|
||||||
setTimeout(check_reinstall, 1000, additional);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function check_reinstall(additional) {
|
function check_reinstall(additional) {
|
||||||
var url = 'scan.php?op=check_reinstall';
|
var url = 'scan.php?op=check_reinstall';
|
||||||
jQuery.get(url, function(data) {
|
jQuery.get(url, function(data) {
|
||||||
|
console.log('check_reinstall: '+data);
|
||||||
if (data!="") {
|
if (data!="") {
|
||||||
jQuery("#"+additional).html(data);
|
jQuery("#"+additional).html(data);
|
||||||
}
|
}
|
||||||
@@ -215,12 +216,13 @@ function check_reinstall(additional) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function uninstall(additional) {
|
function reinstall(additional) {
|
||||||
var url = 'scan.php?op=uninstall&additional='+additional;
|
jQuery("#"+additional).html('Loading...');
|
||||||
|
var url = 'scan.php?op=reinstall&additional='+additional;
|
||||||
jQuery.get(url, function(data) {
|
jQuery.get(url, function(data) {
|
||||||
if (data!="") {
|
console.log('reinstall '+additional+': '+data);
|
||||||
jQuery("#"+additional).html(data);
|
if (data=="OK") {
|
||||||
setTimeout(check_uninstall, 1000, additional);
|
setTimeout(check_reinstall, 1000, additional);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -228,6 +230,7 @@ function uninstall(additional) {
|
|||||||
function check_uninstall(additional) {
|
function check_uninstall(additional) {
|
||||||
var url = 'scan.php?op=check_uninstall';
|
var url = 'scan.php?op=check_uninstall';
|
||||||
jQuery.get(url, function(data) {
|
jQuery.get(url, function(data) {
|
||||||
|
console.log('check_uninstall '+additional+': '+data);
|
||||||
if (data!="") {
|
if (data!="") {
|
||||||
jQuery("#"+additional).html(data);
|
jQuery("#"+additional).html(data);
|
||||||
}
|
}
|
||||||
@@ -235,6 +238,28 @@ function check_uninstall(additional) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function uninstall(additional) {
|
||||||
|
var url = 'scan.php?op=uninstall&additional='+additional;
|
||||||
|
jQuery.get(url, function(data) {
|
||||||
|
console.log('uninstall '+additional+': '+data);
|
||||||
|
if (data!="") {
|
||||||
|
jQuery("#"+additional).html(data);
|
||||||
|
setTimeout(check_uninstall, 1000, additional);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function check_deployment(additional) {
|
||||||
|
var url = 'scan.php?op=check_deployment';
|
||||||
|
jQuery.get(url, function(data) {
|
||||||
|
console.log('check_deployment '+additional+': '+data);
|
||||||
|
if (data!="") {
|
||||||
|
jQuery("#"+additional).html(data);
|
||||||
|
}
|
||||||
|
else setTimeout(check_deployment, 1000, additional);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function deploy(additional) {
|
function deploy(additional) {
|
||||||
pars = '';
|
pars = '';
|
||||||
jQuery('input.additional_field').each(function(index) {
|
jQuery('input.additional_field').each(function(index) {
|
||||||
@@ -244,6 +269,7 @@ function deploy(additional) {
|
|||||||
//console.log(pars);
|
//console.log(pars);
|
||||||
var url = 'scan.php?op=deploy&additional='+additional+pars;
|
var url = 'scan.php?op=deploy&additional='+additional+pars;
|
||||||
jQuery.get(url, function(data) {
|
jQuery.get(url, function(data) {
|
||||||
|
console.log('deploy '+additional+': '+data);
|
||||||
if (data!="") {
|
if (data!="") {
|
||||||
jQuery("#"+additional).html(data);
|
jQuery("#"+additional).html(data);
|
||||||
setTimeout(check_deployment, 1000, additional);
|
setTimeout(check_deployment, 1000, additional);
|
||||||
@@ -251,19 +277,10 @@ function deploy(additional) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_deployment(additional) {
|
|
||||||
var url = 'scan.php?op=check_deployment';
|
|
||||||
jQuery.get(url, function(data) {
|
|
||||||
if (data!="") {
|
|
||||||
jQuery("#"+additional).html(data);
|
|
||||||
}
|
|
||||||
else setTimeout(check_deployment, 1000, additional);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function check_services() {
|
function check_services() {
|
||||||
var url = 'scan.php?op=check_services';
|
var url = 'scan.php?op=check_services';
|
||||||
jQuery.get(url, function(data) {
|
jQuery.get(url, function(data) {
|
||||||
|
console.log('check_services: '+data);
|
||||||
if (data=="WAIT" || data=="") {
|
if (data=="WAIT" || data=="") {
|
||||||
setTimeout(check_services, 1000);
|
setTimeout(check_services, 1000);
|
||||||
}
|
}
|
||||||
@@ -276,6 +293,7 @@ function check_services() {
|
|||||||
function get_services() {
|
function get_services() {
|
||||||
var url = 'scan.php?op=services';
|
var url = 'scan.php?op=services';
|
||||||
jQuery.get(url, function(data) {
|
jQuery.get(url, function(data) {
|
||||||
|
console.log('services: '+data);
|
||||||
setTimeout(check_services, 1000);
|
setTimeout(check_services, 1000);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -283,6 +301,7 @@ function get_services() {
|
|||||||
function check_containers() {
|
function check_containers() {
|
||||||
var url = 'scan.php?op=check_containers';
|
var url = 'scan.php?op=check_containers';
|
||||||
jQuery.get(url, function(data) {
|
jQuery.get(url, function(data) {
|
||||||
|
console.log('check_containers: '+data);
|
||||||
if (data!="") {
|
if (data!="") {
|
||||||
jQuery("#containers").html(data);
|
jQuery("#containers").html(data);
|
||||||
}
|
}
|
||||||
@@ -293,6 +312,7 @@ function check_containers() {
|
|||||||
function get_containers() {
|
function get_containers() {
|
||||||
var url = 'scan.php?op=containers';
|
var url = 'scan.php?op=containers';
|
||||||
jQuery.get(url, function(data) {
|
jQuery.get(url, function(data) {
|
||||||
|
console.log('containers: '+data);
|
||||||
if (data=="OK") {
|
if (data=="OK") {
|
||||||
setTimeout(check_containers, 1000);
|
setTimeout(check_containers, 1000);
|
||||||
}
|
}
|
||||||
|
61
scan.php
61
scan.php
@@ -82,7 +82,7 @@ switch ($_GET["op"]) {
|
|||||||
else echo "ERROR";
|
else echo "ERROR";
|
||||||
break;
|
break;
|
||||||
case "check_services":
|
case "check_services":
|
||||||
$arr = check_redis("web_out","services");
|
$arr = check_response("services");
|
||||||
if (!empty($arr)) {
|
if (!empty($arr)) {
|
||||||
foreach ($arr as $key=>$data) {
|
foreach ($arr as $key=>$data) {
|
||||||
if ($key=="services") {
|
if ($key=="services") {
|
||||||
@@ -95,7 +95,7 @@ switch ($_GET["op"]) {
|
|||||||
}
|
}
|
||||||
echo "<br>";
|
echo "<br>";
|
||||||
}
|
}
|
||||||
redis_remove("$key");
|
remove_response("$key");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -105,12 +105,11 @@ switch ($_GET["op"]) {
|
|||||||
$arr = array("STATUS" => 0);
|
$arr = array("STATUS" => 0);
|
||||||
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
|
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
|
||||||
|
|
||||||
$op = "updates"; //"init:".date("YmdHis");
|
if (set_output("updates",$json)) echo "OK";
|
||||||
redis_set($op,$json);
|
else echo "ERROR";
|
||||||
echo "OK"; // TODO?
|
|
||||||
break;
|
break;
|
||||||
case "check_updates":
|
case "check_updates":
|
||||||
$arr = check_redis("web_out","updates");
|
$arr = check_response("updates");
|
||||||
if (!empty($arr)) {
|
if (!empty($arr)) {
|
||||||
foreach ($arr as $key=>$data) {
|
foreach ($arr as $key=>$data) {
|
||||||
if ($key=="updates") {
|
if ($key=="updates") {
|
||||||
@@ -121,7 +120,7 @@ switch ($_GET["op"]) {
|
|||||||
}
|
}
|
||||||
echo "<br>";
|
echo "<br>";
|
||||||
}
|
}
|
||||||
redis_remove("$key");
|
remove_response("$key");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -135,7 +134,7 @@ switch ($_GET["op"]) {
|
|||||||
else echo "ERROR";
|
else echo "ERROR";
|
||||||
break;
|
break;
|
||||||
case "check_deployments":
|
case "check_deployments":
|
||||||
$arr = check_redis("web_out","deployments");
|
$arr = check_response("deployments");
|
||||||
if (!empty($arr)) {
|
if (!empty($arr)) {
|
||||||
foreach ($arr as $key=>$data) {
|
foreach ($arr as $key=>$data) {
|
||||||
if ($key=="deployments") {
|
if ($key=="deployments") {
|
||||||
@@ -168,24 +167,23 @@ switch ($_GET["op"]) {
|
|||||||
}
|
}
|
||||||
else echo "There are no installed services.<br>";
|
else echo "There are no installed services.<br>";
|
||||||
*/
|
*/
|
||||||
redis_remove("$key");
|
remove_response("$key");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else echo "";
|
else echo "WAIT";
|
||||||
break;
|
break;
|
||||||
case "deployment":
|
case "deployment":
|
||||||
$arr = array("NAME" => $_GET["additional"], "ACTION" => "ask");
|
$arr = array("NAME" => $_GET["additional"], "ACTION" => "ask");
|
||||||
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
|
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
|
||||||
|
|
||||||
$op = "deployment";
|
if (set_output("deployment",$json)) echo "OK";
|
||||||
redis_set($op,$json);
|
else echo "ERROR";
|
||||||
echo "OK"; // TODO?
|
|
||||||
break;
|
break;
|
||||||
case "check_reinstall":
|
case "check_reinstall":
|
||||||
$reinstall = 1;
|
$reinstall = 1;
|
||||||
case "check_deployment":
|
case "check_deployment":
|
||||||
$arr = check_redis("web_out","deployment");
|
$arr = check_response("deployment");
|
||||||
if (!empty($arr)) {
|
if (!empty($arr)) {
|
||||||
foreach ($arr as $key=>$data) {
|
foreach ($arr as $key=>$data) {
|
||||||
if ($key=="deployment") {
|
if ($key=="deployment") {
|
||||||
@@ -224,16 +222,16 @@ switch ($_GET["op"]) {
|
|||||||
elseif ($data["STATUS"]=="2") { // deploy
|
elseif ($data["STATUS"]=="2") { // deploy
|
||||||
echo "Install has finished.";
|
echo "Install has finished.";
|
||||||
}
|
}
|
||||||
redis_remove("$key");
|
remove_response("$key");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$arr = check_redis("web_in","deployment");
|
$arr = check_request("deployment");
|
||||||
if (!empty($arr)) { // deployment in progress
|
if (!empty($arr)) { // deployment in progress
|
||||||
foreach ($arr as $key=>$data) {
|
foreach ($arr as $key=>$data) {
|
||||||
if ($key=="deployment") {
|
if ($key=="deployment") {
|
||||||
if ($data["STATUS"]=="1") { // TODO - curenct state message???
|
if ($data["STATUS"]=="1") { // TODO - current state message???
|
||||||
echo "Install in progress... Please wait...";
|
echo "Install in progress... Please wait...";
|
||||||
}
|
}
|
||||||
elseif ($data["STATUS"]=="2") {
|
elseif ($data["STATUS"]=="2") {
|
||||||
@@ -275,8 +273,8 @@ switch ($_GET["op"]) {
|
|||||||
$payload = base64_encode(json_encode($fields, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT));
|
$payload = base64_encode(json_encode($fields, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT));
|
||||||
$arr = array("NAME" => $_GET["additional"], "ACTION" => "deploy", "PAYLOAD" => $payload);
|
$arr = array("NAME" => $_GET["additional"], "ACTION" => "deploy", "PAYLOAD" => $payload);
|
||||||
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
|
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
|
||||||
$op = "deployment";
|
if (set_output("deployment",$json)) echo "OK";
|
||||||
redis_set($op,$json);
|
else echo "ERROR";
|
||||||
}
|
}
|
||||||
echo $text;
|
echo $text;
|
||||||
break;
|
break;
|
||||||
@@ -284,9 +282,8 @@ switch ($_GET["op"]) {
|
|||||||
$arr = array("NAME" => $_GET["additional"], "ACTION" => "reinstall");
|
$arr = array("NAME" => $_GET["additional"], "ACTION" => "reinstall");
|
||||||
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
|
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
|
||||||
|
|
||||||
$op = "deployment";
|
if (set_output("deployment",$json)) echo "OK";
|
||||||
redis_set($op,$json);
|
else echo "ERROR";
|
||||||
echo "OK"; // TODO?
|
|
||||||
break;
|
break;
|
||||||
case "uninstall":
|
case "uninstall":
|
||||||
if ($key=check_deploy()) {
|
if ($key=check_deploy()) {
|
||||||
@@ -297,7 +294,8 @@ switch ($_GET["op"]) {
|
|||||||
$arr = array("NAME" => $_GET["additional"], "ACTION" => "uninstall");
|
$arr = array("NAME" => $_GET["additional"], "ACTION" => "uninstall");
|
||||||
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
|
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
|
||||||
$op = "deployment";
|
$op = "deployment";
|
||||||
redis_set($op,$json);
|
if (set_output("deployment",$json)) echo "OK";
|
||||||
|
else echo "ERROR";
|
||||||
}
|
}
|
||||||
echo $text;
|
echo $text;
|
||||||
break;
|
break;
|
||||||
@@ -305,7 +303,6 @@ switch ($_GET["op"]) {
|
|||||||
$arr = array("STATUS" => 0);
|
$arr = array("STATUS" => 0);
|
||||||
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
|
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
|
||||||
|
|
||||||
$op = "repositories";
|
|
||||||
if (set_output("repositories",$json)) echo "OK";
|
if (set_output("repositories",$json)) echo "OK";
|
||||||
else echo "ERROR";
|
else echo "ERROR";
|
||||||
break;
|
break;
|
||||||
@@ -326,30 +323,28 @@ switch ($_GET["op"]) {
|
|||||||
else echo "WAIT";
|
else echo "WAIT";
|
||||||
break;
|
break;
|
||||||
case "add_repository":
|
case "add_repository":
|
||||||
redis_remove("add_repository");
|
remove_response("add_repository");
|
||||||
|
|
||||||
$arr = array("NEW_REPO" => $_GET["repo"]);
|
$arr = array("NEW_REPO" => $_GET["repo"]);
|
||||||
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
|
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
|
||||||
|
|
||||||
$op = "add_repository";
|
if (set_output("add_repository",$json)) echo "OK";
|
||||||
redis_set($op,$json);
|
else echo "ERROR";
|
||||||
echo "OK"; // TODO?
|
|
||||||
break;
|
break;
|
||||||
case "containers":
|
case "containers":
|
||||||
$arr = array("STATUS" => 0);
|
$arr = array("STATUS" => 0);
|
||||||
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
|
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
|
||||||
|
|
||||||
$op = "containers";
|
if (set_output("containers",$json)) echo "OK";
|
||||||
redis_set($op,$json);
|
else echo "ERROR";
|
||||||
echo "OK"; // TODO?
|
|
||||||
break;
|
break;
|
||||||
case "check_containers":
|
case "check_containers":
|
||||||
$arr = check_redis("web_out","containers");
|
$arr = check_response("containers");
|
||||||
if (!empty($arr)) {
|
if (!empty($arr)) {
|
||||||
foreach ($arr as $key=>$data) {
|
foreach ($arr as $key=>$data) {
|
||||||
if ($key=="containers") {
|
if ($key=="containers") {
|
||||||
echo base64_decode($data["RESULT"]);
|
echo base64_decode($data["RESULT"]);
|
||||||
redis_remove("$key");
|
remove_response("$key");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user