{{ __('Link a MikroTik') }}

{{ __('Register the router, paste the provisioning line on RouterOS, then choose PPPoE or Hotspot services.') }}

{{-- Stepper --}} @php $steps = [1 => __('Identity'), 2 => __('Provision'), 3 => __('Services'), 4 => __('Done')]; @endphp {{-- ============================ STEP 1 ============================ --}} @if ($step === 1)
{{ __('Router identity') }}

{{ __('The identity shown in Winbox under System → Identity. Provisioning will set it to match.') }}

@error('identity')
{{ $message }}
@else
{{ __('Letters, numbers, and spaces — must start and end with a letter or number.') }}
@enderror
@endif {{-- ============================ STEP 2 ============================ --}} @if ($step === 2)
{{ __('Provisioning script') }}

{{ __('Open Winbox → New Terminal and paste this one-liner. The router pulls its VPN config automatically.') }}

{{ __('Device mode not allowed') }}
{{ __('If the router returns this error after pasting the script, switch to advanced mode before retrying:') }}
  1. {{ __('Open the MikroTik terminal (Winbox → New Terminal)') }}
  2. /system/device-mode update mode=advanced
  3. {{ __('Unplug the power cord for 10 seconds, then restore power') }}
  4. {{ __('Re-run the provisioning command above') }}
{{-- Label and icon are written statically too, so the button still reads correctly before Alpine hydrates. --}} {{ $provisionCommand }}
{{-- Connection watcher --}} @if ($connected)
{{ $this->router?->router_name }} {{ __('is online at') }} {{ $this->router?->wg_address }}.
@elseif ($connectError)
{{ $connectError }}
@else
@if ($scriptFinished) {{ __('Script finished on the router — waiting for the tunnel handshake...') }} @else {{ __('Checking connection...') }} @endif
@endif
@endif {{-- ============================ STEP 3 ============================ --}} @if ($step === 3)
{{ __('Service types') }}

{{ __('Choose what this router should run for subscribers.') }}

{{ __('These are independent — tick both to run PPPoE and Hotspot on the same router.') }}

{{-- Checkbox comes last in the markup: with `margin-left:auto` on a leading flex item it would shove the whole tile to the right. --}}
@if ($serviceHotspot)
{{ __('Prevents users from sharing their hotspot connection with multiple devices. Pins the TTL so tethering is detectable — one user, one connection.') }}
@endif @error('services')
{{ $message }}
@enderror
{{ __('Bridge ports') }}

{{ __('Interfaces that join the Bilipoa bridge for subscriber traffic.') }}

@if ($loadingInterfaces)
{{ __('Reading interfaces over the tunnel...') }}
@elseif ($interfaceError)
{{ $interfaceError }}
@else @php $uplinks = collect($interfaces)->where('uplink', true)->pluck('name')->all(); @endphp @if ($uplinks)
{{ __("Don't bridge the uplink port") }}
{{ __('These interfaces run the router\'s DHCP client, so they are the uplink/WAN — adding one to the bridge cuts off the internet feed and linking fails:') }} {{ implode(', ', $uplinks) }}.
@endif
@forelse ($interfaces as $iface) @php $checked = in_array($iface['name'], $selectedPorts, true); @endphp @empty

{{ __('No interfaces found.') }}

@endforelse
@endif
{{ __('Subnet') }}

{{ __('Optional custom network for the bridge. Defaults to') }} {{ config('provisioning.default_subnet') }}.

@if ($useCustomSubnet)
@error('customSubnet')
{{ $message }}
@enderror
@endif
@endif {{-- ============================ STEP 4 ============================ --}} @if ($step === 4) @php $router = $this->router; @endphp
{{ __('Router is live') }}

{{ __('Services are configured. Subscribers can authenticate through this NAS.') }}

{{ __('Router') }}
{{ $router?->router_name }}
{{ __('VPN address') }}
{{ $router?->wg_address }}
{{ __('Services') }}
{{ collect([$servicePppoe ? 'PPPoE' : null, $serviceHotspot ? 'Hotspot' : null])->filter()->implode(', ') ?: '—' }}
{{ __('Ports') }}
{{ implode(', ', $selectedPorts) ?: '—' }}
{{ __('Status') }}
{{ __('Active') }}
@if ($configLog)
@foreach ($configLog as $line){{ $line }}
@endforeach
@endif
{{ __('All routers') }} {{ __('View router') }}
@endif