feat(offline): bundle local assets and add safe UI error recovery (U16)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<td data-label="Nummer">@Entry.DisplayId</td>
|
||||
<td data-label="Datum">@Entry.Date.ToString("dd.MM.yyyy")</td>
|
||||
<td data-label="Beschreibung" class="entry-description">
|
||||
@Entry.Title
|
||||
<span class="entry-title">@Entry.Title</span>
|
||||
@if (Entry.IsDeleted)
|
||||
{
|
||||
<p class="deleted-status">Gelöscht – zählt nicht zum Kontostand</p>
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
@inherits ErrorBoundary
|
||||
@inject IJSRuntime JS
|
||||
@inject ToastService Toasts
|
||||
|
||||
@if (CurrentException == null)
|
||||
{
|
||||
@ChildContent
|
||||
}
|
||||
else
|
||||
{
|
||||
<section class="error-recovery" role="alert">
|
||||
<h1>Diese Ansicht konnte nicht angezeigt werden</h1>
|
||||
<p>Ein unerwarteter Fehler ist aufgetreten. Eine Speicherung ist dadurch nicht bestätigt. Bitte vor einer erneuten Buchung zuerst die Liste prüfen.</p>
|
||||
<p>Ungespeicherte Eingaben dieser Ansicht können verloren sein. Bei erwartbaren Speicherfehlern im Formular bleiben sie erhalten.</p>
|
||||
<button type="button" class="btn btn-primary" @onclick="Recover">Ansicht erneut versuchen</button>
|
||||
<a class="btn btn-outline-secondary" href="/">Zur Kontenübersicht</a>
|
||||
<details><summary>Technische Angaben zur Fehlermeldung</summary>
|
||||
<p>@diagnostic</p><button type="button" class="btn btn-outline-secondary" @onclick="Copy">Angaben kopieren</button>
|
||||
</details>
|
||||
</section>
|
||||
}
|
||||
|
||||
@code {
|
||||
private string diagnostic = string.Empty;
|
||||
protected override Task OnErrorAsync(Exception exception)
|
||||
{
|
||||
diagnostic = $"Dümpelkas; Fehlerreferenz {Guid.NewGuid():N}; Typ {exception.GetType().Name}";
|
||||
// Deliberately exclude exception messages/stack traces that may contain booking data.
|
||||
System.Diagnostics.Trace.TraceError(diagnostic);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
private async Task Copy()
|
||||
{
|
||||
try { await JS.InvokeVoidAsync("navigator.clipboard.writeText", diagnostic); Toasts.Show("Technische Angaben kopiert.", ToastKind.Success); }
|
||||
catch (JSException) { Toasts.Show("Kopieren ist nicht möglich. Bitte die technischen Angaben markieren und manuell kopieren.", ToastKind.Error); }
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
<p>Anfangsbestand + Einnahmen − Ausgaben = Kontostand</p>
|
||||
<p>Dies ist eine spätere Korrektur, keine zusätzliche Einnahme oder Ausgabe.</p>
|
||||
<label for="carryover">@(Year.HasValue ? "Neuer Übertrag (€)" : "Neuer Anfangsbestand (€)")</label>
|
||||
<AmountInput Id="carryover" Value="amountText" ValueChanged="ChangeAmount" AllowNegative="true" Disabled="saving" />
|
||||
<AmountInput Id="carryover" Value="@amountText" ValueChanged="ChangeAmount" AllowNegative="true" Disabled="saving" />
|
||||
<div class="correction-preview">
|
||||
<p>Gewählter Bestand: @Money(CurrentAmount) → @Money(amount)</p>
|
||||
<p>Gemeinsamer Anfangsbestand: @Money(InitialBalance) → @Money(InitialBalance + Delta)</p>
|
||||
|
||||
@@ -55,7 +55,11 @@
|
||||
focusPrompt = true;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
else if (discardPrompt) await ContinueEditing();
|
||||
else if (discardPrompt)
|
||||
{
|
||||
await ContinueEditing();
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
else await OnCancel.InvokeAsync();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@inject NavigationManager Navigation
|
||||
@inherits LayoutComponentBase
|
||||
@inject IJSRuntime JS
|
||||
|
||||
@@ -19,11 +20,11 @@
|
||||
</nav>
|
||||
|
||||
<main class="flex-grow-1 overflow-auto p-3">
|
||||
@Body
|
||||
<AppErrorBoundary @key="Navigation.Uri">@Body</AppErrorBoundary>
|
||||
</main>
|
||||
|
||||
<footer class="app-footer d-flex align-items-center justify-content-center gap-2">
|
||||
<span>Dümpelkas © @DateTime.Now.Year · Version @AppVersion</span> ·<a class="app-footer-about" @onclick="OpenAboutDialog">Über</a>
|
||||
<span>Dümpelkas © @DateTime.Now.Year · Version @AppVersion</span> ·<button type="button" class="app-footer-about btn btn-link" @onclick="OpenAboutDialog">Über</button>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
</Found>
|
||||
<NotFound>
|
||||
<LayoutView Layout="@typeof(MainLayout)">
|
||||
<p>Seite nicht gefunden.</p>
|
||||
<h1>Diese Seite wurde nicht gefunden</h1>
|
||||
<a class="btn btn-primary" href="/">Zur Kontenübersicht</a>
|
||||
</LayoutView>
|
||||
</NotFound>
|
||||
</Router>
|
||||
|
||||
Reference in New Issue
Block a user