@extends('layouts.app') @section('title', 'Dashboard') @section('subtitle', 'Overview sistem dan monitoring akses') @section('content')
12%

{{ $stats['total_employees'] }}

Total Pegawai

{{ $stats['active_employees'] }} aktif
Butuh Perhatian

{{ $stats['retiring_soon'] }}

Akan Pensiun (30 hari)

Segera

{{ $expiringAccess->count() }}

Akses Expiring (7 hari)

Proses sekarang
@if($pendingExtensions->count() > 0) {{ $pendingExtensions->count() }} pending @endif

{{ $pendingExtensions->count() }}

Perpanjangan Pending

Lihat request

Trend Pensiun Tahun {{ date('Y') }}

Grafik pegawai pensiun per bulan

Aktivitas Terbaru

Lihat Semua
@forelse($recentReminders as $reminder) @php // Format waktu aktivitas $diffInHours = now()->diffInHours($reminder->created_at); $diffInDays = now()->diffInDays($reminder->created_at); if ($diffInHours < 1) { $timeAgo = 'Baru saja'; } elseif ($diffInHours < 24) { $timeAgo = round($diffInHours) . ' jam yang lalu'; } elseif ($diffInDays < 30) { $timeAgo = round($diffInDays) . ' hari yang lalu'; } else { $timeAgo = $reminder->created_at->format('d M Y'); } @endphp

{{ $reminder->getTypeLabelAttribute() }}

{{ $reminder->employee->name ?? 'Unknown' }}

{{ $timeAgo }}

@empty

Belum ada aktivitas

@endforelse

Akses Segera Expire

{{ $expiringAccess->count() }} akses perlu ditinjau

Kelola Semua
@forelse($expiringAccess->take(5) as $access) @php // Calculate time until expiry $timeUntilExpiry = null; $timeLabel = ''; $timeColor = ''; if ($access->current_expiry_date) { $now = now(); $expiryDate = $access->current_expiry_date; if ($expiryDate->isFuture()) { $diffInHours = $now->diffInHours($expiryDate, false); $diffInDays = $now->diffInDays($expiryDate, false); if ($diffInHours < 1) { // Less than 1 hour $diffInMinutes = $now->diffInMinutes($expiryDate, false); $timeUntilExpiry = ceil($diffInMinutes); $timeLabel = $timeUntilExpiry . ' menit lagi'; $timeColor = 'text-rose-600'; } elseif ($diffInHours < 24) { // Less than 24 hours - show in hours $timeUntilExpiry = ceil($diffInHours); $timeLabel = $timeUntilExpiry . ' jam lagi'; $timeColor = 'text-rose-600'; } elseif ($diffInDays > 0) { // More than 24 hours - show in days $timeUntilExpiry = ceil($diffInDays); $timeLabel = $timeUntilExpiry . ' hari lagi'; $timeColor = $diffInDays <= 3 ? 'text-rose-500' : 'text-amber-600'; } } elseif ($expiryDate->isPast()) { $timeLabel = 'Sudah expired'; $timeColor = 'text-gray-500'; } else { $timeLabel = 'Expired hari ini'; $timeColor = 'text-rose-600'; } } $categoryColors = [ 'physical' => 'bg-blue-100 text-blue-800', 'digital' => 'bg-purple-100 text-purple-800', 'network' => 'bg-cyan-100 text-cyan-800', 'application' => 'bg-amber-100 text-amber-800', 'cloud' => 'bg-sky-100 text-sky-800', 'file' => 'bg-emerald-100 text-emerald-800', 'other' => 'bg-gray-100 text-gray-800', ]; $categoryClass = $categoryColors[$access->accessCatalog->category] ?? $categoryColors['other']; $statusColors = [ 'active' => ['bg' => 'bg-emerald-100', 'text' => 'text-emerald-800', 'dot' => 'bg-emerald-500'], 'extended' => ['bg' => 'bg-amber-100', 'text' => 'text-amber-800', 'dot' => 'bg-amber-500'], 'revoked' => ['bg' => 'bg-gray-100', 'text' => 'text-gray-800', 'dot' => 'bg-gray-500'], ]; $statusStyle = $statusColors[$access->status] ?? $statusColors['active']; @endphp @empty @endforelse
Pegawai Akses Kategori Tanggal Expire Status Aksi
{{ substr($access->employee->name, 0, 2) }}

{{ $access->employee->name }}

{{ $access->employee->nip }}

{{ $access->accessCatalog->name }}

{{ $access->accessCatalog->code }}

{{ $access->accessCatalog->getCategoryLabelAttribute() }}
{{ $access->current_expiry_date->format('d M Y') }}
@if($timeLabel)

{{ $timeLabel }}

@endif
{{ ucfirst($access->status) }}

Tidak ada akses yang akan expire dalam 7 hari

Semua akses aman

@push('scripts') @endpush @endsection