@extends('layouts.app') @section('center') @php use Carbon\Carbon; $offlineAfterMinutes = 60; $totalDevices = count($data); $onlineCount = 0; $offlineCount = 0; $offCount = 0; foreach ($data as $device) { if (!empty($device->server_time_update_our_value)) { $lastTime = Carbon::parse($device->server_time_update_our_value); $minutesDiff = now()->diffInMinutes($lastTime); } else { $minutesDiff = 999999; } if (($device->auxr_status ?? 0) == 1) { if ($minutesDiff > $offlineAfterMinutes) { $offlineCount++; } else { $onlineCount++; } } else { $offCount++; } } @endphp

TransFocure Device Monitoring Dashboard

Total Devices

{{ $totalDevices }}

Online Devices

{{ $onlineCount }}

Offline Devices

{{ $offlineCount }}

Off Devices

{{ $offCount }}

No devices found for selected filter.
@forelse($data as $row) @php $color = "success"; $state = "Online"; $lastPulse = "Never"; $age = "Never"; if (!empty($row->server_time_update_our_value)) { $lastDateTime = Carbon::parse($row->server_time_update_our_value); $minutes = now()->diffInMinutes($lastDateTime); $lastPulse = $lastDateTime->format('d M Y, h:i A'); $age = $lastDateTime->diffForHumans(); } else { $minutes = 999999; } if (($row->auxr_status ?? 0) == 1) { if ($minutes > $offlineAfterMinutes) { $color = "info"; $state = "Offline"; } else { $color = "success"; $state = "Online"; } } else { $color = "danger"; $state = "Off"; } $statusKey = strtolower($state); $sumCurrent = $row->sum_current ?? 0; $avgVoltage = $row->avg_voltage ?? 0; $avgPf = $row->avg_powerfactor ?? 0; $totalKva = $row->total_kva ?? 0; $totalKw = $row->total_kw ?? 0; $totalConsumption = $row->total_consumption ?? 0; if ($sumCurrent <= 0) { $displayPf = '0.00'; } else { $displayPf = number_format($avgPf, 2); } @endphp
Device ID: {{ $row->global_device_id ?? 'N/A' }}
Capacity: {{ $row->kva ?? '0' }} KVA
{{ $state }}
Last Update: {{ $lastPulse }} {{ $age }}
Total Current: {{ number_format($sumCurrent, 2) }} Amps
Voltage: {{ number_format($avgVoltage, 2) }} Volts
Power Factor: {{ $displayPf }}
Apparent Power: {{ number_format($totalKva, 2) }} KVA
Active Power: {{ number_format($totalKw, 2) }} KW
Consumption: {{ number_format($totalConsumption, 2) }} kWh
@empty
No transformer devices found.
@endforelse
@endsection