Add IP origin enrichment with DB-IP and world map
Build and deploy / build (push) Successful in 1m46s
Build and deploy / deploy (push) Successful in 22s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
TomandClaude Opus 5.5 committed 2026-11-14 15:44:33 +01:00
1 parent 536aee1f31
commit 3671019e60
47 files changed
+1389 -12

No files matched your search

@@ -1,6 +1,7 @@
@page "/"
@using Flypaper.Core.Abstractions
@using Flypaper.Storage.Dashboard
@using Flypaper.Storage.Entities
@inject DashboardQueries Queries
@inject IConnectionGovernor Governor
@@ -25,7 +26,11 @@
<div class="metric"><span class="label">Abgelehnt</span><span class="value">@data.Rejected.ToString("N0")</span></div>
</section>
<WorldMap CatchesByCountry="data.CatchesByCountry" />
<section class="tops">
<TopTable Title="Top 10 Länder" KeyLabel="Land" Entries="data.TopCountries" ShowFlags="true" />
<TopTable Title="Top 10 Provider (ASN)" KeyLabel="Provider" Entries="data.TopProviders" />
<TopTable Title="Top 10 IPs" KeyLabel="IP" Entries="data.TopIps" />
<TopTable Title="Top 10 Ziele" KeyLabel="Ziel" Entries="data.TopTargets" />
</section>
@@ -44,6 +49,8 @@
<tr>
<th>Zeit</th>
<th>IP</th>
<th>Herkunft</th>
<th>Provider</th>
<th>Ziel</th>
<th>User-Agent</th>
<th class="num">Dauer</th>
@@ -57,6 +64,18 @@
<tr data-expand="event:@trapEvent.Id" tabindex="0" aria-expanded="false">
<td class="nowrap">@trapEvent.StartedAt.ToLocalTime().ToString("dd.MM. HH:mm:ss")</td>
<td class="mono">@trapEvent.RemoteIp</td>
<td class="nowrap" title="@Origin(trapEvent)">
@if (trapEvent.CountryCode is { } countryCode)
{
@($"{Formatting.Flag(countryCode)} {countryCode}")
<span class="detail">@Origin(trapEvent)</span>
}
else
{
<span class="muted">–</span>
}
</td>
<td class="clip" title="@Formatting.Provider(trapEvent.Asn, trapEvent.Provider)">@Formatting.Provider(trapEvent.Asn, trapEvent.Provider)</td>
<td class="mono clip" title="@trapEvent.Target">@trapEvent.Target</td>
<td class="clip" title="@trapEvent.ClientInfo">@trapEvent.ClientInfo</td>
<td class="num">@Formatting.Duration(TimeSpan.FromMilliseconds(trapEvent.DurationMs))</td>
@@ -82,4 +101,7 @@
_data = await Queries.GetAsync();
_loadedAt = DateTime.Now;
}
private static string Origin(TrapEventEntity trapEvent) =>
string.Join(", ", new[] { trapEvent.City, trapEvent.Country }.Where(part => !string.IsNullOrEmpty(part)));
}