Scheduler: 50/50 split, taller log, auto-load most recent log on page load

This commit is contained in:
Gmer4Lfe
2026-05-23 18:02:40 -04:00
parent 706ef2dd72
commit 477b2041a7
2 changed files with 19 additions and 4 deletions
@@ -247,3 +247,18 @@ function vvClearRightLog() {
.catch(() => {});
}
</script>
<?php
// Auto-open the most recently run script on page load
$lastId = null; $lastMtime = 0;
foreach ($tree as $orch) {
$log = vv_job_log_path($orch['id']);
if (file_exists($log) && ($m = filemtime($log)) > $lastMtime) { $lastMtime = $m; $lastId = $orch['id']; }
foreach (($orch['children'] ?? []) as $child) {
$log = vv_job_log_path($child['id']);
if (file_exists($log) && ($m = filemtime($log)) > $lastMtime) { $lastMtime = $m; $lastId = $child['id']; }
}
}
if ($lastId): ?>
<script>vvOpenRight(<?= json_encode($lastId) ?>);</script>
<?php endif; ?>