removing hex banner

This commit is contained in:
2026-03-10 18:54:29 -04:00
parent 02800ef496
commit 2f753f0446

View File

@@ -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 = """\
<h2>Recent connections <span class="badge">{recent_count} shown</span></h2>
<table>
<tr><th>Timestamp (UTC)</th><th>Source IP</th><th>Src&nbsp;port</th>
<th>Dst&nbsp;port</th><th>Banner (hex)</th><th>Bytes</th></tr>
<th>Dst&nbsp;port</th><th>Bytes</th></tr>
{conn_rows}
</table>
</div>
@@ -500,12 +497,10 @@ async def _render_dashboard(stats: Stats, cfg: Config) -> str:
f'<td>{_ip_cell(e["src_ip"])}</td>'
f'<td>{e["src_port"]}</td>'
f'<td class="port">{e["dst_port"]}</td>'
f'<td class="hex" title="{html.escape(e["banner_hex"])}">'
f'{html.escape(e["banner_hex"][:48])}{"" if len(e["banner_hex"]) > 48 else ""}</td>'
f'<td>{e["banner_len"]}</td>'
'</tr>'
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':