mirror of
https://github.com/skidoodle/iphistory.git
synced 2025-02-15 08:29:16 +01:00
feat: include total IPs in search bar placeholder
This commit is contained in:
parent
ad07804fd4
commit
909d5a14a3
1 changed files with 8 additions and 0 deletions
|
@ -8,6 +8,7 @@ $(document).ready(function() {
|
||||||
ipHistory = data;
|
ipHistory = data;
|
||||||
filteredHistory = ipHistory;
|
filteredHistory = ipHistory;
|
||||||
displayTable();
|
displayTable();
|
||||||
|
updateTotalIPs();
|
||||||
}).fail(function() {
|
}).fail(function() {
|
||||||
console.error('Error fetching IP history');
|
console.error('Error fetching IP history');
|
||||||
});
|
});
|
||||||
|
@ -17,6 +18,7 @@ $(document).ready(function() {
|
||||||
filteredHistory = ipHistory.filter(entry => entry.timestamp.toLowerCase().includes(query) || entry.ip_address.toLowerCase().includes(query));
|
filteredHistory = ipHistory.filter(entry => entry.timestamp.toLowerCase().includes(query) || entry.ip_address.toLowerCase().includes(query));
|
||||||
currentPage = 1;
|
currentPage = 1;
|
||||||
displayTable();
|
displayTable();
|
||||||
|
updateTotalIPs();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -33,6 +35,12 @@ function displayTable() {
|
||||||
tbody.append(tr);
|
tbody.append(tr);
|
||||||
});
|
});
|
||||||
updatePaginationButtons();
|
updatePaginationButtons();
|
||||||
|
updateTotalIPs();
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateTotalIPs() {
|
||||||
|
const totalIPs = filteredHistory.length;
|
||||||
|
$('#searchBar').attr('placeholder', `Search IP history... (Total IPs: ${totalIPs})`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updatePaginationButtons() {
|
function updatePaginationButtons() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue