Add IP origin enrichment with DB-IP and world map
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
536aee1f31
commit
3671019e60
47 files changed
+1389
-12
No files matched your search
@@ -0,0 +1,20 @@
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Flypaper.Web.Components.Pages.Dashboard;
|
||||
|
||||
internal sealed record WorldMapData(double Width, double Height, IReadOnlyList<WorldMapCountry> Countries)
|
||||
{
|
||||
private static readonly JsonSerializerOptions JsonOptions = new(JsonSerializerDefaults.Web);
|
||||
|
||||
public static WorldMapData Instance { get; } = Load();
|
||||
|
||||
private static WorldMapData Load()
|
||||
{
|
||||
using var stream = typeof(WorldMapData).Assembly.GetManifestResourceStream("Flypaper.Web.world-map.json")
|
||||
?? throw new InvalidOperationException("Embedded world map is missing.");
|
||||
return JsonSerializer.Deserialize<WorldMapData>(stream, JsonOptions)
|
||||
?? throw new InvalidOperationException("Embedded world map is empty.");
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed record WorldMapCountry(string? Code, string Name, string Path);
|
||||
Reference in new issue
Block a user