se eliminó el buscador en el gestor de instaladores
This commit is contained in:
parent
fc9fcca6c0
commit
12bb5c04a4
36
public.php
36
public.php
@ -1067,17 +1067,12 @@ $installersData = json_decode($config['installersDataWhatsApp'] ?? '{"instalador
|
||||
</div>
|
||||
|
||||
<!-- CONFIG CONTAINER -->
|
||||
<div class="config-container">
|
||||
<div class="form-group">
|
||||
<label>Buscar Instalador</label>
|
||||
<input type="text" id="installerSearch" class="form-control" placeholder="Nombre, ID o WhatsApp..." onkeyup="filterInstallers()">
|
||||
</div>
|
||||
<div>
|
||||
<!-- CONFIG CONTAINER -->
|
||||
<div style="display: flex; justify-content: flex-end; margin-bottom: 2rem;">
|
||||
<button class="btn btn-primary" onclick="openInstallerModal()" style="height: 42px;">
|
||||
+ Nuevo Instalador
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="overflow-x: auto;">
|
||||
<table id="installersTable">
|
||||
@ -1943,36 +1938,9 @@ $installersData = json_decode($config['installersDataWhatsApp'] ?? '{"instalador
|
||||
<img src="?action=image&file=delete.webp" class="icon-action" style="margin-left:10px" onclick="deleteInstaller(${i})" title="Borrar">
|
||||
</td>
|
||||
</tr>`).join('');
|
||||
filterInstallers(); // Re-apply filter after render
|
||||
}
|
||||
renderTable();
|
||||
|
||||
window.filterInstallers = function() {
|
||||
const query = document.getElementById('installerSearch').value.toLowerCase();
|
||||
const rows = document.querySelectorAll('#installersTable tbody tr');
|
||||
let visibleCount = 0;
|
||||
|
||||
rows.forEach(row => {
|
||||
const text = row.innerText.toLowerCase();
|
||||
if (text.includes(query)) {
|
||||
row.style.display = '';
|
||||
visibleCount++;
|
||||
} else {
|
||||
row.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
const emptyState = document.getElementById('installersEmptyState');
|
||||
const tableContainer = document.querySelector('#installersTable').parentElement;
|
||||
|
||||
if (visibleCount === 0 && rows.length > 0) {
|
||||
emptyState.style.display = 'block';
|
||||
tableContainer.style.display = 'none';
|
||||
} else {
|
||||
emptyState.style.display = 'none';
|
||||
tableContainer.style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
window.editInstaller = function(index) {
|
||||
const installer = store.installers[index];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user