0.12.0: FIFO job retention (job_keep), clear-finished button, vmm-ctl prune
This commit is contained in:
1 parent
5dc6bfb5a2
commit
a1b4e884da
9 files changed
+83
-3
No files matched your search
@@ -5,6 +5,13 @@
|
||||
|
||||
require_once 'vmmngr-boot.inc';
|
||||
|
||||
if (strtoupper((string)($_SERVER['REQUEST_METHOD'] ?? '')) === 'POST' && ($_POST['act'] ?? '') === 'clear_jobs') {
|
||||
$res = vmm_job_prune(0);
|
||||
$_SESSION['vmmngr_error'] = sprintf(gettext('Removed %d finished job(s).'), (int)$res['removed']);
|
||||
header('Location: vmmngr_jobs.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$pgtitle = [gettext('Extensions'), gettext('VM Manager'), gettext('Jobs')];
|
||||
$id = (string)($_GET['id'] ?? '');
|
||||
$job = $id !== '' ? vmm_job_get($id) : null;
|
||||
@@ -21,6 +28,10 @@ vmm_nav('jobs');
|
||||
|
||||
<form action="vmmngr_jobs.php" method="post" name="iform" id="iform"><table id="area_data"><tbody><tr><td id="area_data_frame">
|
||||
|
||||
<?php if (!empty($_SESSION['vmmngr_error'])): ?>
|
||||
<?php print_info_box(vmm_h((string)$_SESSION['vmmngr_error'])); unset($_SESSION['vmmngr_error']); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($job !== null): ?>
|
||||
<table class="area_data_settings" style="width:100%;border-collapse:collapse;">
|
||||
<colgroup>
|
||||
@@ -52,6 +63,12 @@ vmm_nav('jobs');
|
||||
<br />
|
||||
<?php endif; ?>
|
||||
|
||||
<p>
|
||||
<button type="submit" class="formbtn" name="act" value="clear_jobs"
|
||||
onclick="return confirm('Remove all finished jobs? Running jobs are kept.')"><?=gettext('Clear finished jobs');?></button>
|
||||
<span style="opacity:.75;margin-left:8px;"><?=gettext('Retention keeps the newest %d jobs automatically (Configuration).', (int)(vmm_config()['job_keep'] ?? 100));?></span>
|
||||
</p>
|
||||
|
||||
<table class="area_data_selection" style="width:100%;border-collapse:collapse;">
|
||||
<colgroup>
|
||||
<col style="width:26%">
|
||||
|
||||
Reference in new issue
Block a user