diff --git a/app/Livewire/Admin/Provisioning.php b/app/Livewire/Admin/Provisioning.php index 5ad0d52..7b31884 100644 --- a/app/Livewire/Admin/Provisioning.php +++ b/app/Livewire/Admin/Provisioning.php @@ -53,8 +53,31 @@ class Provisioning extends Component 'attempt' => $r->attempt, 'state' => $this->runState($r), ])->all(), - 'steps' => $active ? $this->buildRunSteps($active) : [], - 'activeLabel' => $active ? $this->subjectLabel($active).' · '.$active->pipeline : '—', + 'panel' => $active ? $this->panelFor($active) : null, ]); } + + /** Compact "current run" readout for the right column. */ + private function panelFor(ProvisioningRun $run): array + { + $pipeline = config('provisioning.pipelines.'.$run->pipeline, []); + $total = max(count($pipeline), 1); + $current = min($run->current_step, $total - 1); + $completed = $run->status === ProvisioningRun::STATUS_COMPLETED; + $done = $completed ? $total : $current; + + return [ + 'subject' => $this->subjectLabel($run), + 'pipeline' => $run->pipeline, + 'attempt' => $run->attempt, + 'status' => $this->runState($run), // running|done|failed + 'failed' => $run->status === ProvisioningRun::STATUS_FAILED, + 'current' => $completed ? null : (isset($pipeline[$current]) ? __(app($pipeline[$current])->label()) : null), + 'next' => isset($pipeline[$current + 1]) && ! $completed ? __(app($pipeline[$current + 1])->label()) : null, + 'error' => $run->error, + 'done' => $done, + 'total' => $total, + 'percent' => (int) round($done / $total * 100), + ]; + } } diff --git a/lang/de/admin.php b/lang/de/admin.php index 63f26e4..c6fadff 100644 --- a/lang/de/admin.php +++ b/lang/de/admin.php @@ -37,6 +37,10 @@ return [ 'view_all' => 'Alle ansehen', 'alerts' => 'Hinweise', 'run_detail' => 'Aktueller Lauf', + 'run_attempt' => 'Versuch :n', + 'run_done' => ':done von :total abgeschlossen', + 'run_current' => 'Aktueller Schritt', + 'run_next' => 'Als Nächstes', 'run' => [ 'deploy' => 'DeployApplicationStack', diff --git a/lang/en/admin.php b/lang/en/admin.php index 1e4fab9..5cc4bff 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -37,6 +37,10 @@ return [ 'view_all' => 'View all', 'alerts' => 'Alerts', 'run_detail' => 'Current run', + 'run_attempt' => 'Attempt :n', + 'run_done' => ':done of :total complete', + 'run_current' => 'Current step', + 'run_next' => 'Up next', 'run' => [ 'deploy' => 'DeployApplicationStack', diff --git a/resources/views/livewire/admin/provisioning.blade.php b/resources/views/livewire/admin/provisioning.blade.php index 6dbe1e5..2ca94ec 100644 --- a/resources/views/livewire/admin/provisioning.blade.php +++ b/resources/views/livewire/admin/provisioning.blade.php @@ -38,12 +38,50 @@
-

{{ __('admin.run_detail') }}

-

{{ $activeLabel }}

- @if (count($steps) > 0) - +
+

{{ __('admin.run_detail') }}

+ @if ($panel) + {{ $panel['percent'] }}% + @endif +
+ + @if (! $panel) +

{{ __('admin.no_runs') }}

@else -

{{ __('admin.no_runs') }}

+

{{ $panel['subject'] }}

+

{{ $panel['pipeline'] }} · {{ __('admin.run_attempt', ['n' => $panel['attempt']]) }}

+ + {{-- Progress bar (width is the one allowed inline style, R4) --}} +
+
+
+

{{ __('admin.run_done', ['done' => $panel['done'], 'total' => $panel['total']]) }}

+ + @if ($panel['failed']) +
+

{{ __('admin.state_failed') }}

+ @if ($panel['error'])

{{ $panel['error'] }}

@endif +
+ @elseif ($panel['current']) +
+

{{ __('admin.run_current') }}

+
+ + {{ $panel['current'] }} +
+
+ @endif + + @if ($panel['next'] && ! $panel['failed']) +
+

{{ __('admin.run_next') }}

+
+ + {{ $panel['next'] }} +
+
+ @endif @endif