Skip to content

v5.3.0 – AJAX history reload with auto/manual controls on job detail page - #117

Merged
csoscd merged 3 commits into
mainfrom
feature/detail-reload-controls
Aug 26, 2026
Merged

v5.3.0 – AJAX history reload with auto/manual controls on job detail page#117
csoscd merged 3 commits into
mainfrom
feature/detail-reload-controls

Conversation

@csoscd

@csoscd csoscd commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • AJAX-Reload der Ausführungshistorie statt location.reload(): nur der <tbody> wird aktualisiert — kein Flackern, Scroll-Position und aufgeklappte Outputs bleiben erhalten
  • CronController::show() liefert im ?_json=1-Modus {has_running, rows_html} — Zeilen werden serverseitig via _detail_history_rows.php gerendert
  • Zwei Icon-Buttons im Ausführungshistorie-Header: Auto-Reload-Toggle (Pause/Play, persistiert in sessionStorage) und manueller Reload-Button
  • Gelber Countdown-Banner entfernt
  • Bugfixes: $this->translator->t(...)$this->translator()->t(...) (Fatal Error in JSON mode); null ?? 'x' → korrekte null-Prüfung für has_running-Erkennung

Test plan

  • PHP Tests (PHP 8.4) — passed
  • Security checks — passed
  • Dev Docker images gebaut — success
  • Manuell getestet: Auto-Reload läuft, Icon-Toggle funktioniert, stoppt automatisch wenn Job fertig

csoscd added 3 commits August 26, 2026 09:56
Replace location.reload() with targeted AJAX refresh of the execution
history tbody. CronController::show() gains a ?_json=1 branch that
fetches history + job in a parallel batch, renders <tr> elements via the
new _detail_history_rows.php partial, and returns {has_running, rows_html}.
Session is closed before agent I/O (writeClose()).

Two icon buttons in the Ausführungshistorie header:
- Auto-reload toggle (pause/play): arms 10-second polling when a job is
  running (default ON), stops automatically when the job finishes. State
  persists in sessionStorage keyed by job ID.
- Manual reload: immediate AJAX fetch on click.

The yellow countdown banner is removed; the toggle icon replaces it.
_detail_history_rows.php is shared between full-page and JSON renders,
keeping badge and output logic in one place.
… mode

CronController::show() JSON branch used $this->translator->t(...) but the
translator is accessed via the protected translator() method, not a public
property. This caused a fatal error on every ?_json=1 request, silently
swallowed by the JS catch block — making the AJAX reload appear broken.
$_e['exit_code'] ?? 'x' returns 'x' when exit_code IS null because ??
treats null as absent and returns the right-side fallback. This caused
has_running to always be false, stopping auto-reload after the first
fetch. Use the same pattern as the template: $ec = $_e['exit_code'] ?? null;
then compare $ec === null.
@csoscd
csoscd merged commit 2eea9bb into main Aug 26, 2026
12 checks passed
@csoscd
csoscd deleted the feature/detail-reload-controls branch August 27, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant