v5.3.0 – AJAX history reload with auto/manual controls on job detail page - #117
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
location.reload(): nur der<tbody>wird aktualisiert — kein Flackern, Scroll-Position und aufgeklappte Outputs bleiben erhaltenCronController::show()liefert im?_json=1-Modus{has_running, rows_html}— Zeilen werden serverseitig via_detail_history_rows.phpgerendertsessionStorage) und manueller Reload-Button$this->translator->t(...)→$this->translator()->t(...)(Fatal Error in JSON mode);null ?? 'x'→ korrektenull-Prüfung fürhas_running-ErkennungTest plan