@extends('layouts.app') @section('header')
Administration

Version Control

Company: {{ $company?->name ?? 'None' }}
serving: mac {{ $latest['mac'] ?? '—' }} · win {{ $latest['win'] ?? '—' }}
@if ($lockedTo) locked to {{ $lockedTo }} @endif
@endsection @section('content') @php // Normalize a device's reported platform (Node process.platform) for // comparing against release platforms + a friendly label. $normalize = fn ($p) => match ($p) { 'darwin', 'mac' => 'mac', 'win32', 'win' => 'win', default => null }; $platformLabel = ['mac' => 'macOS', 'win' => 'Windows']; @endphp {{-- ── Devices: who is on which version ─────────────────────────────── --}}

Devices

{{ $deviceRows->count() }} employee{{ $deviceRows->count() === 1 ? '' : 's' }} · {{ $devices->count() }} desktop install{{ $devices->count() === 1 ? '' : 's' }} · updated on every sync (~5 min)
@forelse ($deviceRows as $row) @php // Precomputed in the controller, with abandoned installs // already dropped. Status is reported at its WORST across the // surviving devices: one straggler on an old build is the thing // an admin needs to see, and averaging it away would mark the // row green while a machine sits unpatched. $states = $row['active']; $platforms = $states->pluck('key')->unique()->values(); $versions = $states->pluck('version')->filter()->unique()->sort()->values(); $aboveLock = $states->contains('aboveLock', true); $outdated = $states->firstWhere('outdated', true); $noRelease = $states->contains(fn ($s) => ! $s['target']); @endphp @empty @endforelse
Employee Platform App version Status Last synced
{{ $row['name'] }}
@if ($row['count'] > 1 || $row['retired'])
@if ($row['count'] > 1) {{-- Asterisked because a Device row is an install, not a machine. --}} {{ $row['count'] }} devices* @endif @if ($row['retired']) {{-- Shown, not hidden: the install still exists, it just no longer counts toward the verdict. --}} @if ($row['count'] > 1)·@endif {{ $row['retired'] }} retired @endif
@endif
@forelse ($platforms as $key) {{ $platformLabel[$key] ?? '—' }} @empty — @endforelse @forelse ($versions as $v) {{ $v }} @empty @endforelse @if ($aboveLock) above lock @elseif ($outdated) outdated → {{ $outdated['target'] }} @elseif ($noRelease) no release @else up to date @endif @if ($row['last_sync']) {{ $row['last_sync']->diffForHumans() }} @else — @endif
No devices have synced yet.
@if ($deviceRows->contains(fn ($r) => $r['count'] > 1 || $r['retired'])) {{-- Only shown when a starred count or a retired install is on screen. --}} @endif
{{-- ── Release history ───────────────────────────────────────────────── --}}

Releases

@if ($lockedTo) up to {{ $lockedTo }} — this company's version lock @if ($hiddenCount > 0) · {{ $hiddenCount }} newer {{ \Illuminate\Support\Str::plural('release', $hiddenCount) }} hidden @endif @endif
@if ($lockedTo) @endif
@forelse ($releases as $release) @empty @endforelse
PlatformVersionFileSize NotesUploadedStatus
{{ $platformLabel[$release->platform] ?? $release->platform }} {{ $release->version }} {{ $release->original_name }} {{ number_format($release->size / 1048576, 1) }} MB {{ $release->notes ?? '—' }} {{ $release->created_at->diffForHumans() }} @if ($release->is_active) active @else inactive @endif {{-- Releases are a shared pool across tenants, so only the Super Admin may pull or delete one. --}} @if (! auth()->user()?->isSuperAdmin()) @else
@csrf @method('PATCH')
@csrf @method('DELETE')
@endif
No releases published yet.
@endsection