Feature branch PR for Spec 114. This branch contains the merged agent session work (see merge commit on branch). Tests - `vendor/bin/sail artisan test --compact tests/Feature/System/Spec114/` Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #139
134 lines
5.5 KiB
PHP
134 lines
5.5 KiB
PHP
@php
|
|
/** @var \App\Models\OperationRun $run */
|
|
$run = $this->run;
|
|
|
|
$statusSpec = \App\Support\Badges\BadgeRenderer::spec(
|
|
\App\Support\Badges\BadgeDomain::OperationRunStatus,
|
|
(string) $run->status,
|
|
);
|
|
|
|
$outcomeSpec = (string) $run->status === 'completed'
|
|
? \App\Support\Badges\BadgeRenderer::spec(
|
|
\App\Support\Badges\BadgeDomain::OperationRunOutcome,
|
|
(string) $run->outcome,
|
|
)
|
|
: null;
|
|
|
|
$summaryCounts = is_array($run->summary_counts) ? $run->summary_counts : [];
|
|
$hasSummary = count($summaryCounts) > 0;
|
|
@endphp
|
|
|
|
<x-filament-panels::page>
|
|
<div class="space-y-6">
|
|
<x-filament::section>
|
|
<x-slot name="heading">
|
|
Run #{{ (int) $run->getKey() }}
|
|
</x-slot>
|
|
|
|
<x-slot name="description">
|
|
{{ \App\Support\OperationCatalog::label((string) $run->type) }}
|
|
</x-slot>
|
|
|
|
<x-slot name="afterHeader">
|
|
<div class="flex items-center gap-2">
|
|
<x-filament::badge
|
|
:color="$statusSpec->color"
|
|
:icon="$statusSpec->icon"
|
|
>
|
|
{{ $statusSpec->label }}
|
|
</x-filament::badge>
|
|
|
|
@if ($outcomeSpec)
|
|
<x-filament::badge
|
|
:color="$outcomeSpec->color"
|
|
:icon="$outcomeSpec->icon"
|
|
>
|
|
{{ $outcomeSpec->label }}
|
|
</x-filament::badge>
|
|
@endif
|
|
</div>
|
|
</x-slot>
|
|
|
|
<dl class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
|
<div>
|
|
<dt class="text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">Workspace</dt>
|
|
<dd class="mt-1 text-sm font-medium text-gray-950 dark:text-white">
|
|
{{ $run->workspace?->name ?? 'Unknown workspace' }}
|
|
</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">Tenant</dt>
|
|
<dd class="mt-1 text-sm font-medium text-gray-950 dark:text-white">
|
|
{{ $run->tenant?->name ?? 'Tenantless' }}
|
|
</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">Started</dt>
|
|
<dd class="mt-1 text-sm font-medium text-gray-950 dark:text-white">
|
|
{{ $run->started_at?->toDayDateTimeString() ?? '—' }}
|
|
</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">Completed</dt>
|
|
<dd class="mt-1 text-sm font-medium text-gray-950 dark:text-white">
|
|
{{ $run->completed_at?->toDayDateTimeString() ?? '—' }}
|
|
</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">Initiator</dt>
|
|
<dd class="mt-1 text-sm font-medium text-gray-950 dark:text-white">
|
|
{{ (string) ($run->initiator_name ?? '—') }}
|
|
</dd>
|
|
</div>
|
|
|
|
<div>
|
|
<dt class="text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">Runbooks</dt>
|
|
<dd class="mt-1 text-sm">
|
|
<x-filament::link href="{{ \App\Filament\System\Pages\Ops\Runbooks::getUrl(panel: 'system') }}">
|
|
Go to runbooks
|
|
</x-filament::link>
|
|
</dd>
|
|
</div>
|
|
</dl>
|
|
</x-filament::section>
|
|
|
|
@if ($hasSummary)
|
|
<x-filament::section>
|
|
<x-slot name="heading">
|
|
Summary counts
|
|
</x-slot>
|
|
|
|
<div class="grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4">
|
|
@foreach ($summaryCounts as $key => $value)
|
|
<div class="rounded-lg bg-gray-50 px-4 py-3 dark:bg-white/5">
|
|
<p class="text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400">
|
|
{{ \Illuminate\Support\Str::headline((string) $key) }}
|
|
</p>
|
|
<p class="mt-1 text-xl font-bold text-gray-950 dark:text-white">
|
|
{{ is_numeric($value) ? number_format((int) $value) : $value }}
|
|
</p>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
</x-filament::section>
|
|
@endif
|
|
|
|
@if (! empty($run->failure_summary))
|
|
<x-filament::section>
|
|
<x-slot name="heading">
|
|
<div class="flex items-center gap-2 text-danger-600 dark:text-danger-400">
|
|
<x-heroicon-m-exclamation-circle class="h-5 w-5" />
|
|
Failures
|
|
</div>
|
|
</x-slot>
|
|
|
|
@include('filament.partials.json-viewer', ['value' => $run->failure_summary])
|
|
</x-filament::section>
|
|
@endif
|
|
</div>
|
|
</x-filament-panels::page>
|