agrovision / frontend /src /components /ui /ReprocessModal.astro
alexp97's picture
DeepSeek
feat(ui): agregar selección y expansión de variables satelitales
91bd285
Raw History Blame Contribute Delete
4.9 kB
---
// Modal para recalcular índices espectrales y datos climáticos.
---
<!-- Modal de Reprocesar -->
<div id="reprocess-modal" class="fixed inset-0 bg-black/60 z-50 hidden items-center justify-center p-4">
<div class="bg-white rounded-xl shadow-2xl max-w-md w-full p-6">
<div class="flex items-center justify-between mb-4">
<h3 class="font-bold text-sm text-stone-800"><i class="fa-solid fa-rotate mr-2 text-amber-600"></i>Reprocesar datos</h3>
<button id="btn-close-reprocess" class="text-stone-400 hover:text-stone-700"><i class="fa-solid fa-xmark text-lg"></i></button>
</div>
<p class="text-xs text-stone-600 mb-4">Recalcular datos históricos para la parcela seleccionada. Los datos existentes se sobrescribirán.</p>
<div class="space-y-3 mb-5">
<label class="flex items-center gap-3 p-3 border border-stone-200 rounded-lg hover:bg-stone-50 cursor-pointer">
<input type="radio" name="reprocess-mode" value="indices" class="accent-emerald-600">
<div><span class="text-sm font-semibold text-stone-800">Solo Sentinel-2</span><br><span class="text-[11px] text-stone-500">Recalcular NDVI, EVI, SAVI, NDWI y NDRE</span></div>
</label>
<label class="flex items-center gap-3 p-3 border border-stone-200 rounded-lg hover:bg-stone-50 cursor-pointer">
<input type="radio" name="reprocess-mode" value="weather" class="accent-amber-600">
<div><span class="text-sm font-semibold text-stone-800">Solo clima</span><br><span class="text-[11px] text-stone-500">Recargar datos climáticos (temp, HR, radiación, viento)</span></div>
</label>
<label class="flex items-center gap-3 p-3 border border-stone-200 rounded-lg hover:bg-stone-50 cursor-pointer">
<input type="radio" name="reprocess-mode" value="all" checked class="accent-stone-600">
<div><span class="text-sm font-semibold text-stone-800">Ambos</span><br><span class="text-[11px] text-stone-500">Reprocesar índices espectrales y recargar clima</span></div>
</label>
</div>
<div class="mb-5">
<div class="flex items-center justify-between gap-2 mb-1.5">
<label class="block text-[10px] font-bold text-stone-600 uppercase">Variables Satelitales a Reprocesar</label>
<button type="button" id="btn-reprocess-select-all-indices" class="text-[10px] font-semibold text-emerald-700 hover:underline">Todas</button>
</div>
<p class="text-[10px] text-stone-500 leading-relaxed mb-2">
Elige qué variables calcular o incorporar. Las variables no marcadas conservan su historial actual.
</p>
<div class="grid grid-cols-2 gap-1.5">
<label class="flex items-center gap-2 p-1.5 border border-stone-200 rounded bg-white hover:bg-emerald-50/40 cursor-pointer">
<input type="checkbox" class="reprocess-index-checkbox accent-emerald-600" value="ndvi" checked />
<span class="font-bold text-stone-800">NDVI</span>
</label>
<label class="flex items-center gap-2 p-1.5 border border-stone-200 rounded bg-white hover:bg-emerald-50/40 cursor-pointer">
<input type="checkbox" class="reprocess-index-checkbox accent-emerald-600" value="evi" />
<span class="font-bold text-stone-800">EVI</span>
</label>
<label class="flex items-center gap-2 p-1.5 border border-stone-200 rounded bg-white hover:bg-emerald-50/40 cursor-pointer">
<input type="checkbox" class="reprocess-index-checkbox accent-emerald-600" value="savi" />
<span class="font-bold text-stone-800">SAVI</span>
</label>
<label class="flex items-center gap-2 p-1.5 border border-stone-200 rounded bg-white hover:bg-emerald-50/40 cursor-pointer">
<input type="checkbox" class="reprocess-index-checkbox accent-emerald-600" value="ndwi" />
<span class="font-bold text-stone-800">NDWI</span>
</label>
<label class="flex items-center gap-2 p-1.5 border border-stone-200 rounded bg-white hover:bg-emerald-50/40 cursor-pointer col-span-2">
<input type="checkbox" class="reprocess-index-checkbox accent-emerald-600" value="ndre" />
<span class="font-bold text-stone-800">NDRE</span>
</label>
</div>
<p id="reprocess-indices-error" class="hidden text-[10px] font-semibold text-red-600 mt-1">
Marca al menos una variable satelital para reprocesar.
</p>
</div>
<div class="flex gap-2 justify-end">
<button id="btn-cancel-reprocess" class="text-xs bg-stone-100 hover:bg-stone-200 text-stone-700 px-4 py-2 rounded-lg font-semibold">Cancelar</button>
<button id="btn-run-reprocess" class="text-xs bg-amber-600 hover:bg-amber-700 text-white px-4 py-2 rounded-lg font-bold"><i class="fa-solid fa-play"></i> Ejecutar</button>
</div>
<div id="reprocess-status" class="hidden mt-3 text-xs text-stone-600"></div>
</div>
</div>