diff --git a/lang/de/admin_settings.php b/lang/de/admin_settings.php index 7d7414d..ffd62c4 100644 --- a/lang/de/admin_settings.php +++ b/lang/de/admin_settings.php @@ -116,6 +116,11 @@ return [ 'running' => 'läuft', ], + // Vollbild-Ansicht in der Konsolen-Hülle (layouts/admin.blade.php) — steht + // auf jeder Konsolenseite, solange eine Aktualisierung läuft, nicht nur + // auf der Einstellungsseite. + 'update_overlay_title' => 'Aktualisierung läuft.', + // Angefordert, aber der Dienst prüft im Takt — ohne Uhrzeit sitzt man davor // und weiß nicht, ob der Knopf überhaupt etwas getan hat. 'update_queued' => 'Angefordert. Der Update-Dienst startet sie spätestens um :time.', diff --git a/lang/en/admin_settings.php b/lang/en/admin_settings.php index d7b19ff..6620734 100644 --- a/lang/en/admin_settings.php +++ b/lang/en/admin_settings.php @@ -116,6 +116,10 @@ return [ 'running' => 'running', ], + // Full-screen view in the console shell (layouts/admin.blade.php) — shown + // on every console page while an update is running, not just Settings. + 'update_overlay_title' => 'Update in progress.', + // Requested, but the service checks on a timer — without a time an operator // sits in front of it not knowing whether the button did anything. 'update_queued' => 'Requested. The update service starts it by :time at the latest.', diff --git a/resources/js/app.js b/resources/js/app.js index 07fdb27..cba47a8 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -105,13 +105,17 @@ document.addEventListener('alpine:init', () => { // This asks a plain JSON endpoint instead — no Livewire, no component // state, no assets — and, crucially, treats a failed request as the // restart rather than as an error worth giving up over. - window.Alpine.data('updateWatcher', ({ url, commit, running }) => ({ + window.Alpine.data('updateWatcher', ({ url, commit, running, step = null }) => ({ // The build this page was rendered from. When the server stops // agreeing, the page is stale by definition and must be replaced — // this is the only signal that survives the restart, since the run has // already ended by the time we can ask again. renderedCommit: commit, wasRunning: running, + // Already translated server-side ("Schritt: …") — the client only + // ever displays this, never assembles it, so German text stays out + // of JavaScript entirely. + step, timer: null, init() { @@ -156,6 +160,7 @@ document.addEventListener('alpine:init', () => { } this.wasRunning = state.running; + this.step = state.step ?? null; } catch { // Expected while the containers are down. Keep asking: this is // the middle of the very event being watched, not a fault. diff --git a/resources/views/layouts/admin.blade.php b/resources/views/layouts/admin.blade.php index 18f9808..ba92029 100644 --- a/resources/views/layouts/admin.blade.php +++ b/resources/views/layouts/admin.blade.php @@ -11,7 +11,19 @@ corners. Colour comes from one place. --}}
- @php $release = App\Services\Deployment\Release::current(); @endphp + @php + $release = App\Services\Deployment\Release::current(); + + // Seeds the page-wide update watcher below. Computed here, once, for + // every console page — not only Settings — because the thing being + // watched restarts the containers serving whichever page the + // operator happens to have open, so the watcher (and its overlay) + // must already exist before that happens, wherever they are. + $updateState = app(App\Services\Deployment\UpdateChannel::class)->state(); + $updateStep = $updateState['phase'] !== null + ? __('admin_settings.update_step', ['step' => $updateState['phase']]) + : null; + @endphp{{ __('admin_settings.update_offline_hint') }}
+ + {{-- Only while there is one to show — a queued run has no phase + yet, and "Schritt:" with nothing after it is worse than + leaving the line out. --}} + +