2026-07-23 11:12:10 +02:00
|
|
|
@inherits LayoutComponentBase
|
|
|
|
|
@inject AdminAuthService AuthService
|
|
|
|
|
@inject NavigationManager NavManager
|
|
|
|
|
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<header class="app-header">
|
|
|
|
|
<a href="/" class="brand-logo">
|
|
|
|
|
<div class="brand-icon">
|
|
|
|
|
<i class="bi bi-wifi"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<span>Guest Radius</span>
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
<nav class="nav-links">
|
|
|
|
|
<NavLink href="" Match="NavLinkMatch.All" class="nav-item">
|
|
|
|
|
<i class="bi bi-qr-code-scan"></i> Guest Registration
|
|
|
|
|
</NavLink>
|
|
|
|
|
|
|
|
|
|
<NavLink href="admin" class="nav-item admin-btn">
|
|
|
|
|
<i class="bi bi-shield-lock"></i> Admin Panel
|
|
|
|
|
</NavLink>
|
|
|
|
|
|
|
|
|
|
@if (AuthService.IsAuthenticated)
|
|
|
|
|
{
|
|
|
|
|
<button class="nav-item btn-secondary" style="border:none; cursor:pointer;" @onclick="LogoutAdmin">
|
|
|
|
|
<i class="bi bi-box-arrow-right"></i> Logout (@AuthService.CurrentAdminUsername)
|
|
|
|
|
</button>
|
|
|
|
|
}
|
|
|
|
|
</nav>
|
|
|
|
|
</header>
|
|
|
|
|
|
|
|
|
|
<main class="main-content">
|
|
|
|
|
@Body
|
|
|
|
|
</main>
|
|
|
|
|
|
|
|
|
|
<footer class="app-footer">
|
|
|
|
|
RADIUS Guest Portal & Database Manager • Powered by FreeRADIUS & PostgreSQL • © @DateTime.UtcNow.Year
|
|
|
|
|
</footer>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="blazor-error-ui" data-nosnippet style="display:none;">
|
|
|
|
|
An unhandled error has occurred.
|
|
|
|
|
<a href="." class="reload">Reload</a>
|
|
|
|
|
<span class="dismiss">🗙</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@code {
|
2026-07-24 12:09:46 +02:00
|
|
|
protected override void OnInitialized()
|
2026-07-23 11:12:10 +02:00
|
|
|
{
|
|
|
|
|
AuthService.OnAuthStateChanged += StateHasChanged;
|
2026-07-24 12:09:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
|
|
|
{
|
|
|
|
|
if (firstRender)
|
|
|
|
|
{
|
|
|
|
|
await AuthService.InitializeAsync();
|
|
|
|
|
StateHasChanged();
|
|
|
|
|
}
|
2026-07-23 11:12:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async Task LogoutAdmin()
|
|
|
|
|
{
|
|
|
|
|
await AuthService.LogoutAsync();
|
|
|
|
|
NavManager.NavigateTo("/");
|
|
|
|
|
}
|
|
|
|
|
}
|