feat: implement core radius service and database schema for guest access management
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
@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 {
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
AuthService.OnAuthStateChanged += StateHasChanged;
|
||||
await AuthService.InitializeAsync();
|
||||
}
|
||||
|
||||
private async Task LogoutAdmin()
|
||||
{
|
||||
await AuthService.LogoutAsync();
|
||||
NavManager.NavigateTo("/");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user