@extends('layouts.admin.theme') @section("title", env("APP_NAME") . " :: " . __("MobiAngra")) @section('content')
@php $headLine = " " . __('MobiAngra'); $tabAtual = $tabAtual ?? request('tab', 'mapa'); @endphp @include('components.buttons._headLineButtonsBackAdd', [ 'headLine' => $headLine, 'routeBack' => 'admin.dashboard', 'routeBackParams' => [], 'nameBack' => __('Voltar'), 'permission' => 'GERENCIADOR_DE_MOBIANGRA', ])
@include('errors.messageFlash') {{-- ===== TABS ===== --}}
{{-- ===== TAB: MAPA ===== --}}
{{-- Status do Feed GTFS-RT --}}
{{ __('Status do Feed em Tempo Real') }}
@if ($feedStatus)

{{ __('Última atualização') }}: @if ($feedStatus['success']) {{ \Carbon\Carbon::parse($feedStatus['last_update'])->diffForHumans() }} @else {{ __('Falha') }} @endif

{{ __('Veículos no último fetch') }}: {{ $feedStatus['vehicle_count'] ?? 0 }}

{{ __('Horário') }}: {{ $feedStatus['last_update'] ?? '-' }}

@else
{{ __('O feed ainda não foi executado. Use o botão abaixo ou aguarde o cron (a cada 10s) para a primeira atualização.') }}
@endif

{{ __('Arquivo Protobuf (.pb)') }}: @if ($pbExists) {{ __('Disponível') }} @else {{ __('Não gerado') }} @endif

{{ __('Arquivo JSON (live_data)') }}: @if ($jsonExists) {{ __('Disponível') }} @else {{ __('Não gerado') }} @endif

{{ __('Acesso Rápido') }}
{{ __('Endpoint JSON (mapa)') }}:
{{ url('/mobiangra/live_data') }}
{{ __('Google Transit / validadores') }}: {{ __('Use somente as URLs canônicas abaixo. Não use') }} /mobiangra/gtfs.zip {{ __('nem') }} /mobiangra/feed.pb.
{{ __('Feed GTFS-RT (tempo real)') }}:
{{ route('mobiangra.gtfs.feed_pb') }}
{{ __('GTFS estático (.zip)') }}:
@if ($gtfsStaticAvailable) {{ route('mobiangra.gtfs.gtfs_zip') }} @else {{ route('mobiangra.gtfs.gtfs_zip') }} {{ __('Aguardando upload GTFS') }} @endif

@if (auth()->user()->getPermissaoDetalhes('GERENCIADOR_DE_MOBIANGRA')['editar'] ?? false)
@csrf
@endif
{{-- Arquivos GTFS --}}
{{ __('Arquivos GTFS Estáticos') }}
@foreach ($gtfsFiles as $filename => $exists)
{{ $filename }}
@endforeach
@if (auth()->user()->getPermissaoDetalhes('GERENCIADOR_DE_MOBIANGRA')['adicionar'] ?? false)
@csrf

{{ __('Atualizar GTFS') }}

@error('gtfs_zip')
{{ $message }}
@enderror
{{ __('Envio alternativo: arquivos .txt individuais') }}
@php $gtfsInputs = [ 'calendar' => 'calendar.txt', 'calendar_dates' => 'calendar_dates.txt', 'routes' => 'routes.txt', 'trips' => 'trips.txt', 'stops' => 'stops.txt', 'shapes' => 'shapes.txt', 'stop_times' => 'stop_times.txt', 'agency' => 'agency.txt', 'feed_info' => 'feed_info.txt', ]; @endphp @foreach ($gtfsInputs as $field => $label)
@endforeach
@endif
{{-- fleet.json --}}
{{ __('Configuração da frota (linhas e veículos)') }}

{{ __('Arquivo') }}: {{ config('mobiangra.storage_dir') }}/{{ config('mobiangra.fleet_filename', 'fleet.json') }} @if ($fleetExists) {{ __('Disponível') }} @else {{ __('Será criado no primeiro acesso') }} @endif

@if (auth()->user()->getPermissaoDetalhes('GERENCIADOR_DE_MOBIANGRA')['editar'] ?? false)
@csrf
@csrf
@endif
{{-- Configurações técnicas --}}
{{ __('Informações Técnicas') }}

{{ __('API de telemetria em uso') }}:
{{ config('mobiangra.api_url') }}

{{ __('Intervalo de atualização atual') }}: {{ $fetchInterval }}s

{{ __('Modo de atualização') }}: {{ __('Lazy (automático via mapa)') }}

@if (auth()->user()->getPermissaoDetalhes('GERENCIADOR_DE_MOBIANGRA')['editar'] ?? false)
@csrf
s @error('fetch_interval')
{{ $message }}
@enderror
@endif
{{-- /tab-mapa --}} {{-- ===== TAB: HORÁRIOS ===== --}}
{{-- Cabeçalho com ações --}}
{{ __('Linhas de Horários') }} {{ $linhasHorarios->count() }}
{{ __('Ver no site') }} @if (auth()->user()->getPermissaoDetalhes('GERENCIADOR_DE_MOBIANGRA')['adicionar'] ?? false) {{ __('Nova linha') }} {{-- Importar XLSX --}} @endif
@include('admin.mobiangra.horarios._linhas_tbody', ['linhasHorarios' => $linhasHorarios])
{{ __('Código') }} {{ __('Nome') }} {{ __('Tarifa') }} {{ __('Seções') }} {{ __('Status') }} {{ __('Ações') }}
{{ __('Nenhuma linha cadastrada. Clique em "Nova linha" para começar, ou importe um arquivo XLSX.') }}
{{ __('Nenhuma linha encontrada para esta busca.') }}
{{-- Modal importar XLSX --}}
{{-- /tab-horarios --}} @include('admin.mobiangra.manifestacoes._tab') @include('admin.mobiangra.alertas._tab')
{{-- /tab-content --}}
@push('after-scripts') @endpush @endsection