Files
fotospiel-app/resources/views/filament/widgets/dokploy-platform-health.blade.php
Codex Agent 15e19d4e8b
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled
Add join token analytics dashboard and align Filament views
2026-01-04 18:21:59 +01:00

92 lines
3.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@php
use Filament\Support\Enums\GridDirection;
use Filament\Support\Icons\Heroicon;
use Illuminate\View\ComponentAttributeBag;
$statusColors = [
'done' => 'success',
'deploying' => 'warning',
'pending' => 'warning',
'unreachable' => 'danger',
'error' => 'danger',
'failed' => 'danger',
];
$statusIcons = [
'done' => Heroicon::CheckCircle,
'deploying' => Heroicon::ArrowPath,
'pending' => Heroicon::Clock,
'unreachable' => Heroicon::ExclamationTriangle,
'error' => Heroicon::XCircle,
'failed' => Heroicon::XCircle,
];
$serviceColors = [
'running' => 'success',
'done' => 'success',
'starting' => 'warning',
'deploying' => 'warning',
'unhealthy' => 'danger',
'error' => 'danger',
'failed' => 'danger',
];
$cardsGrid = (new ComponentAttributeBag())->grid(['default' => 1, 'lg' => 2]);
$serviceGrid = (new ComponentAttributeBag())->grid(['default' => 1], GridDirection::Column);
@endphp
<x-filament-widgets::widget>
<x-filament::section heading="Infra Status (Dokploy)">
<div {{ $cardsGrid }}>
@forelse($composes as $compose)
<x-filament::card
:heading="$compose['label']"
:description="$compose['name'] ?? ''"
>
<x-slot name="afterHeader">
<x-filament::badge
:color="$statusColors[$compose['status']] ?? 'gray'"
:icon="$statusIcons[$compose['status']] ?? Heroicon::QuestionMarkCircle"
>
{{ ucfirst($compose['status']) }}
</x-filament::badge>
<x-filament::badge color="gray" :icon="Heroicon::Identification">
{{ $compose['compose_id'] }}
</x-filament::badge>
</x-slot>
@if(isset($compose['error']))
<x-filament::badge color="danger" :icon="Heroicon::ExclamationTriangle">
{{ $compose['error'] }}
</x-filament::badge>
@else
<div {{ $serviceGrid }}>
@forelse($compose['services'] as $service)
<x-filament::badge
:color="$serviceColors[$service['status']] ?? 'gray'"
:icon="array_key_exists($service['status'] ?? '', $serviceColors) ? Heroicon::Server : Heroicon::QuestionMarkCircle"
>
{{ $service['name'] }}: {{ strtoupper($service['status'] ?? 'N/A') }}
</x-filament::badge>
@empty
<x-filament::badge color="gray" :icon="Heroicon::QuestionMarkCircle">
No services reported.
</x-filament::badge>
@endforelse
<x-filament::badge color="gray" :icon="Heroicon::Clock">
Last deploy:
{{ $compose['last_deploy'] ? \Illuminate\Support\Carbon::parse($compose['last_deploy'])->diffForHumans() : '—' }}
</x-filament::badge>
</div>
@endif
</x-filament::card>
@empty
<x-filament::empty-state
heading="No Dokploy compose stacks configured."
:icon="Heroicon::QuestionMarkCircle"
/>
@endforelse
</div>
</x-filament::section>
</x-filament-widgets::widget>