0.7.0: after_action setting (stay on page with job status vs jump to log), settings UI

This commit is contained in:
Claw committed 2026-11-17 21:00:47 +01:00
1 parent 642a11f505
commit cbf899b94b
6 files changed
+110 -5

No files matched your search

+15 -2
View File
@@ -83,7 +83,7 @@ if (strtoupper((string)($_SERVER['REQUEST_METHOD'] ?? '')) === 'POST' && isset($
exit;
}
$job = vmm_job_new('start', $name);
header('Location: vmmngr_jobs.php?id=' . urlencode((string)$job['id']));
header('Location: ' . vmm_after_job_target((string)$job['id'], 'vmmngr_vm.php?name=' . urlencode($name)));
exit;
}
$check = vmm_action_check($verb, $vmName, (string)($_POST['confirm'] ?? ''));
@@ -93,7 +93,7 @@ if (strtoupper((string)($_SERVER['REQUEST_METHOD'] ?? '')) === 'POST' && isset($
exit;
}
$job = vmm_job_new($verb, $vmName);
header('Location: vmmngr_jobs.php?id=' . urlencode((string)$job['id']));
header('Location: ' . vmm_after_job_target((string)$job['id'], 'vmmngr_vm.php?name=' . urlencode($name)));
exit;
}
@@ -103,6 +103,11 @@ if (vmm_vm_state($name) === 'absent') {
exit;
}
$activeJob = (string)($_GET['job'] ?? '');
if ($activeJob !== '' && vmm_job_running($activeJob)) {
header('Refresh: 3');
}
$info = vmm_info($name);
$pgtitle = [gettext('Extensions'), gettext('VM Manager'), $name];
$jobs = vmm_job_list(10, $name);
@@ -114,6 +119,14 @@ vmm_nav('dashboard');
<form action="vmmngr_vm.php?name=<?=urlencode($name);?>" method="post" name="iform" id="iform"><table id="area_data"><tbody><tr><td id="area_data_frame">
<?php if ($activeJob !== ''): ?>
<?=vmm_job_status_html($activeJob); ?>
<?php endif; ?>
<?php if (!empty($_SESSION['vmmngr_error'])): ?>
<?php print_info_box(vmm_h((string)$_SESSION['vmmngr_error'])); unset($_SESSION['vmmngr_error']); ?>
<?php endif; ?>
<?php if (isset($info['error'])): ?>
<?php print_info_box(sprintf(gettext('Could not read VM details: %s'), vmm_h((string)$info['error']))); ?>
<?php else: ?>