@extends('layouts.app') @php $pageTitle = 'Users'; $pageHeading = 'Manage Users'; $pageDescription = 'Kelola user login ADMS (admin only).'; @endphp @section('content') @php($blacklistedIps = $blacklists->pluck('ip_address')->all()) @php($activeBlacklistCount = $blacklists->where('is_active', true)->count()) @php($activeLockoutCount = $lockouts->filter(fn ($row) => filled($row->blocked_until) && \Illuminate\Support\Carbon::parse($row->blocked_until)->isFuture())->count()) @php($failedAttemptCount = $recentAttempts->where('is_success', false)->count()) @php($successfulAttemptCount = $recentAttempts->where('is_success', true)->count())
Total User {{ method_exists($rows, 'total') ? $rows->total() : $rows->count() }}
IP Blacklist {{ $activeBlacklistCount }}
User Lockout {{ $activeLockoutCount }}
Login Sukses / Gagal {{ $successfulAttemptCount }} / {{ $failedAttemptCount }}
@if (session('status'))
Info
{{ session('status') }}
@endif @if ($errors->any())
Ada error
@endif
Reset
Tambah User
@forelse ($rows as $row) @empty @endforelse
Username Name Email Role Status Last Login Action
{{ $row->username }} {{ trim(($row->first_name ?? '').' '.($row->last_name ?? '')) ?: '-' }} {{ $row->email ?: '-' }} @php($resolvedRole = strtolower((string) ($row->role ?? ((int) ($row->is_superuser ?? 0) === 1 ? 'admin' : 'viewer')))) @if ($resolvedRole === 'admin') ADMIN @elseif ($resolvedRole === 'operator') OPERATOR @else DEMO / VIEWER @endif @if ((int) ($row->is_active ?? 0) === 1) ACTIVE @else INACTIVE @endif {{ $row->last_login ?: '-' }} Edit
Belum ada user.
@if (method_exists($rows, 'links'))
Menampilkan {{ $rows->firstItem() ?? 0 }}-{{ $rows->lastItem() ?? 0 }} dari {{ $rows->total() }} user
{{ $rows->onEachSide(1)->links() }}
@endif

Blacklist IP Login

IP di bawah ini diblokir hanya untuk login user aplikasi. Traffic mesin tidak ikut terdampak.
{{ $activeBlacklistCount }} aktif
@csrf
@forelse ($blacklists as $blacklist) @empty @endforelse
IP Status Reason Last Hit Action
{{ $blacklist->ip_address }} @if ($blacklist->is_active) BLOCKED @else INACTIVE @endif {{ $blacklist->reason ?: '-' }} {{ $blacklist->last_hit_at ?: '-' }}
@csrf @method('DELETE')
Belum ada IP yang diblacklist.

User Lockout Aktif

3 kali gagal login akan mengunci user selama 15 menit. Di sini admin bisa membuka lockout lebih cepat jika diperlukan.
{{ $activeLockoutCount }} aktif
@forelse ($lockouts as $lockout) @empty @endforelse
Login Attempts Blocked Until Last IP Action
{{ $lockout->login_identifier }} {{ (int) $lockout->failed_attempts }}x {{ $lockout->blocked_until ?: '-' }} {{ $lockout->last_ip_address ?: '-' }}
@csrf
Belum ada lockout tercatat.

Recent Login Attempts

Semua percobaan login user web direkam dengan login input, IP, dan hasil akhirnya.
{{ $recentAttempts->count() }} log terbaru
@forelse ($recentAttempts as $attempt) @empty @endforelse
Attempted At Login IP Status Reason User Agent Action
{{ $attempt->attempted_at }} {{ $attempt->login_identifier }} {{ $attempt->ip_address }} @if ($attempt->is_success) SUCCESS @else FAILED @endif {{ $attempt->failure_reason ?: '-' }} {{ $attempt->user_agent ?: '-' }} @if (! $attempt->is_success && ! in_array($attempt->ip_address, $blacklistedIps, true))
@csrf
@else - @endif
Belum ada login attempt tercatat.
@endsection