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("/");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#blazor-error-ui {
|
||||
color-scheme: light only;
|
||||
background: lightyellow;
|
||||
bottom: 0;
|
||||
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
|
||||
box-sizing: border-box;
|
||||
display: none;
|
||||
left: 0;
|
||||
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
#blazor-error-ui .dismiss {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 0.75rem;
|
||||
top: 0.5rem;
|
||||
}
|
||||
Reference in New Issue
Block a user