@extends('layouts.app') @section('title', $site->name) @section('content')

{{ $site->name }}

{{ $site->site_code }} · {{ $site->status }} · {{ title_case_words($site->type) }}

+ Add device ← Back to sites
@include('components.kpi', ['label' => 'Devices', 'value' => $site->devices()->count(), 'variant' => 'info', 'href' => '#devices']) @include('components.kpi', ['label' => 'Up', 'value' => $site->devices()->where('status', 'up')->count(), 'variant' => $site->devices()->where('status', 'down')->count() > 0 ? 'bad' : 'good', 'href' => '#devices']) @include('components.kpi', ['label' => 'Active alerts', 'value' => $site->alerts()->active()->count(), 'variant' => $site->alerts()->active()->count() > 0 ? 'bad' : 'good', 'href' => '#']) @include('components.kpi', ['label' => 'Latency', 'value' => $site->last_latency_ms !== null ? number_format($site->last_latency_ms, 1).' ms' : '—', 'href' => '#'])

Site detail

Site code
{{ $site->site_code }}
Type
{{ title_case_words($site->type) }}
Address
{{ $site->address ?: '—' }}
City / region
{{ $site->city }}{{ $site->region ? ', '.$site->region : '' }}
Coordinates
{{ $site->latitude && $site->longitude ? $site->latitude.', '.$site->longitude : '—' }}
Branch
{{ $site->branch?->name ?? 'Head office' }}
Power
{{ $site->power_source ? title_case_words($site->power_source) : '—' }}
Contact
{{ $site->contact_name ?: '—' }}{{ $site->contact_phone ? ' — '.$site->contact_phone : '' }}
Registered
{{ $site->created_at->format('d M Y') }}

Latency — 24h

@include('components.chart', [ 'series' => collect($pings)->map(fn ($p) => [ 'label' => \Carbon\Carbon::parse($p['checked_at'])->format('H:i'), 'value' => $p['response_ms'], ])->all(), 'type' => 'line', 'format' => 'number', 'height' => 200, ])

Devices at this site

@forelse ($site->devices as $device) @empty @endforelse
DeviceRoleManagement IPLatencyUptimeStatusLast poll
{{ $device->name }}
{{ $device->vendor }} {{ $device->model }}
{{ title_case_words($device->role) }} {{ $device->management_ip }} {{ $device->last_ping_ms !== null ? number_format($device->last_ping_ms, 1).' ms' : '—' }} {{ $device->uptime_label }} {{ $device->status }} {{ $device->last_polled_at?->diffForHumans() ?? 'never' }}
@include('components.empty-state', ['icon' => '⚙', 'title' => 'No devices at this site', 'action' => '+ Add device'])
@endsection