@php use Filament\Support\Enums\GridDirection; use Filament\Support\Icons\Heroicon; use Illuminate\View\ComponentAttributeBag; $statusColors = [ 'done' => 'success', 'healthy' => 'success', 'running' => 'success', 'deploying' => 'warning', 'pending' => 'warning', 'starting' => 'warning', 'warning' => 'warning', 'unreachable' => 'danger', 'error' => 'danger', 'failed' => 'danger', 'unhealthy' => 'danger', ]; $statusIcons = [ 'done' => Heroicon::CheckCircle, 'healthy' => Heroicon::CheckCircle, 'running' => Heroicon::CheckCircle, 'deploying' => Heroicon::ArrowPath, 'pending' => Heroicon::Clock, 'starting' => Heroicon::Clock, 'warning' => Heroicon::ExclamationTriangle, 'unreachable' => Heroicon::ExclamationTriangle, 'error' => Heroicon::XCircle, 'failed' => Heroicon::XCircle, 'unhealthy' => Heroicon::XCircle, ]; $serviceColors = [ 'running' => 'success', 'done' => 'success', 'healthy' => 'success', 'starting' => 'warning', 'deploying' => 'warning', 'pending' => 'warning', 'unhealthy' => 'danger', 'error' => 'danger', 'failed' => 'danger', ]; $cardsGrid = (new ComponentAttributeBag())->grid(['default' => 1, 'lg' => 2]); $stacked = (new ComponentAttributeBag())->grid(['default' => 1], GridDirection::Column); $detailsGrid = (new ComponentAttributeBag())->grid(['default' => 1, 'md' => 2], GridDirection::Column); $serviceGrid = (new ComponentAttributeBag())->grid(['default' => 1], GridDirection::Column); @endphp @if(!empty($projects))
@forelse($projects as $project) {{ ucfirst($project['status']) }} {{ $project['project_id'] }}
@if(isset($project['error'])) {{ $project['error'] }} @else @if(!empty($project['description'])) {{ $project['description'] }} @endif
Apps: {{ $project['applications_count'] ?? 0 }} Composes: {{ $project['composes_count'] ?? 0 }} Services: {{ $project['services_count'] ?? 0 }} Last update: {{ $project['updated_at'] ? \Illuminate\Support\Carbon::parse($project['updated_at'])->diffForHumans() : '—' }}
Applications @forelse($project['applications'] as $application)
{{ $application['name'] ?? 'App' }} @if(!empty($application['status'])) ({{ strtoupper($application['status']) }}) @endif
@if(!empty($application['id'])) {{ $application['id'] }} @endif @if(!empty($application['environment'])) Env: {{ $application['environment'] }} @endif @if(!empty($application['repository'])) {{ $application['repository'] }} @endif @if(!empty($application['branch'])) {{ $application['branch'] }} @endif @if(!empty($application['server'])) {{ $application['server'] }} @endif @if(!empty($application['url'])) {{ $application['url'] }} @endif Last deploy: {{ $application['last_deploy'] ? \Illuminate\Support\Carbon::parse($application['last_deploy'])->diffForHumans() : '—' }}
@if(!empty($application['monitoring']))
@foreach($application['monitoring'] as $metric) {{ $metric['label'] }}: {{ $metric['value'] }} @endforeach
@endif
@empty No applications reported. @endforelse
Composes @forelse($project['composes'] as $compose)
{{ $compose['name'] ?? 'Compose' }} @if(!empty($compose['status'])) ({{ strtoupper($compose['status']) }}) @endif
@if(!empty($compose['id'])) {{ $compose['id'] }} @endif @if(!empty($compose['environment'])) Env: {{ $compose['environment'] }} @endif Last deploy: {{ $compose['last_deploy'] ? \Illuminate\Support\Carbon::parse($compose['last_deploy'])->diffForHumans() : '—' }}
@if(!empty($compose['services']))
@foreach($compose['services'] as $service) {{ $service['name'] }}: {{ strtoupper($service['status'] ?? 'N/A') }} @endforeach
@endif
@empty No composes reported. @endforelse
Services
@forelse($project['services'] as $service) {{ strtoupper($service['type'] ?? 'service') }} @if(!empty($service['name'])) - {{ $service['name'] }} @endif @if(!empty($service['status'])) ({{ strtoupper($service['status']) }}) @endif
@if(!empty($service['id'])) {{ $service['id'] }} @endif @if(!empty($service['environment'])) Env: {{ $service['environment'] }} @endif @if(!empty($service['version'])) {{ $service['version'] }} @endif @if(!empty($service['external_port'])) Port {{ $service['external_port'] }} @endif
@empty No services reported. @endforelse
@endif
@empty @endforelse
@else
@forelse($composes as $compose) {{ ucfirst($compose['status']) }} {{ $compose['compose_id'] }} @if(isset($compose['error'])) {{ $compose['error'] }} @else
@forelse($compose['services'] as $service) {{ $service['name'] }}: {{ strtoupper($service['status'] ?? 'N/A') }} @empty No services reported. @endforelse Last deploy: {{ $compose['last_deploy'] ? \Illuminate\Support\Carbon::parse($compose['last_deploy'])->diffForHumans() : '—' }}
@endif
@empty @endforelse
@endif