@using System.Globalization
@using Flypaper.Storage.Dashboard
@if (Entries.Count == 0)
{
Noch keine Einträge.
}
else
{
| @KeyLabel |
Anteil |
Fänge |
Haltezeit |
@foreach (var entry in Entries)
{
var key = KeyFormatter?.Invoke(entry.Key) ?? entry.Key;
var label = LabelFormatter is null ? entry.Label : LabelFormatter(entry.Key, entry.Label);
var share = (entry.Count * 100.0 / Entries[0].Count).ToString("0.#", CultureInfo.InvariantCulture);
var active = IsActive(entry);
var title = TitleFormatter?.Invoke(entry.Key) ?? (label is null ? key : $"{label} · {key}");
|
@if (ShowFlags)
{
@Formatting.Flag(entry.Key)
}
@if (label is not null)
{
@label
@if (key.Length > 0)
{
@key
}
}
else
{
@key
}
|
|
@Formatting.Number(entry.Count) |
@Formatting.Duration(entry.HoldTime) |
}
}
@code {
[Parameter, EditorRequired] public required string KeyLabel { get; set; }
[Parameter, EditorRequired] public required IReadOnlyList Entries { get; set; }
[Parameter] public bool ShowFlags { get; set; }
[Parameter] public Func? KeyFormatter { get; set; }
[Parameter] public Func? LabelFormatter { get; set; }
[Parameter] public Func? TitleFormatter { get; set; }
[Parameter, EditorRequired] public required Func Href { get; set; }
[Parameter, EditorRequired] public required Func IsActive { get; set; }
}