added DNS resolver
This commit is contained in:
@@ -42,26 +42,28 @@
|
||||
<a class="btn text-light" onclick="initializeTable('latest_requests');">Latest</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="btn text-light" onclick="initializeTable('count_requests_by_ip');">Top by IP</a>
|
||||
<a class="btn text-light" onclick="initializeTable('count_requests_by_ip');">Top by
|
||||
IP</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="btn text-light" onclick="initializeTable('count_requests_by_ua');">Top by UA</a>
|
||||
<a class="btn text-light" onclick="initializeTable('count_requests_by_ua');">Top by
|
||||
UA</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="btn text-light" onclick="initializeTable('top_ip_ua_path');">IP+UA+Path</a>
|
||||
<a class="btn text-light" onclick="initializeTable('top_ip_ua_path');">IP+UA+Path</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="btn text-light" onclick="initializeTable('top_ip_by_load');">IP+Load</a>
|
||||
<a class="btn text-light" onclick="initializeTable('top_ip_by_load');">IP+Load</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="btn text-light" onclick="initializeTable('top_ip_by_rps');">IP+RPS</a>
|
||||
<a class="btn text-light" onclick="initializeTable('top_ip_by_rps');">IP+RPS</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="btn text-light" onclick="initializeTable('top_net_28_by_rps');">IP+RPS</a>
|
||||
<a class="btn text-light" onclick="initializeTable('top_net_28_by_rps');">IP+RPS</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -104,7 +106,7 @@
|
||||
<div class="input-group">
|
||||
<div class="input-group-text">From</div>
|
||||
|
||||
<input type="datetime-local" id="date-from" name="date-from" class="form-control mr-3" >
|
||||
<input type="datetime-local" id="date-from" name="date-from" class="form-control mr-3">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
@@ -127,7 +129,7 @@
|
||||
</div>
|
||||
<script>
|
||||
document.getElementById('date-from').addEventListener('change', refreshTable);
|
||||
|
||||
|
||||
document.getElementById('limit').addEventListener('change', refreshTable);
|
||||
|
||||
function refreshTable() {
|
||||
@@ -147,7 +149,7 @@
|
||||
dateFrom.value = yesterday.toISOString().slice(0, 16);
|
||||
dateTo.value = tomorrow.toISOString().slice(0, 16);
|
||||
};
|
||||
document.getElementById('date-to').addEventListener('change', refreshTable);
|
||||
document.getElementById('date-to').addEventListener('change', refreshTable);
|
||||
|
||||
|
||||
function initializeTable(latest_requests) {
|
||||
@@ -258,6 +260,68 @@
|
||||
{/if}
|
||||
}
|
||||
</script>
|
||||
{literal}
|
||||
<script>
|
||||
function ipFormatter(value) {
|
||||
return `<span class="ip-address" data-ip="${value}">${value}</span>`;
|
||||
}
|
||||
|
||||
document.addEventListener('mouseover', async (event) => {
|
||||
const target = event.target;
|
||||
if (target.classList.contains('ip-address')) {
|
||||
const ipAddress = target.getAttribute('data-ip');
|
||||
const popupId = `popup-${ipAddress.replace(/\./g, '-')}`;
|
||||
let popup = document.getElementById(popupId);
|
||||
|
||||
if (!popup) {
|
||||
popup = document.createElement('div');
|
||||
popup.id = popupId;
|
||||
popup.style.position = 'absolute';
|
||||
popup.style.background = '#f9f9f9';
|
||||
popup.style.border = '1px solid #ccc';
|
||||
popup.style.padding = '10px';
|
||||
popup.style.borderRadius = '5px';
|
||||
popup.style.boxShadow = '0 0 10px rgba(0, 0, 0, 0.2)';
|
||||
popup.style.zIndex = '1000';
|
||||
popup.style.whiteSpace = 'nowrap';
|
||||
popup.style.display = 'none';
|
||||
document.body.appendChild(popup);
|
||||
|
||||
fetch(location.pathname + `/api/ipinfo/${ipAddress}`)
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
const location = data.geo.continent?.names?.en + ' > ' + data.geo.country
|
||||
?.names?.en + ' > ' + data.geo.city?.names?.en || 'Unknown';
|
||||
const reverseDns = data.reverse_dns || 'N/A';
|
||||
popup.innerHTML = `
|
||||
<strong>Location:</strong> ${location}<br>
|
||||
<strong>Reverse DNS:</strong> ${reverseDns}
|
||||
`;
|
||||
})
|
||||
.catch(() => {
|
||||
popup.innerHTML = 'Error fetching data.';
|
||||
});
|
||||
}
|
||||
|
||||
popup.style.display = 'block';
|
||||
popup.style.left = `${event.pageX + 10}px`;
|
||||
popup.style.top = `${event.pageY + 10}px`;
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener('mouseout', (event) => {
|
||||
const target = event.target;
|
||||
if (target.classList.contains('ip-address')) {
|
||||
const ipAddress = target.getAttribute('data-ip');
|
||||
const popupId = `popup-${ipAddress.replace(/\./g, '-')}`;
|
||||
const popup = document.getElementById(popupId);
|
||||
if (popup) {
|
||||
popup.style.display = 'none';
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
||||
<footer class="centro-blue text-white text-center py-3">
|
||||
<div class="footer">
|
||||
<div class="container text-center centro-blue text-light">
|
||||
|
||||
Reference in New Issue
Block a user