Refactor Index.razor layout and add redirection logic

Simplified the `@page` directive by removing redundant entries.
Replaced the introductory section with a centered card layout
featuring a document icon, heading, description, and a
`DxLoadingPanel` with a spinner for redirection feedback.

Removed the "Helpful Resources" section with external links.
Added a new `@code` block to handle redirection logic using
`OnAfterRenderAsync`, which redirects to `/reportviewer` after
a 1200ms delay.
This commit is contained in:
2026-05-26 10:44:56 +02:00
parent e62cdc9d9d
commit 4d91b0a4fb

View File

@@ -1,18 +1,40 @@
@page "/"
@page "/"
@inject NavigationManager NavigationManager
<h2 class="pb-2">Blazor Components</h2>
<p class="pb-2 mw-1100">
Our Blazor UI components will help you create intuitive and highly-refined user experiences for both Blazor Server (ASP.NET Core) and Blazor WebAssembly hosting models.
</p>
<div class="pb-2 mw-1100">
<img class="fit-width" src="images/banner.png" />
<div class="d-flex justify-content-center align-items-center" style="min-height: 70vh;">
<div class="card shadow-sm border-0" style="max-width: 560px; width: 100%;">
<div class="card-body p-5 text-center">
<div class="rounded-circle bg-primary bg-opacity-10 d-inline-flex align-items-center justify-content-center mb-4" style="width: 72px; height: 72px;">
<span class="oi oi-document text-primary" aria-hidden="true" style="font-size: 2rem;"></span>
</div>
<h2 class="mb-3">Empfänger-UI</h2>
<p class="text-muted mb-4">
Sie werden zur Empfänger-UI weitergeleitet. Bitte warten Sie einen Moment.
</p>
<DxLoadingPanel Visible="true"
Text=""
IndicatorVisible="false"
IndicatorAreaVisible="false"
IsContentBlocked="false"
ApplyBackgroundShading="false">
<div class="d-flex flex-column align-items-center gap-3 py-3">
<div class="spinner-border text-primary" role="status" style="width: 2rem; height: 2rem;">
<span class="visually-hidden">Wird geladen...</span>
</div>
<div class="text-muted small">Weiterleitung wird vorbereitet...</div>
</div>
</DxLoadingPanel>
</div>
</div>
</div>
<h2 class="mb-4 mt-4">Helpful Resources</h2>
@code {
protected override async Task OnAfterRenderAsync(bool firstRender) {
if(!firstRender)
return;
<ul>
<li><a class="helplink" href="https://demos.devexpress.com/blazor/ReportViewer/" target="_blank">Online Demos</a></li>
<li><a class="helplink" href="https://github.com/DevExpress-Examples/Reporting-Blazor-Getting-Started" target="_blank">Examples</a></li>
<li><a class="helplink" href="https://docs.devexpress.com/XtraReports/401676/web-reporting/blazor-reporting" target="_blank">Documentation</a></li>
<li><a class="helplink" href="https://www.devexpress.com/support/training/blazor/" target="_blank">Free Blazor Training Course</a></li>
</ul>
await Task.Delay(1200);
NavigationManager.NavigateTo("/reportviewer");
}
}