@extends('layouts.demo10.base') @section('content') @can('view.import')
@php $sourceType = $activeSourceType ?? ($activeConnection->source_type ?? 'odk'); $isCsvImport = $sourceType === 'csv'; $isApiImport = $sourceType === 'api'; @endphp
{{ $isCsvImport ? 'CSV File' : ($isApiImport ? 'API Source' : 'ODKForm') }}
Generate Schema
Import

{{ $isCsvImport ? 'CSV Data Import' : ($isApiImport ? 'API Data Import' : 'ODK Data Import') }}

Project/{{ $currentProject->name ?? 'Projects' }}/Import

@can('process.import') @endcan
@csrf

{{ $isCsvImport ? 'Active CSV Connection' : ($isApiImport ? 'Active API Connection' : 'Active ODK Connection') }}

@if($connections->count() > 0) @if($isCsvImport) {{ $connections->first()->file_name ?? basename($connections->first()->file_path ?? '') ?? 'CSV File' }} ({{ $connections->first()->project->name ?? 'N/A' }}) @elseif($isApiImport) {{ $connections->first()->base_url ?? 'API Source' }} ({{ $connections->first()->project->name ?? 'N/A' }}) @else {{ $connections->first()->form_id }} ({{ $connections->first()->project->name ?? 'N/A' }}) @endif @else No active connection found @endif
@foreach($histories as $history) @endforeach
{{ $isCsvImport ? 'Source' : ($isApiImport ? 'API URL' : 'Form ID') }} Imported By Total Imports Schema File SQL File Imported At Status
@php $historyConnection = $history->odkConnection; $historySource = ($historyConnection?->source_type ?? 'odk') === 'csv' ? ($historyConnection?->file_name ?? 'CSV') : (($historyConnection?->source_type ?? 'odk') === 'api' ? ($historyConnection?->base_url ?? 'API') : ($historyConnection?->form_id ?? 'Unknown')); @endphp {{ $historySource }} {{ $history->user?->name ?? 'N/A' }} {{ $history->total_imported }} {{ $history->schemaHistory ? basename($history->schemaHistory->schema_file) : 'N/A' }} @if($history->sql_file) Download SQL @else N/A @endif {{ $history->created_at->format('M d, Y') }} {{ ucfirst($history->status) }}
@else

Access Denied

You do not have permission to view this page.

@endcan

Importing Data

Please wait, we are importing data from the active source.

@endsection @section('scripts') @vite('resources/js/ImportDataset/import-dataset.js') @endsection