@extends('layouts.admin') @section('content')
{{-- Header Section: Minimalist & Professional --}}

Analisis Downtime Alat

Pemantauan durasi ketidaksiapan alat praktikum untuk mendukung keputusan akademik.

Update: {{ now()->format('H:i') }} WIB
{{-- Stats Cards: Premium Definition --}}
@php $criticalCount = $downtime->filter(fn($row) => now()->diffInDays($row->created_at) > 14)->count(); $warningCount = $downtime->filter(fn($row) => now()->diffInDays($row->created_at) >= 7 && now()->diffInDays($row->created_at) <= 14)->count(); $summaryCards = [ ['label' => 'Kritis (>14 Hari)', 'val' => $criticalCount, 'color' => '#ef4444', 'icon' => 'bi-exclamation-octagon'], ['label' => 'Peringatan (7-14 Hari)', 'val' => $warningCount, 'color' => '#f59e0b', 'icon' => 'bi-hourglass-split'], ['label' => 'Total Downtime Aktif', 'val' => $downtime->total(), 'color' => '#6366f1', 'icon' => 'bi-activity'], ]; @endphp @foreach($summaryCards as $card)

{{ $card['val'] }} Alat

{{ $card['label'] }}

@endforeach
{{-- Main Table Area --}}
Daftar Alat Non-Aktif
Filter: Status Repairing
@forelse($downtime as $row) @php $days = now()->diffInDays($row->created_at); $color = $days > 14 ? '#ef4444' : ($days >= 7 ? '#f59e0b' : '#3b82f6'); $impact = $days > 14 ? 'KRITIS' : ($days >= 7 ? 'TERHAMBAT' : 'NORMAL'); @endphp @empty @endforelse
Informasi Alat & Unit Tgl Lapor Durasi Downtime Analisis Dampak KBM Aksi
{{ $row->barang?->nama_barang ?? 'N/A' }}
{{ $row->lab?->nama_lab ?? 'Unit N/A' }}
{{ $row->created_at->format('d/m/Y') }}
{{ $row->created_at->diffForHumans() }}
{{ $days }} Hari
{{ $impact }} {{ min(round(($days/30)*100), 100) }}% Risk
Zero Downtime

Seluruh alat saat ini berfungsi normal atau dalam respon cepat.

@endsection