{{ __('Settings') }}

{{ __('IP Settings') }}

@php $hasActiveAddresses = $allowedIps->contains(fn ($allowedIp) => $allowedIp->is_active); @endphp
@if ($restrictionIsOn) @else @endif

{{ $restrictionIsOn ? __('IP restriction is on') : __('IP restriction is off') }}

@if ($restrictionIsOn) {{ __('Only the addresses switched on below can open this software, including the login page. Everyone else sees a "Not from here" page.') }} @elseif ($hasActiveAddresses) {{ __('Anyone with a login can open the software from any place. The list below is kept; turn the restriction on to use it.') }} @else {{ __('Anyone with a login can open the software from any place. Add your address below, then turn the restriction on.') }} @endif

{{ __('You are on') }} {{ $currentIp }}

@if ($restrictionIsOn || $hasActiveAddresses)
@csrf @method('put')
@else @endif

{{ __('Allowed addresses') }}

{{ __('Offices, clinics and homes the software may be opened from. Add an address, or a whole range for an office network.') }}

{{ __('Add address') }}
@if ($allowedIps->isEmpty())

{{ __('No addresses yet. Start with the one you are on now, :ip, so you are never locked out.', ['ip' => $currentIp]) }}

@else
@foreach ($allowedIps as $allowedIp) @endforeach
{{ __('Place') }} {{ __('Address') }} {{ __('Added') }} {{ __('Status') }} {{ __('Actions') }}
{{ $allowedIp->label }} @if ($allowedIp->matches($currentIp)) {{ __('You') }} @endif
{{ $allowedIp->ip_address }} @if ($allowedIp->isRange()) {{ __('range') }} @endif {{ $allowedIp->created_at->format('M j, Y') }} {{ __('by :who', ['who' => $allowedIp->creator?->name ?? __('someone')]) }} {{ $allowedIp->is_active ? __('On') : __('Off') }}
@csrf @method('put') {{ $allowedIp->is_active ? __('Turn off') : __('Turn on') }}
{{ __('Edit') }}
@csrf @method('delete') {{ __('Delete') }}
@endif

{{ __('How it works') }}

{{ __('Restriction off') }}
{{ __('The software opens from anywhere. The list is kept but not used.') }}
{{ __('Restriction on') }}
{{ __('Only the places switched on get in. Everyone else is stopped before the login page.') }}
{{ __('Each address on its own') }}
{{ __('Turning one address off or deleting it never changes the switch above. While on, the last address and the one that lets you in cannot be removed.') }}