@extends('layouts.app') @section('content')

Device Sync Status Dashboard

Monitor user synchronization status across all devices

@if ($message = Session::get('success')) @endif @if ($message = Session::get('error')) @endif
Total Devices

{{ count($devices) }}

Online Devices

{{ collect($devices)->filter(fn($d) => $d['is_online'])->count() }}

Synced Users

{{ collect($devices)->sum('synced') }}

Pending Syncs

{{ collect($devices)->sum('pending') }}

Device Synchronization Status
@if(count($devices) > 0) @foreach($devices as $device) @endforeach @else @endif
Status Serial Number Device Name Location Total Users Synced Pending Failed Progress Last Sync Actions
@if($device['is_online']) Online @else @if($device['online']) Offline @else Never Online @endif @endif {{ $device['no_sn'] }} {{ $device['nama'] }} {{ $device['lokasi'] }} {{ $device['total_users'] }} {{ $device['synced'] }} {{ $device['pending'] }} @if($device['failed'] > 0) {{ $device['failed'] }} @else 0 @endif
{{ $device['sync_percentage'] }}%
@if($device['last_sync']) {{ $device['last_sync']->diffForHumans() }} @else Never @endif
@csrf
@if($device['pending'] > 0)
@csrf
@endif View Edit
No devices found
User Sync Methods & Timing
🔄 Method 1: "Sync" Button (Passive Pull)

Queues users as "pending" and waits for device to request them

  1. Immediate: Users queued as "pending" (milliseconds)
  2. Device-dependent: Device calls /iclock/user-upload when it decides (minutes to hours)
  3. Immediate: Status updates to "synced" once device fetches them (milliseconds)

⚠️ Issue: Some devices never request user data automatically!

⚡ Method 2: "Push Now" Button (Active Push)

Immediately sends users to server and marks them as synced

  1. Immediate: Users marked as "synced" (milliseconds)
  2. Immediate: Data prepared and ready for device (milliseconds)
  3. Next handshake: Device receives users on next sync (within minutes)

Better: Works for devices that don't auto-pull users!


📊 How Sync Works:
Status Meaning What to do
Pending Users queued, waiting for device to fetch or push confirmation Click Push Now to force sync or UDP Sync for direct protocol
Synced Users successfully transferred to device Users now available on device fingerprint scanner
Failed Sync attempt failed (rare) Click Sync to retry or Push Now to force

Pro Tip: For best results with remote devices behind firewalls, deploy the Local Sync Agent (Python application running on local network) which automatically syncs users from cloud to devices. See documentation for setup instructions. Alternatively, use Push Now button to manually mark users as synced.

@endsection