rolling top scores 24h
This commit is contained in:
@@ -294,6 +294,7 @@ function top_ips(int $n = TOP_N): array {
|
||||
$s = db()->prepare(
|
||||
'SELECT src_ip, COUNT(*) AS cnt
|
||||
FROM connections
|
||||
WHERE occurred_at >= NOW() - INTERVAL 24 HOUR
|
||||
GROUP BY src_ip
|
||||
ORDER BY cnt DESC
|
||||
LIMIT ?'
|
||||
@@ -306,6 +307,7 @@ function top_ports(int $n = TOP_N): array {
|
||||
$s = db()->prepare(
|
||||
'SELECT dst_port, COUNT(*) AS cnt
|
||||
FROM connections
|
||||
WHERE occurred_at >= NOW() - INTERVAL 24 HOUR
|
||||
GROUP BY dst_port
|
||||
ORDER BY cnt DESC
|
||||
LIMIT ?'
|
||||
@@ -318,7 +320,7 @@ function top_ips_by_node(int $node_id, int $n = TOP_N): array {
|
||||
$s = db()->prepare(
|
||||
'SELECT src_ip, COUNT(*) AS cnt
|
||||
FROM connections
|
||||
WHERE node_id = ?
|
||||
WHERE node_id = ? AND occurred_at >= NOW() - INTERVAL 24 HOUR
|
||||
GROUP BY src_ip
|
||||
ORDER BY cnt DESC
|
||||
LIMIT ?'
|
||||
|
||||
@@ -94,7 +94,7 @@ $update_available = $upstream_version && is_newer_version($upstream_version, APP
|
||||
<!-- Top IPs + Top Ports -->
|
||||
<div class="two-col">
|
||||
<div class="card">
|
||||
<h2>Top source IPs</h2>
|
||||
<h2>Top source IPs <small class="muted" style="font-size:.7rem;font-weight:400">(24 h)</small></h2>
|
||||
<?php if (empty($t_ips)): ?>
|
||||
<p class="muted">No data yet.</p>
|
||||
<?php else: ?>
|
||||
@@ -118,7 +118,7 @@ $update_available = $upstream_version && is_newer_version($upstream_version, APP
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>Top targeted ports</h2>
|
||||
<h2>Top targeted ports <small class="muted" style="font-size:.7rem;font-weight:400">(24 h)</small></h2>
|
||||
<?php if (empty($t_ports)): ?>
|
||||
<p class="muted">No data yet.</p>
|
||||
<?php else: ?>
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<?php
|
||||
define('APP_VERSION', '2603.5');
|
||||
define('APP_VERSION', '2603.6');
|
||||
|
||||
Reference in New Issue
Block a user