Group strategies by base type and rank them by median hold time
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d2cbab5d4b
commit
cbd9830143
12 files changed
+301
-35
No files matched your search
@@ -81,7 +81,7 @@
|
||||
@foreach (var tab in tabs)
|
||||
{
|
||||
<div role="tabpanel" id="panel-@tab.Id" aria-labelledby="tab-@tab.Id" tabindex="0" hidden="@(tab != tabs[0])">
|
||||
<TopTable KeyLabel="@tab.KeyLabel" Entries="tab.Entries" ShowFlags="tab.ShowFlags" KeyFormatter="tab.KeyFormatter" LabelFormatter="tab.LabelFormatter" TitleFormatter="tab.TitleFormatter"
|
||||
<TopTable KeyLabel="@tab.KeyLabel" Entries="tab.Entries" ShowFlags="tab.ShowFlags" KeyFormatter="tab.KeyFormatter" LabelFormatter="tab.LabelFormatter" TitleFormatter="tab.TitleFormatter" BadgesFormatter="tab.BadgesFormatter"
|
||||
Href="entry => TopFilter(tab, entry).Href()" IsActive="entry => tab.Current(_filter) == entry.Key" />
|
||||
</div>
|
||||
}
|
||||
@@ -199,6 +199,10 @@
|
||||
<div class="extra extra-md">User-Agent: @(trapEvent.ClientInfo ?? "–")</div>
|
||||
<div class="extra extra-all strategy-info">
|
||||
<strong>@strategy.DisplayName</strong>
|
||||
@foreach (var badge in strategy.Badges)
|
||||
{
|
||||
<span class="badge">@badge</span>
|
||||
}
|
||||
@if (strategy.Explanation is not null)
|
||||
{
|
||||
<div>@strategy.Explanation</div>
|
||||
@@ -213,7 +217,7 @@
|
||||
<div class="extra extra-sm">Dauer: @duration · Bytes: @bytes</div>
|
||||
<div class="extra extra-xs">Datum: @started.ToString("dd.MM.yyyy") · Ausgang: @OutcomeLabel(trapEvent.Outcome)</div>
|
||||
</td>
|
||||
<td class="c-strategy" title="@strategy.Tooltip">@strategy.DisplayName</td>
|
||||
<td class="c-strategy" title="@strategy.Tooltip">@strategy.DisplayName@foreach (var badge in strategy.Badges){<span class="badge">@badge</span>}</td>
|
||||
<td class="c-agent" title="@trapEvent.ClientInfo">@trapEvent.ClientInfo</td>
|
||||
<td class="c-duration num">@duration</td>
|
||||
<td class="c-bytes num">@bytes</td>
|
||||
@@ -282,7 +286,7 @@
|
||||
new("providers", "Provider", "Provider", data.TopProviders, f => f.Provider, (f, key) => f with { Provider = key }),
|
||||
new("ips", "IPs", "IP", data.TopIps, f => f.Ip, (f, key) => f with { Ip = key }),
|
||||
new("targets", "Ziele", "Ziel", data.TopTargets, f => f.Ziel, (f, key) => f with { Ziel = key }, KeyFormatter: Formatting.Target),
|
||||
new("strategies", "Strategien", "Strategie", data.TopStrategies, f => f.Strategie, (f, key) => f with { Strategie = key }, KeyFormatter: StrategyNames.Summary, LabelFormatter: (key, _) => StrategyNames.Display(key), TitleFormatter: key => StrategyNames.Describe(key).Tooltip)
|
||||
new("strategies", "Strategien", "Strategie", StrategyNames.Rank(data.StrategyCatches, 10), f => f.Strategie, (f, key) => f with { Strategie = key }, KeyFormatter: _ => "", LabelFormatter: (key, _) => StrategyNames.Display(key), TitleFormatter: key => StrategyNames.Describe(key).Tooltip, BadgesFormatter: key => StrategyNames.Describe(key).Badges)
|
||||
];
|
||||
|
||||
private DashboardFilter TopFilter(TopTab tab, TopEntry entry) =>
|
||||
@@ -326,7 +330,8 @@
|
||||
|
||||
if (_filter.Strategie is { } strategie)
|
||||
{
|
||||
yield return ($"Strategie: {StrategyNames.Display(strategie)}", reset with { Strategie = null });
|
||||
var badges = StrategyNames.Describe(strategie).Badges;
|
||||
yield return ($"Strategie: {StrategyNames.Display(strategie)}{(badges.Count == 0 ? "" : $" ({string.Join(", ", badges)})")}", reset with { Strategie = null });
|
||||
}
|
||||
|
||||
if (_filter.Q is { } q)
|
||||
@@ -357,5 +362,6 @@
|
||||
bool ShowFlags = false,
|
||||
Func<string?, string?>? KeyFormatter = null,
|
||||
Func<string?, string?, string?>? LabelFormatter = null,
|
||||
Func<string?, string?>? TitleFormatter = null);
|
||||
Func<string?, string?>? TitleFormatter = null,
|
||||
Func<string?, IReadOnlyList<string>>? BadgesFormatter = null);
|
||||
}
|
||||
Reference in new issue
Block a user