{{ __('driver.gps_overview_title') }} @push('head') @endpush

{{ __('driver.gps_overview_heading') }}

{{ __('driver.gps_auto_refresh_note') }}

@if($drivers->isEmpty())

{{ __('driver.gps_no_drivers') }}

@else
@foreach($drivers as $driver) @php $hasCredentials = !empty($driver->owntracks_username); $gps = $latestGps->get($driver->id); $activeJob = $activeJobs->get($driver->id); if (!$hasCredentials) { $statusClass = 'bg-gray-100 text-gray-500'; $statusLabel = __('driver.gps_status_not_configured'); } elseif (!$gps) { $statusClass = 'bg-gray-100 text-gray-800'; $statusLabel = __('driver.gps_status_no_data'); } else { $age = $now - $gps->timestamp; if ($age <= 300) { $statusClass = 'bg-green-100 text-green-800'; $statusLabel = __('driver.gps_status_online'); } elseif ($age <= 3600) { $statusClass = 'bg-yellow-100 text-yellow-800'; $statusLabel = __('driver.gps_status_idle'); } else { $statusClass = 'bg-red-100 text-red-800'; $statusLabel = __('driver.gps_status_offline'); } } @endphp @endforeach
{{ __('driver.gps_col_driver') }} {{ __('driver.gps_col_status') }} {{ __('driver.gps_col_last_seen') }} {{ __('driver.gps_col_battery') }} {{ __('driver.gps_col_active_job') }} {{ __('driver.gps_col_credentials') }}
{{ $driver->name }} {{ $statusLabel }} @if($gps) {{ \Carbon\Carbon::createFromTimestamp($gps->timestamp)->diffForHumans() }} @else — @endif @if($gps && $gps->battery !== null) {{ $gps->battery }}% @else — @endif @if($activeJob) {{ $activeJob->customer->name }} {{ $activeJob->type->label() }} @else {{ __('driver.gps_no_active_job') }} @endif @if($hasCredentials) {{ __('driver.gps_credentials_configured') }} @else {{ __('driver.gps_credentials_not_configured') }} @endif
@endif