admin widget zu dokploy geswitched

This commit is contained in:
Codex Agent
2025-11-18 16:45:56 +01:00
parent 6720ad84cf
commit 125c624588
22 changed files with 693 additions and 512 deletions

View File

@@ -1,29 +1,29 @@
<x-filament-panels::page>
<div class="space-y-6">
<x-filament::section heading="Service Controls">
<x-filament::section heading="Application Controls">
<div class="grid gap-4 md:grid-cols-2">
@foreach($services as $service)
@foreach($applications as $application)
<div class="rounded-2xl border border-slate-200/70 bg-white/80 p-4 shadow-sm dark:border-white/10 dark:bg-slate-900/60">
<div class="flex items-center justify-between">
<div>
<p class="text-sm font-semibold text-slate-700 dark:text-slate-200">{{ $service['label'] }}</p>
<p class="text-xs text-slate-500 dark:text-slate-400">{{ $service['service_id'] }}</p>
<p class="text-sm font-semibold text-slate-700 dark:text-slate-200">{{ $application['label'] }}</p>
<p class="text-xs text-slate-500 dark:text-slate-400">{{ $application['application_id'] }}</p>
</div>
<span class="rounded-full bg-slate-100 px-3 py-1 text-xs font-semibold text-slate-700 dark:bg-slate-800 dark:text-slate-100">
{{ ucfirst($service['status'] ?? 'unknown') }}
{{ ucfirst($application['status'] ?? 'unknown') }}
</span>
</div>
<div class="mt-4 flex flex-wrap gap-2">
<x-filament::button size="sm" color="warning" wire:click="restart('{{ $service['service_id'] }}')">
Restart
<x-filament::button size="sm" color="warning" wire:click="reload('{{ $application['application_id'] }}')">
Reload
</x-filament::button>
<x-filament::button size="sm" color="gray" wire:click="redeploy('{{ $service['service_id'] }}')">
<x-filament::button size="sm" color="gray" wire:click="redeploy('{{ $application['application_id'] }}')">
Redeploy
</x-filament::button>
@if($coolifyWebUrl)
<x-filament::button tag="a" size="sm" color="gray" href="{{ $coolifyWebUrl }}/services/{{ $service['service_id'] }}" target="_blank">
Open in Coolify
@if($dokployWebUrl)
<x-filament::button tag="a" size="sm" color="gray" href="{{ rtrim($dokployWebUrl, '/') }}/applications/{{ $application['application_id'] }}" target="_blank">
Open in Dokploy
</x-filament::button>
@endif
</div>
@@ -39,7 +39,7 @@
<tr class="text-left text-xs uppercase tracking-wide text-slate-500">
<th class="px-3 py-2">When</th>
<th class="px-3 py-2">User</th>
<th class="px-3 py-2">Service</th>
<th class="px-3 py-2">Application</th>
<th class="px-3 py-2">Action</th>
<th class="px-3 py-2">Status</th>
</tr>
@@ -61,7 +61,7 @@
</tbody>
</table>
</div>
<x-filament::link href="{{ route('filament.superadmin.resources.coolify-action-logs.index') }}" class="mt-3 inline-flex text-sm text-primary-600">
<x-filament::link href="{{ route('filament.superadmin.resources.infrastructure-action-logs.index') }}" class="mt-3 inline-flex text-sm text-primary-600">
View full log
</x-filament::link>
</x-filament::section>

View File

@@ -1,47 +1,52 @@
<x-filament-widgets::widget>
<x-filament::section heading="Infra Status (Coolify)">
<x-filament::section heading="Infra Status (Dokploy)">
<div class="grid gap-4 md:grid-cols-2">
@forelse($services as $service)
@forelse($applications as $application)
<div class="rounded-2xl border border-slate-200/70 bg-white/80 p-4 shadow-sm dark:border-white/10 dark:bg-slate-900/60">
<div class="flex items-center justify-between">
<div>
<p class="text-sm font-semibold text-slate-600 dark:text-slate-200">{{ $service['label'] }}</p>
<p class="text-xs text-slate-500 dark:text-slate-400">{{ $service['service_id'] }}</p>
<p class="text-sm font-semibold text-slate-600 dark:text-slate-200">{{ $application['label'] }}</p>
<p class="text-xs text-slate-500 dark:text-slate-400">{{ $application['app_name'] ?? $application['application_id'] }}</p>
<p class="text-[11px] text-slate-400 dark:text-slate-500">{{ $application['application_id'] }}</p>
</div>
<span @class([
'rounded-full px-3 py-1 text-xs font-semibold',
'bg-emerald-100 text-emerald-800' => $service['status'] === 'running',
'bg-amber-100 text-amber-800' => $service['status'] === 'deploying',
'bg-rose-100 text-rose-800' => $service['status'] === 'unreachable' || $service['status'] === 'error',
'bg-slate-100 text-slate-600' => ! in_array($service['status'], ['running', 'deploying', 'unreachable', 'error']),
'bg-emerald-100 text-emerald-800' => $application['status'] === 'running',
'bg-amber-100 text-amber-800' => in_array($application['status'], ['deploying', 'idle']),
'bg-rose-100 text-rose-800' => in_array($application['status'], ['unreachable', 'error']),
'bg-slate-100 text-slate-600' => ! in_array($application['status'], ['running', 'deploying', 'idle', 'unreachable', 'error']),
])>
{{ ucfirst($service['status']) }}
{{ ucfirst($application['status']) }}
</span>
</div>
@if(isset($service['error']))
<p class="mt-3 text-xs text-rose-600 dark:text-rose-400">{{ $service['error'] }}</p>
@if(isset($application['error']))
<p class="mt-3 text-xs text-rose-600 dark:text-rose-400">{{ $application['error'] }}</p>
@else
<dl class="mt-3 grid grid-cols-3 gap-2 text-xs">
<div>
<dt class="text-slate-500 dark:text-slate-400">CPU</dt>
<dd class="font-semibold text-slate-900 dark:text-white">{{ $service['cpu'] ?? '—' }}%</dd>
<dd class="font-semibold text-slate-900 dark:text-white">
{{ isset($application['cpu']) ? $application['cpu'].'%' : '—' }}
</dd>
</div>
<div>
<dt class="text-slate-500 dark:text-slate-400">Memory</dt>
<dd class="font-semibold text-slate-900 dark:text-white">{{ $service['memory'] ?? '—' }}%</dd>
<dd class="font-semibold text-slate-900 dark:text-white">
{{ isset($application['memory']) ? $application['memory'].'%' : '—' }}
</dd>
</div>
<div>
<dt class="text-slate-500 dark:text-slate-400">Last Deploy</dt>
<dd class="font-semibold text-slate-900 dark:text-white">
{{ $service['last_deploy'] ? \Illuminate\Support\Carbon::parse($service['last_deploy'])->diffForHumans() : '—' }}
{{ $application['last_deploy'] ? \Illuminate\Support\Carbon::parse($application['last_deploy'])->diffForHumans() : '—' }}
</dd>
</div>
</dl>
@endif
</div>
@empty
<p class="text-sm text-slate-500 dark:text-slate-300">No Coolify services configured.</p>
<p class="text-sm text-slate-500 dark:text-slate-300">No Dokploy applications configured.</p>
@endforelse
</div>
</x-filament::section>