@extends('layouts.app') @section('content')
@include('partials.header') @include('partials.sidebar')

APK Management

@if (session('success')) @endif @if ($errors->any()) @endif
@forelse($apkVersions as $apk) @empty @endforelse
Version File Info Status Assignments Uploaded Actions
{{ $apk->version_name }}
@if ($apk->description) {{ Str::limit($apk->description, 50) }} @endif
{{ $apk->original_filename }}
Size: {{ $apk->formatted_file_size }}
Hash: {{ substr($apk->file_hash, 0, 8) }}...
@if ($apk->status === 'active') Active @elseif($apk->status === 'inactive') Inactive @else Deprecated @endif @if (!$apk->fileExists())
File Missing @endif
@php $assignments = $apk->roomAssignments; $totalAssignments = $assignments->count(); $installedCount = $assignments->where('status', 'installed')->count(); $pendingCount = $assignments->where('status', 'pending')->count(); $failedCount = $assignments->where('status', 'failed')->count(); @endphp @if ($totalAssignments > 0)
Total: {{ $totalAssignments }}
@if ($installedCount > 0)
Installed: {{ $installedCount }}
@endif @if ($pendingCount > 0)
Pending: {{ $pendingCount }}
@endif @if ($failedCount > 0)
Failed: {{ $failedCount }}
@endif
@else Not assigned @endif
{{ $apk->created_at->format('M j, Y') }}
{{ $apk->created_at->format('g:i A') }}
by {{ $apk->uploader->name ?? 'Unknown' }}
Assign to Rooms @if ($apk->fileExists()) Download @endif @if ($apk->status === 'active')
@csrf @method('DELETE')
@endif
No APK versions uploaded yet.

Upload First APK
@if ($apkVersions->hasPages())
{{ $apkVersions->links() }}
@endif

Room Status Overview

@foreach ($rooms->take(12) as $room)
{{ $room->room }}
@php $currentAssignment = $room->currentApkAssignment; @endphp @if ($currentAssignment)
{{ $currentAssignment->apkVersion->version_name }}
@if ($currentAssignment->status === 'installed') @include('pages.apk.components.status-badge', [ 'status' => 'installed', ]) @elseif($currentAssignment->status === 'pending') @include('pages.apk.components.status-badge', [ 'status' => 'pending', ]) @elseif($currentAssignment->status === 'downloading') @include('pages.apk.components.status-badge', [ 'status' => 'downloading', ]) @else @include('pages.apk.components.status-badge', [ 'status' => 'failed', ]) @endif
@else No APK assigned @endif
@endforeach
@if ($rooms->count() > 12)
@endif
@endsection