fix(snapshots): visibilite des filtres (compteur snapshots caches + message clair quand filtres trop restrictifs)
- Si les filtres cachent des snapshots, status affiche '⚠ N snapshot(s) cache(s)' avec hint pour decocher 'Mes snapshots' ou mettre age=0 - Tableau vide differencie 2 cas: * 0 trouvé total -> 'Verifie credentials vCenter' * X trouvé mais tous filtrés -> 'Ajuste les filtres ci-dessus' en jaune
This commit is contained in:
parent
3cdff5db08
commit
0b98b54a63
@ -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 + ` <span class="text-cyber-yellow">⚠ ${hidden} snapshot(s) caché(s) par les filtres</span> (décoche "Mes snapshots" ou mets âge=0 pour tout voir).`;
|
||||||
|
} else {
|
||||||
|
status.innerHTML = baseStatus;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function render() {
|
function render() {
|
||||||
const rows = applyFilters();
|
const rows = applyFilters();
|
||||||
|
updateFilterSummary(rows.length);
|
||||||
if (!rows.length) {
|
if (!rows.length) {
|
||||||
tbody.innerHTML = '<tr><td colspan="8" class="p-4 text-center text-gray-500">Aucun snapshot correspondant aux filtres.</td></tr>';
|
const total = allSnaps.length;
|
||||||
|
tbody.innerHTML = total === 0
|
||||||
|
? '<tr><td colspan="8" class="p-4 text-center text-gray-500">Aucun snapshot dans le scan. Vérifie credentials vCenter.</td></tr>'
|
||||||
|
: `<tr><td colspan="8" class="p-4 text-center text-cyber-yellow">${total} snapshot(s) trouvé(s) mais tous filtrés. Ajuste les filtres ci-dessus.</td></tr>`;
|
||||||
updateDeleteBtn();
|
updateDeleteBtn();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -171,8 +187,10 @@
|
|||||||
}
|
}
|
||||||
allSnaps = j.snapshots || [];
|
allSnaps = j.snapshots || [];
|
||||||
const errs = (j.errors || []).map(e => `${e.vcenter}: ${e.msg}`).join(' · ');
|
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).` +
|
const baseMsg = `${j.snap_count} snapshot(s) trouvé(s) sur ${j.vcenter_count} vCenter(s).` +
|
||||||
(errs ? ` <span class="text-cyber-yellow">⚠ ${escapeHTML(errs)}</span>` : '');
|
(errs ? ` <span class="text-cyber-yellow">⚠ ${escapeHTML(errs)}</span>` : '');
|
||||||
|
status.dataset.baseMsg = baseMsg;
|
||||||
|
status.innerHTML = baseMsg;
|
||||||
render();
|
render();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
status.innerHTML = '<span class="text-cyber-red">Erreur réseau : ' + escapeHTML(String(e)) + '</span>';
|
status.innerHTML = '<span class="text-cyber-red">Erreur réseau : ' + escapeHTML(String(e)) + '</span>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user