Huge updates
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
@page "/changelog"
|
||||
@rendermode InteractiveWebAssembly
|
||||
@attribute [AllowAnonymous]
|
||||
@inject IJSRuntime JSRuntime
|
||||
|
||||
<PageTitle>Changelog – Timetracker</PageTitle>
|
||||
|
||||
@@ -18,7 +19,7 @@
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
|
||||
@foreach (var release in _releases)
|
||||
@foreach (var release in Releases)
|
||||
{
|
||||
<MudCard Elevation="2" Class="rounded-xl">
|
||||
<MudCardContent>
|
||||
@@ -55,19 +56,17 @@
|
||||
</MudStack>
|
||||
|
||||
@code {
|
||||
private record ChangeEntry(string Tag, string Text);
|
||||
private record Release(string Version, string Date, bool IsLatest, List<ChangeEntry> Entries);
|
||||
public record ChangeEntry(string Tag, string Text);
|
||||
public record Release(string Version, string Date, bool IsLatest, List<ChangeEntry> Entries, bool Highlighted = false);
|
||||
|
||||
private static Color GetTagColor(string tag) => tag switch
|
||||
{
|
||||
"Neu" => Color.Success,
|
||||
"Fix" => Color.Error,
|
||||
"Upgrade" => Color.Info,
|
||||
_ => Color.Default
|
||||
};
|
||||
|
||||
private readonly List<Release> _releases =
|
||||
public static readonly List<Release> Releases =
|
||||
[
|
||||
new("1.5", "25.06.2026", true,
|
||||
[
|
||||
new("Neu", "Userprofil angelegt"),
|
||||
new("Upgrade", "Früheste Gehenszeit wird angezeigt"),
|
||||
new("Upgrade", "Pausen werden dynamisch berechnet"),
|
||||
], Highlighted = true),
|
||||
new("1.4", "08.06.2026", true,
|
||||
[
|
||||
new("Neu", "Timebot implementiert"),
|
||||
@@ -108,4 +107,30 @@
|
||||
new("Neu", "Registrierung und Login"),
|
||||
]),
|
||||
];
|
||||
|
||||
public static string LatestVersion => Releases.FirstOrDefault()?.Version ?? "";
|
||||
public static bool IsLatestHighlighted => Releases.FirstOrDefault()?.Highlighted ?? false;
|
||||
|
||||
private static Color GetTagColor(string tag) => tag switch
|
||||
{
|
||||
"Neu" => Color.Success,
|
||||
"Fix" => Color.Error,
|
||||
"Upgrade" => Color.Info,
|
||||
_ => Color.Default
|
||||
};
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
try
|
||||
{
|
||||
await JSRuntime.InvokeVoidAsync("localStorage.setItem", "lastSeenVersion", LatestVersion);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignored in SSR
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user