uninstall, check_uninstall
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-03-13 13:00:25 +01:00
parent 16ea6140bd
commit 49fa4e040d

View File

@@ -309,20 +309,52 @@ switch ($_GET["op"]) {
if (set_output("deployment",$json)) echo "OK"; if (set_output("deployment",$json)) echo "OK";
else echo "ERROR"; else echo "ERROR";
break; break;
case "uninstall": case "check_uninstall":
if ($key=check_deploy()) { $arr = check_deploy($_GET["additional"]);
$text="Deploy/uninstall process has already started.<br>Please wait and do not start a new one..."; if (!empty($arr)) { // deployment in progress
} foreach ($arr as $key=>$data) {
else { if ($key=="deploy-".$_GET["additional"]) {
$text="Uninstall in progress... Please wait..."; if ($data["STATUS"]=="1") {
$arr = array("NAME" => $_GET["additional"], "ACTION" => "uninstall"); echo "Install in progress... You can't uninstall while in progress...";
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT); }
$op = "deployment"; elseif ($data["STATUS"]=="2") {
if (set_output("deployment",$json)) echo "OK"; echo "Install has finished...";
else echo "ERROR"; remove_response("$key");
} }
echo $text; }
break; }
}
else { // no deployment in progress -> uninstall
$key = "uninstall-".$_GET["additional"];
$arr = check_response($key);
if (!empty($arr)) {
$data = $arr[$key];
if ($data["STATUS"]=="1") {
echo "Uninstall in progress... Please wait... ".date("Y-m-d H:i:s");
}
elseif ($data["STATUS"]=="2") {
echo "OK";
remove_response("$key");
}
}
else echo "Uninstall in progress... Please wait...";
}
break;
case "uninstall":
if ($key=check_deploy($_GET["additional"])) {
$text="Deploy/uninstall process has already started.<br>Please wait and do not start a new one...";
}
else {
$text="Uninstall in progress... Please wait...";
$arr = array("NAME" => $_GET["additional"], "ACTION" => "uninstall");
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
if (set_output("deployment",$json)) echo "OK";
else echo "ERROR";
}
echo $text;
break;
case "repositories": case "repositories":
$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);