Scheduler: single Save Schedule button at bottom saves all cron entries at once
This commit is contained in:
@@ -4,9 +4,9 @@ $tree = vv_job_tree();
|
||||
?>
|
||||
|
||||
<div id="vv-scheduler">
|
||||
<p class="vv-hint">Toggle saves immediately. Edit cron then <strong>Save</strong>.
|
||||
<strong>Run</strong> fires now; <strong>Dry Run</strong> sets DRY_RUN=1.
|
||||
Log opens on the right.</p>
|
||||
<p class="vv-hint">Toggle saves immediately. Fill in cron expressions and hit
|
||||
<strong>Save Schedule</strong> at the bottom. <strong>Run</strong> fires now;
|
||||
<strong>Dry Run</strong> sets DRY_RUN=1. Log opens on the right.</p>
|
||||
|
||||
<div id="vv-sched-layout">
|
||||
|
||||
@@ -61,14 +61,15 @@ $tree = vv_job_tree();
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="vv-card-footer">
|
||||
<button class="vv-save-btn" onclick="vvSaveCard(this)">Save Schedule</button>
|
||||
<span class="vv-save-status"></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<!-- Single global save -->
|
||||
<div class="vv-card-footer" style="margin-top:4px;">
|
||||
<button class="vv-save-btn" onclick="vvSaveAll(this)">Save Schedule</button>
|
||||
<span id="vv-save-all-status" class="vv-save-status"></span>
|
||||
</div>
|
||||
|
||||
</div><!-- /#vv-sched-left -->
|
||||
|
||||
<!-- ── Right: persistent log panel ── -->
|
||||
@@ -214,11 +215,11 @@ function vvSaveJob(el) {
|
||||
.then(d => { if (status) vvFlashStatus(status, d.ok ? '✓' : '✗ ' + (d.error ?? ''), d.ok); });
|
||||
}
|
||||
|
||||
function vvSaveCard(btn) {
|
||||
const card = btn.closest('.vv-sched-card');
|
||||
const status = card.querySelector('.vv-save-status');
|
||||
const jobs = card.querySelectorAll('[data-id]');
|
||||
function vvSaveAll() {
|
||||
const status = document.getElementById('vv-save-all-status');
|
||||
const jobs = document.querySelectorAll('#vv-sched-left [data-id]');
|
||||
let pending = jobs.length, allOk = true;
|
||||
if (!pending) { vvFlashStatus(status, '✗ No jobs found', false); return; }
|
||||
status.textContent = 'Saving…';
|
||||
jobs.forEach(job => {
|
||||
const id = job.dataset.id;
|
||||
|
||||
Reference in New Issue
Block a user