Workforce Monitoring

On-Site Now

1

of 1 active workers

Away / Out

0

0 no record yet

Check-Ins Today

1

0 check-outs

↑ 1 in ↓ 0 out

Geofence Alerts

0

violations today

Live Operations Map

Site Geofence
Inside Geofence
Geofence Violation
`; if (headcount > 0) { popupContent += '
    '; workersAtSite.forEach(w => { popupContent += `
  • ${w.worker_name} (${w.last_seen})
  • `; }); popupContent += '
'; } else { popupContent += '

No workers currently present.

'; } popupContent += '
'; // Div Icon for Site const siteIcon = L.divIcon({ className: 'custom-site-icon', html: `
🏗️
`, iconSize: [32, 32], iconAnchor: [16, 16] }); // Add marker const marker = L.marker(siteLatLng, { icon: siteIcon }) .bindPopup(popupContent) .addTo(this.map); this.siteLayers.push(marker); // Add geofence boundary circle const circle = L.circle(siteLatLng, { color: '#eab308', fillColor: '#fef08a', fillOpacity: 0.15, radius: site.radius }).addTo(this.map); this.siteLayers.push(circle); }); // 2. Render Check-In Logs (GPS) this.logs.forEach(log => { const logLatLng = [log.latitude, log.longitude]; bounds.push(logLatLng); const color = log.geofence_ok ? '#10b981' : '#ef4444'; const badge = log.geofence_ok ? 'Within Geofence' : 'Violation (Outside)'; const badgeClass = log.geofence_ok ? 'bg-emerald-100 text-emerald-800' : 'bg-rose-100 text-rose-800'; const iconSymbol = log.direction === 'in' ? '↑' : '↓'; const logIcon = L.divIcon({ className: 'custom-log-icon', html: `
${iconSymbol}
`, iconSize: [24, 24], iconAnchor: [12, 12] }); let logPopup = `
${log.worker_name} ${badge}

🏢 Site: ${log.site_name}

🕒 Event: ${log.direction === 'in' ? 'Check-In' : 'Check-Out'} at ${log.timestamp}

Coords: ${log.latitude.toFixed(6)}, ${log.longitude.toFixed(6)}

`; const logMarker = L.marker(logLatLng, { icon: logIcon }) .bindPopup(logPopup) .addTo(this.map); this.logMarkers.push(logMarker); }); // Fit bounds if (bounds.length > 0) { this.map.fitBounds(bounds, { padding: [50, 50] }); } } })); });

Live Worker Presence

Refreshes every 30s
Worker Site Status Method Last Seen Signal
M
Map Test Worker
Map Test Site Present ⬡ NFC 13:06:03 0m ago —

Today's NFC Activity

View All
Time Worker Site Event PIN Geofence
13:06:03 Map Test Worker Map Test Site ↑ Check-In