@extends('layouts.app') @php // Tiles and chart tooltips, not a table — see Duration::compact. $hm = fn ($sec) => \App\Support\Duration::compact((int) $sec); @endphp @section('header')
Overview

Dashboard

{{ now()->format('l, d M Y') }} · {{ $headcount }} active {{ Str::plural('employee', $headcount) }}
Live People
@endsection @section('content') {{-- ── 1. Right now ────────────────────────────────────────────────────── --}} @php $presenceCards = [ ['label' => 'Working', 'value' => $presence['online'], 'colour' => 'green', 'icon' => 'ti-player-play'], ['label' => 'On break', 'value' => $presence['break'], 'colour' => 'yellow', 'icon' => 'ti-player-pause'], ['label' => 'Not started', 'value' => $presence['absent'], 'colour' => 'secondary', 'icon' => 'ti-zzz'], ]; @endphp
@foreach ($presenceCards as $c)
{{ $c['value'] }}
{{ $c['label'] }}
@endforeach {{-- Tracked against what the roster asked for. The denominator is every active employee, not only those who turned up — otherwise a day where half the team never started reads as a flattering 100%. --}}
{{ $hm($today['active_sec']) }}
Tracked today
@if ($today['pct_of_target'] !== null)
{{ $today['pct_of_target'] }}% of {{ $hm($today['expected_sec']) }} rostered
@endif
{{-- ── 3. Needs a look ───────────────────────────────────────────────── The part of this page worth opening. Each bucket answers a question someone would otherwise go hunting for, and each is capped — forty names is a report, not a signal. --}}

Needs a look

@if ($attention['clear'])
Nothing to flag
No late starts, overtime, low activity or silent agents today.
@else
@php $buckets = [ ['key' => 'late', 'total' => 'late_total', 'icon' => 'ti-clock-exclamation', 'colour' => 'orange', 'title' => 'Not started', 'hint' => 'their shift has begun with nothing tracked'], ['key' => 'silent', 'total' => 'silent_total', 'icon' => 'ti-plug-connected-x', 'colour' => 'red', 'title' => 'Agent silent', 'hint' => 'was tracking, then the data stopped'], ['key' => 'low', 'total' => 'low_total', 'icon' => 'ti-activity-heartbeat', 'colour' => 'yellow', 'title' => 'Low input activity', 'hint' => 'a long session with little keyboard or mouse'], ['key' => 'overtime', 'total' => 'overtime_total', 'icon' => 'ti-flame', 'colour' => 'green', 'title' => 'Over the rostered day', 'hint' => 'active beyond what the shift asked for'], ]; @endphp @foreach ($buckets as $b) @continue (empty($attention[$b['key']]))
{{ $b['title'] }} {{ $attention[$b['total']] }}
{{ $b['hint'] }}
@foreach ($attention[$b['key']] as $item) {{ $item['name'] }} @if ($b['key'] === 'overtime') +{{ $hm($item['sec']) }} @elseif ($b['key'] === 'low') {{ $item['pct'] }}% · {{ $hm($item['sec']) }} @elseif ($b['key'] === 'silent') {{ $item['since'] }} @elseif (! empty($item['ended'])) shift ended @endif @endforeach @if ($attention[$b['total']] > count($attention[$b['key']])) +{{ $attention[$b['total']] - count($attention[$b['key']]) }} more @endif
@endforeach
@endif
{{-- ── 2. Today, in shape ──────────────────────────────────────────── --}}

Today

@php $r = 52; $circ = 2 * M_PI * $r; $act = $today['activity_pct']; @endphp
@if ($act !== null) @endif {{ $act === null ? '—' : $act . '%' }} input activity
{{-- A dash rather than 0%: before 1.15.0 the agent didn't sample input, and "not measured" is not "idle". --}} @if ($act === null)
No input measurement yet today — desktops on 1.15.0 or newer report it.
@endif
Idle{{ $hm($today['idle_sec']) }}
Rostered{{ $hm($today['expected_sec']) }}
Screenshots{{ number_format($today['shots']) }}
{{-- Is the monitoring itself healthy? A fleet quietly running an old build is the sort of thing nobody notices until a fix appears not to have shipped. --}}
Desktop fleet
Installs
{{ $fleet['devices'] }}
People
{{ $fleet['people'] }}
Outdated
{{ $fleet['outdated'] }}
Version Control
{{-- ── 4. The fortnight the day sits inside ────────────────────────────── --}}

Last {{ $trend['days']->count() }} days

tracked hours · input activity
@foreach ($trend['days'] as $d) @php $h = $trend['peak'] > 0 ? round($d['active'] / $trend['peak'] * 100) : 0; @endphp
{{-- The activity share is drawn INSIDE the day's bar rather than beside it: it is a proportion of that day's time, and a second bar would invite reading it as a total. --}}
@if ($d['activity_pct'] !== null)
@endif
{{ $d['label'] }}
@endforeach
Tracked Of which saw input
@endsection @push('styles') @endpush