Add a Strategie column to the catch list (searchable, filterable) and a Strategien tab to the Top 10 card. The MCP top tool accepts strategies. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
66 lines
1.3 KiB
C#
66 lines
1.3 KiB
C#
using Flypaper.Core.Models;
|
|
|
|
namespace Flypaper.Storage.Queries;
|
|
|
|
public sealed record CatchRecord(
|
|
long Id,
|
|
DateTime StartedAt,
|
|
DateTime EndedAt,
|
|
double DurationSeconds,
|
|
long BytesSent,
|
|
TrapOutcome Outcome,
|
|
string Strategy,
|
|
string Ip,
|
|
string? CountryCode,
|
|
string? Country,
|
|
string? City,
|
|
long? Asn,
|
|
string? Provider,
|
|
string? Target,
|
|
string? UserAgent);
|
|
|
|
public sealed record CatchFilter(
|
|
DateTime? Since = null,
|
|
DateTime? Until = null,
|
|
string? Country = null,
|
|
string? Provider = null,
|
|
string? Ip = null,
|
|
string? TargetContains = null,
|
|
int Limit = 50);
|
|
|
|
public sealed record CatchStats(
|
|
int Catches,
|
|
int Rejected,
|
|
int UniqueIps,
|
|
double TotalHoldSeconds,
|
|
double AverageHoldSeconds,
|
|
CatchRecord? Longest);
|
|
|
|
public enum TopDimension
|
|
{
|
|
Ips,
|
|
Countries,
|
|
Providers,
|
|
Targets,
|
|
Strategies,
|
|
UserAgents
|
|
}
|
|
|
|
public sealed record TopItem(string Key, string? Label, int Catches, double TotalHoldSeconds);
|
|
|
|
public sealed record IpProfile(
|
|
string Ip,
|
|
string? CountryCode,
|
|
string? Country,
|
|
string? City,
|
|
long? Asn,
|
|
string? Provider,
|
|
int Catches,
|
|
int Rejected,
|
|
double TotalHoldSeconds,
|
|
long TotalBytesSent,
|
|
DateTime? FirstSeen,
|
|
DateTime? LastSeen,
|
|
IReadOnlyList<CatchRecord> Events,
|
|
int EventsOmitted);
|