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

This commit is contained in:
2025-03-13 00:48:03 +01:00
parent 1cfa962229
commit 16ea6140bd
2 changed files with 21 additions and 2 deletions

View File

@@ -339,6 +339,24 @@ function deploy(additional) {
}); });
} }
function redeploy(additional) {
pars = '';
jQuery('input.additional_'+additional).each(function(index) {
console.log('Field ' + $(this).attr('name') + ': ' + $(this).val());
//pars += '&'+$(this).attr('id') + '=' + $(this).val();
pars += '&'+$(this).attr('name') + '=' + $(this).val();
});
//console.log(pars);
var url = 'scan.php?op=redeploy&additional='+additional+pars;
jQuery.get(url, function(data) {
console.log('redeploy '+additional+': '+data);
if (data!="") {
jQuery("#"+additional).html(data);
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) {

View File

@@ -224,7 +224,7 @@ switch ($_GET["op"]) {
</form></fieldset> </form></fieldset>
<script> <script>
jQuery('#deploy_{$template->name}_form').submit(function() { jQuery('#deploy_{$template->name}_form').submit(function() {
deploy('{$template->name}'); ".($reinstall ? "redeploy" : "deploy")."('{$template->name}');
return false; return false;
}); });
</script> </script>
@@ -256,6 +256,7 @@ switch ($_GET["op"]) {
else echo ""; // no deployment, finished else echo ""; // no deployment, finished
} }
break; break;
case "redeploy":
case "deploy": case "deploy":
if ($key=check_deploy($_GET["additional"])) { if ($key=check_deploy($_GET["additional"])) {
$text="A deployment ({$_GET["additional"]}) has already started.<br>Please wait and do not start a new one..."; $text="A deployment ({$_GET["additional"]}) has already started.<br>Please wait and do not start a new one...";
@@ -294,7 +295,7 @@ 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" => $_GET["op"], "PAYLOAD" => $payload);
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT); $json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
if (set_output("deployment",$json)) echo "OK"; if (set_output("deployment",$json)) echo "OK";
else echo "ERROR"; else echo "ERROR";