@extends('layouts.metronic', ['title' => 'Device', 'subtitle' => 'Istoric']) @section('content')
@if(Session::has('success')) @endif @if ($errors->any())
@endif

{{ 'Istoric - '.$device->label }}


{{$device->hardwareId}}
{{$device->wifiSSID}}
{{$device->userIpAddress}}
{{$device->localIPAddr}}
{{$device->group->name}}

{{ 'Intervale offline' }}

@foreach($device->history->offline_intervals->sortByDesc("start_date") as $interval) @if ($interval->start_date->year == $date->year && $interval->start_date->month == $date->month && $interval->start_date->day == $date->day)
{{$interval->start_date->format('Y-m-d H:i:s')}}
  -  
@if ($interval->end_date == null) Offline @else {{$interval->end_date->format('Y-m-d H:i:s')}} @endif
@endif @endforeach

{{ 'Comentarii' }}

@foreach($device->history->comments->sortByDesc("date") as $comment)
{{$comment->text}}
{{$comment->user->name}} {{now()->diffForHumans($comment->date, true, false, 6)}}
Status: @if ($comment->status == null) Offline @else Online @endif @if ($comment->speed != null) Viteza internet: {{$comment->speed}} Mb/s @endif
@endforeach
@endsection @section('script') @endsection @section('menuVariables') @endsection