{{ __('Routers') }} @php // A platform owner is looking at every seller's hardware at once. They can // see it and reach it for support, but linking and configuring a router // belongs to whoever sells the Wi-Fi through it. $isPlatformOwner = auth()->user()?->hasRole('Super Admin') ?? false; @endphp @unless ($isPlatformOwner) {{ __('Link MikroTik') }} @endunless
{{-- Preferred path: the router configures itself from a pasted one-liner --}} {{ __('Link a MikroTik') }} {{-- Manual entry stays for routers already reachable on a public IP --}}
@foreach ($routers as $router)
{{ $router->router_name }}
{{ $router->ip_address }}
{{ __('Username') }}: {{ $router->username }}
{{ __('SSH Port') }}: {{ $router->ssh_port ?? '-' }}
{{ __('API Port') }}: {{ $router->api_port ?? '-' }}
{{ __('Customers') }}: {{ $router->user_list_count }}
action === 'connected' ? 'checked' : '' }} x-data="{ dataSyncFunction(customer_id) { $(customer_id).text(''); let spinnerSpan = document.createElement('span'); spinnerSpan.classList.add('spinner-border', 'spinner-border-sm', 'text-primary'); spinnerSpan.setAttribute('aria-hidden', 'true'); $(customer_id).append(spinnerSpan); } }" x-on:click="if($event.target.checked){dataSyncFunction('#customers-' + {{ $router->id }})}">
{{-- Rewrites every subscriber onto this router. Needed after a reset in place, or when a replacement was linked before the old box was recognised as dead. --}}
@endforeach
{{-- Deleting a router takes its subscribers' service with it, so it is held behind a code emailed to the account owner rather than a browser confirm. --}} @if ($pendingDeleteId) @endif