diff --git a/portspoof_py/admin.py b/portspoof_py/admin.py index 9d8e29c..d934696 100644 --- a/portspoof_py/admin.py +++ b/portspoof_py/admin.py @@ -301,9 +301,6 @@ tr:hover td { background: #1c2128; } .port { color: #f78166; } .ip { color: #79c0ff; } .ts { color: #8b949e; font-size: 11px; } -.hex { color: #a5d6ff; font-size: 11px; - max-width: 240px; overflow: hidden; - text-overflow: ellipsis; white-space: nowrap; } .cc { color: #8b949e; font-size: 11px; } .badge { display: inline-block; background: #21262d; @@ -378,7 +375,7 @@ _HTML = """\

Recent connections {recent_count} shown

- + {conn_rows}
Timestamp (UTC)Source IPSrc portDst portBanner (hex)Bytes
Dst portBytes
@@ -500,12 +497,10 @@ async def _render_dashboard(stats: Stats, cfg: Config) -> str: f'{_ip_cell(e["src_ip"])}' f'{e["src_port"]}' f'{e["dst_port"]}' - f'' - f'{html.escape(e["banner_hex"][:48])}{"…" if len(e["banner_hex"]) > 48 else ""}' f'{e["banner_len"]}' '' for e in recent - ) if recent else _empty_row(6, 'no connections yet') + ) if recent else _empty_row(5, 'no connections yet') ) last = stats.last_connection @@ -662,8 +657,10 @@ async def _handle( ct = 'application/json' elif path == '/api/connections': - limit = min(int(qs.get('limit', ['50'])[0]), 500) - body = json.dumps(stats.recent_connections(limit)) + limit = min(int(qs.get('limit', ['100'])[0]), 500) + conns = [{k: v for k, v in e.items() if k != 'banner_hex'} + for e in stats.recent_connections(limit)] + body = json.dumps(conns) ct = 'application/json' elif path == '/api/banner':