@extends('admin.layout')
@section('title', 'Scan Storage')
@section('content')
đ Scan Storage Bucket
Scan & Import. Scan file video (.mp4, .m3u8) dari bucket storage, auto-detect thumbnail, lalu import ke database.
Laravel TIDAK download, TIDAK copy, TIDAK reupload â hanya mendaftarkan pointer.
âąī¸ Auto Scan Storage (Job)
@php $autoEnabled = (bool) data_get($autoScanSettings ?? [], 'enabled', false); @endphp
{{ $autoEnabled ? 'AKTIF' : 'NONAKTIF' }}
@if(session('auto_scan_output'))
Output Run Auto Scan Now:
{{ session('auto_scan_output') }}
@endif
@if(!empty($autoScanLastStatus))
Last Auto Scan:
{{ data_get($autoScanLastStatus, 'ran_at', '-') }} |
New: {{ data_get($autoScanLastStatus, 'new_found', 0) }} |
Imported: {{ data_get($autoScanLastStatus, 'imported', 0) }} |
Skipped: {{ data_get($autoScanLastStatus, 'skipped', 0) }}
@endif
@if(!empty($autoScanHeartbeat))
@php
$heartbeatAt = data_get($autoScanHeartbeat, 'at');
$hbFresh = false;
if ($heartbeatAt) {
try {
$hbFresh = \Illuminate\Support\Carbon::parse($heartbeatAt)->gt(now()->subMinutes(2));
} catch (\Throwable $e) {
$hbFresh = false;
}
}
@endphp
Scheduler Heartbeat:
{{ $hbFresh ? 'AKTIF' : 'LAMBAT/TIDAK TERBARU' }}
| Last ping: {{ $heartbeatAt ?: '-' }}
@if(data_get($autoScanHeartbeat, 'host')) | Host: {{ data_get($autoScanHeartbeat, 'host') }} @endif
@if(data_get($autoScanHeartbeat, 'pid')) | PID: {{ data_get($autoScanHeartbeat, 'pid') }} @endif
@endif
@if($errors->any())
@foreach($errors->all() as $err)
{{ $err }}
@endforeach
@endif
{{-- âââââââââââââââââââââââââââââââââââââââââââ --}}
{{-- SCAN FORM --}}
{{-- âââââââââââââââââââââââââââââââââââââââââââ --}}
@csrf
{{-- Storage Driver --}}
Storage Driver
@foreach($drivers as $driver => $label)
{{ $label }}
@endforeach
{{-- Video Prefix --}}
{{-- Thumbnail Prefix --}}
{{-- Scan Button --}}
đ Scan
đ Scan & Import New
Kembali
{{-- âââââââââââââââââââââââââââââââââââââââââââ --}}
{{-- SCAN NEW PROGRESS PANEL --}}
{{-- âââââââââââââââââââââââââââââââââââââââââââ --}}
đ Scan & Import New â Progress
â Cancel
{{-- Progress Bar --}}
{{-- Status --}}
Memulai...
{{-- Stats --}}
â
Imported: 0
âī¸ Skipped: 0
đĻ Batch: â
{{-- Log --}}
{{-- Result --}}
{{-- âââââââââââââââââââââââââââââââââââââââââââ --}}
{{-- SCAN RESULTS --}}
{{-- âââââââââââââââââââââââââââââââââââââââââââ --}}
@if($scanResults !== null)
Ditemukan {{ $scanResults['total'] }} file
@if($scanResults['truncated'])
(menampilkan max {{ count($scanResults['files']) }})
@endif
{{-- Filter Buttons --}}
{{-- Prefix Search --}}
Filter:
Semua ({{ count($scanResults['files']) }} )
đ Belum Import ({{ collect($scanResults['files'])->where('already_imported', false)->count() }} )
đĩ Sudah Import ({{ collect($scanResults['files'])->where('already_imported', true)->count() }} )
@if(count($scanResults['files']) > 0)
@csrf
{{-- Toolbar --}}
đĻ Import Selected (0 )
{{-- Import All New button --}}
@php $newCount = collect($scanResults['files'])->where('already_imported', false)->count(); @endphp
@if($newCount > 0)
đ Import All New ({{ $newCount }})
@endif
â Select All New
â Deselect All
â
= thumbnail detected âŦ = no thumbnail đĩ = already imported
{{-- Pagination Top --}}
{{-- Results Table --}}
{{-- Pagination Bottom --}}
@else
Tidak ditemukan file video di prefix "{{ $videoPrefix }}".
Pastikan video prefix dan storage driver sudah benar.
@endif
@endif
@endsection