You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.5 KiB

<div class="p-4 space-y-4">
<h1 class="text-2xl font-bold">Загрузка изображений</h1>
<div class="flex space-x-4">
@for($i=0; $i<3; $i++)
<div class="border-2 border-dashed border-gray-300 flex items-center justify-center w-1/3 h-32">
@if(isset($imagePreviews[$i]))
<img src="{{ $imagePreviews[$i] }}" class="object-cover w-full h-full" alt="Preview">
@else
<label class="cursor-pointer text-center">
<span class="text-gray-500">Перетащите файл сюда или кликните</span>
<input type="file" class="hidden" wire:model="images.{{ $i }}">
</label>
@endif
</div>
@endfor
</div>
<div class="space-x-2">
<button wire:click="startProcessing"
class="bg-blue-500 text-white px-4 py-2 rounded"
@disabled($status !== 'idle' && $status !== 'uploaded')>
Начать
</button>
@if($status === 'processing')
<button wire:poll.2s="pollStatus" class="hidden"></button>
@endif
</div>
@if($progressMessage)
<div class="text-gray-700 mt-4">{{ $progressMessage }}</div>
@endif
@if($status === 'done')
<a href="{{ route('history') }}" class="text-blue-500 underline">Посмотреть историю обработок</a>
@endif
</div>