diff --git a/app/templates/snapshots.html b/app/templates/snapshots.html index ff02df3..9627ddb 100644 --- a/app/templates/snapshots.html +++ b/app/templates/snapshots.html @@ -122,10 +122,26 @@ }); } + function updateFilterSummary(visibleCount) { + // Affiche le nombre cachés vs total pour debug + const total = allSnaps.length; + const hidden = total - visibleCount; + const baseStatus = status.dataset.baseMsg || ''; + if (hidden > 0) { + status.innerHTML = baseStatus + ` ⚠ ${hidden} snapshot(s) caché(s) par les filtres (décoche "Mes snapshots" ou mets âge=0 pour tout voir).`; + } else { + status.innerHTML = baseStatus; + } + } + function render() { const rows = applyFilters(); + updateFilterSummary(rows.length); if (!rows.length) { - tbody.innerHTML = 'Aucun snapshot correspondant aux filtres.'; + const total = allSnaps.length; + tbody.innerHTML = total === 0 + ? 'Aucun snapshot dans le scan. Vérifie credentials vCenter.' + : `${total} snapshot(s) trouvé(s) mais tous filtrés. Ajuste les filtres ci-dessus.`; updateDeleteBtn(); return; } @@ -171,8 +187,10 @@ } allSnaps = j.snapshots || []; const errs = (j.errors || []).map(e => `${e.vcenter}: ${e.msg}`).join(' · '); - status.innerHTML = `${j.snap_count} snapshot(s) trouvé(s) sur ${j.vcenter_count} vCenter(s).` + - (errs ? ` ⚠ ${escapeHTML(errs)}` : ''); + const baseMsg = `${j.snap_count} snapshot(s) trouvé(s) sur ${j.vcenter_count} vCenter(s).` + + (errs ? ` ⚠ ${escapeHTML(errs)}` : ''); + status.dataset.baseMsg = baseMsg; + status.innerHTML = baseMsg; render(); } catch (e) { status.innerHTML = 'Erreur réseau : ' + escapeHTML(String(e)) + '';