@extends('layouts.master') @section('title') Components @endsection @section('css') @endsection @section('content') @component('components.breadcrumb') @slot('li_1') System @endslot @slot('title') Components @endslot @endcomponent
@if (session('status')) @endif
{{-- --}}
Vpn server [{{ $openvpnVersion }}]

@if(isset($openvpnStatus) && !empty($openvpnStatus))

    {{-- Loop through the status information and display each item --}} @foreach($openvpnStatus as $key => $value)
  • {{ $key }}: {{ $value }}
  • @endforeach
{{-- Check the "Active" status and display whether the service is running or stopped --}} @if(isset($openvpnStatus['Active']) && strpos($openvpnStatus['Active'], 'exited') !== false) Service is running @if(preg_match("/since (.*?);/", $openvpnStatus['Active'], $matches)) @php // Parse the extracted datetime string using Carbon $lastRestart = \Carbon\Carbon::parse($matches[1]); // Calculate the difference for humans $diffForHumans = $lastRestart->diffForHumans(); // Format the exact datetime $formattedDateTime = $lastRestart->format('Y-m-d H:i:s'); @endphp

Last Restart: {{ $formattedDateTime }}
({{ $diffForHumans }})

@endif @elseif(isset($openvpnStatus['Active'])) Service is stopped @else Service status unknown @endif @else

Unable to retrieve OpenVPN status information.

@endif

{{-- --}}
Radius server [{{ $freeradiusVersion }}]

@if(isset($freeradiusStatus) && !empty($freeradiusStatus))

    {{-- Loop through the status information and display each item --}} @foreach($freeradiusStatus as $key => $value)
  • {{ $key }}: {{ $value }}
  • @endforeach
@if(isset($freeradiusStatus['Active']) && strpos($freeradiusStatus['Active'], 'running') !== false) Service is running @if(preg_match("/since (.*?);/", $freeradiusStatus['Active'], $matches)) @php // Parse the extracted datetime string using Carbon $lastRestart = \Carbon\Carbon::parse($matches[1]); // Calculate the difference for humans $diffForHumans = $lastRestart->diffForHumans(); // Format the exact datetime $formattedDateTime = $lastRestart->format('Y-m-d H:i:s'); @endphp

Last Restart: {{ $formattedDateTime }}
({{ $diffForHumans }})

@endif @elseif(isset($freeradiusStatus['Active'])) Service is stopped @else Service status unknown @endif @else

Unable to retrieve Radius status information.

@endif

{{-- --}}
Supervisor [Supervisor version {{ $supervisorVersion }} is installed]

@if(isset($supervisorStatus) && count($supervisorStatus) > 0)

    {{-- Loop through the status information and display each item --}} @foreach($supervisorMainStatus as $key => $value)
  • {{ $key }}: {{ $value }}
  • @endforeach
@if(isset($supervisorMainStatus['Active']) && strpos($supervisorMainStatus['Active'], 'running') !== false) Service is running @if(preg_match("/since (.*?);/", $supervisorMainStatus['Active'], $matches)) @php // Parse the extracted datetime string using Carbon $lastRestart = \Carbon\Carbon::parse($matches[1]); // Calculate the difference for humans $diffForHumans = $lastRestart->diffForHumans(); // Format the exact datetime $formattedDateTime = $lastRestart->format('Y-m-d H:i:s'); @endphp

Last Restart: {{ $formattedDateTime }}
({{ $diffForHumans }})

@endif @elseif(isset($supervisorMainStatus['Active'])) Service is stopped @else Service status unknown @endif @else

Unable to retrieve Supervisor status information.

@endif

@endsection @section('script') @endsection