admin widget zu dokploy geswitched
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<x-filament-widgets::widget>
|
||||
<x-filament::section heading="Infra Status (Dokploy)">
|
||||
<div class="grid gap-4 md:grid-cols-2">
|
||||
@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">{{ $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' => $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($application['status']) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@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">
|
||||
{{ 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">
|
||||
{{ 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">
|
||||
{{ $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 Dokploy applications configured.</p>
|
||||
@endforelse
|
||||
</div>
|
||||
</x-filament::section>
|
||||
</x-filament-widgets::widget>
|
||||
Reference in New Issue
Block a user