mailwolt/resources/views/livewire/ui/security/fail2-ban-card.blade.php

174 lines
9.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<div class="glass-card p-4 rounded-2xl border border-white/10 bg-white/5">
<div class="flex items-center justify-between mb-3">
<div class="inline-flex items-center gap-2 bg-white/5 border border-white/10 px-2.5 py-1 rounded-full">
<i class="ph ph-shield-checkered text-white/70 text-[13px]"></i>
<span class="text-[11px] uppercase text-white/70">Fail2Ban</span>
</div>
@if($available)
<span class="px-2 py-0.5 rounded-full border text-xs
{{ $activeBans>0 ? 'text-amber-200 border-amber-400/30 bg-amber-500/10' : 'text-emerald-300 border-emerald-400/30 bg-emerald-500/10' }}">
{{ $activeBans }} aktuell
</span>
@else
<span class="px-2 py-0.5 rounded-full border text-xs text-rose-300 border-rose-400/30 bg-rose-500/10">
nicht installiert
</span>
@endif
</div>
@if(!$available)
<div class="text-sm text-white/60">fail2ban-client wurde nicht gefunden.</div>
@else
{{-- Jails --}}
<div class="space-y-2">
@forelse($jails as $j)
<div class="rounded-xl border border-white/10 bg-white/5 px-3 py-2">
<div class="flex items-center justify-between">
<div class="text-white/85 font-medium">{{ $j['name'] }}</div>
<div class="flex items-center gap-2">
<span class="text-[11px] text-white/50">
Bannzeit:
@if($j['bantime'] === -1) permanent
@else {{ $j['bantime'] }}s
@endif
</span>
<span class="px-2 py-0.5 rounded-full border text-[11px]
{{ $j['banned']>0 ? 'text-amber-200 border-amber-400/30 bg-amber-500/10' : 'text-white/60 border-white/20 bg-white/5' }}">
{{ $j['banned'] }} gebannt
</span>
</div>
</div>
@if(!empty($j['ips']))
<div class="mt-2 grid gap-1">
@foreach($j['ips'] as $ip)
<div class="flex items-center gap-2 text-[12px] text-white/80 font-mono">
<span>{{ $ip['ip'] }}</span>
@if($ip['remaining'] === -1)
<span class="px-1.5 py-0.5 rounded border border-rose-400/30 bg-rose-500/10 text-rose-200">
permanent
</span>
@elseif(is_int($ip['remaining']) && $ip['remaining'] > 0)
<span class="px-1.5 py-0.5 rounded border border-amber-400/30 bg-amber-500/10 text-amber-100">
{{ gmdate('H\h i\m s\s', $ip['remaining']) }}
</span>
@endif
</div>
@endforeach
</div>
@endif
</div>
@empty
<div class="text-sm text-white/60">Keine Jails gefunden.</div>
@endforelse
</div>
{{-- Top IPs aus Ban-Events --}}
<div class="mt-4">
<div class="text-sm text-white/70">Top IPs (letzte Fail2Ban-Logs):</div>
<ul class="mt-2 space-y-1 text-sm">
@forelse($topIps as $i)
<li class="flex justify-between">
<span class="text-white/80 font-mono">{{ $i['ip'] }}</span>
<span class="text-white/60">{{ $i['count'] }}</span>
</li>
@empty
<li class="text-white/50"></li>
@endforelse
</ul>
</div>
<div class="mt-4 flex justify-end">
<button wire:click="refresh" wire:loading.attr="disabled"
class="px-3 py-1.5 text-[12px] rounded-lg bg-white/5 border border-white/10 hover:bg-white/10">
<i class="ph ph-arrows-clockwise text-[13px]"></i>
<span wire:loading.remove>Neu prüfen</span>
<span wire:loading>prüfe…</span>
</button>
</div>
@endif
</div>
{{--<div class="glass-card p-4 rounded-2xl border border-white/10 bg-white/5">--}}
{{-- <div class="flex items-center justify-between mb-3">--}}
{{-- <div class="inline-flex items-center gap-2 bg-white/5 border border-white/10 px-2.5 py-1 rounded-full">--}}
{{-- <i class="ph ph-shield-checkered text-white/70 text-[13px]"></i>--}}
{{-- <span class="text-[11px] uppercase text-white/70">Fail2Ban</span>--}}
{{-- </div>--}}
{{-- @if($available)--}}
{{-- <span class="px-2 py-0.5 rounded-full border text-xs--}}
{{-- {{ $activeBans>0 ? 'text-amber-200 border-amber-400/30 bg-amber-500/10' : 'text-emerald-300 border-emerald-400/30 bg-emerald-500/10' }}">--}}
{{-- {{ $activeBans }} aktuell--}}
{{-- </span>--}}
{{-- @else--}}
{{-- <span class="px-2 py-0.5 rounded-full border text-xs text-rose-300 border-rose-400/30 bg-rose-500/10">--}}
{{-- nicht installiert--}}
{{-- </span>--}}
{{-- @endif--}}
{{-- </div>--}}
{{-- @if(!$available)--}}
{{-- <div class="text-sm text-white/60">fail2ban-client wurde nicht gefunden.</div>--}}
{{-- @else--}}
{{-- --}}{{-- Jails --}}
{{-- <div class="space-y-2">--}}
{{-- @forelse($jails as $j)--}}
{{-- <div class="rounded-xl border border-white/10 bg-white/5 px-3 py-2">--}}
{{-- <div class="flex items-center justify-between">--}}
{{-- <div class="text-white/85 font-medium">{{ $j['name'] }}</div>--}}
{{-- <span class="px-2 py-0.5 rounded-full border text-[11px]--}}
{{-- {{ $j['banned']>0 ? 'text-amber-200 border-amber-400/30 bg-amber-500/10' : 'text-white/60 border-white/20 bg-white/5' }}">--}}
{{-- {{ $j['banned'] }} gebannt--}}
{{-- </span>--}}
{{-- </div>--}}
{{-- @if(!empty($j['ips']))--}}
{{-- <div class="mt-1 text-[12px] text-white/65 font-mono break-words">--}}
{{-- {{ implode(', ', $j['ips']) }}--}}
{{-- </div>--}}
{{-- @endif--}}
{{-- </div>--}}
{{-- @empty--}}
{{-- <div class="text-sm text-white/60">Keine Jails gefunden.</div>--}}
{{-- @endforelse--}}
{{-- </div>--}}
{{-- --}}{{-- Top IPs aus Ban-Events --}}
{{-- <div class="mt-3">--}}
{{-- <div class="text-sm text-white/70">Top IPs (letzte Fail2Ban-Logs):</div>--}}
{{-- <ul class="mt-2 space-y-1 text-sm">--}}
{{-- @foreach($j['ips'] as $ip)--}}
{{-- <div class="flex items-center gap-2 text-[12px] text-white/80 font-mono">--}}
{{-- <span>{{ $ip['ip'] }}</span>--}}
{{-- @if($ip['remaining'] === -1)--}}
{{-- <span class="px-1.5 py-0.5 rounded border border-rose-400/30 bg-rose-500/10 text-rose-200">permanent</span>--}}
{{-- @elseif(is_int($ip['remaining']) && $ip['remaining'] > 0)--}}
{{-- <span class="px-1.5 py-0.5 rounded border border-amber-400/30 bg-amber-500/10 text-amber-100">--}}
{{-- {{ gmdate('H\h i\m s\s', $ip['remaining']) }}--}}
{{-- </span>--}}
{{-- @endif--}}
{{-- </div>--}}
{{-- @endforeach--}}
{{-- @forelse($topIps as $i)--}}
{{-- <li class="flex justify-between">--}}
{{-- <span class="text-white/80 font-mono">{{ $i['ip'] }}</span>--}}
{{-- <span class="text-white/60">{{ $i['count'] }}</span>--}}
{{-- </li>--}}
{{-- @empty--}}
{{-- <li class="text-white/50"></li>--}}
{{-- @endforelse--}}
{{-- </ul>--}}
{{-- </div>--}}
{{-- <div class="mt-4 flex justify-end">--}}
{{-- <button wire:click="refresh" wire:loading.attr="disabled"--}}
{{-- class="px-3 py-1.5 text-[12px] rounded-lg bg-white/5 border border-white/10 hover:bg-white/10">--}}
{{-- <i class="ph ph-arrows-clockwise text-[13px]"></i>--}}
{{-- <span wire:loading.remove>Neu prüfen</span>--}}
{{-- <span wire:loading>prüfe…</span>--}}
{{-- </button>--}}
{{-- </div>--}}
{{-- @endif--}}
{{--</div>--}}