@page "/" @rendermode InteractiveServer @inject IRadiusService RadiusService @inject IJSRuntime JS

Guest Wi-Fi Access

Enter your name to generate your instant high-speed network credentials

@if (config != null) {
Session Limit: @config.DefaultSessionTimeMinutes mins
Data Cap: @config.DefaultDataLimitMb MB
}
@if (!string.IsNullOrEmpty(errorMessage)) {
@errorMessage
}
@if (result != null) {

Access Granted!

Ready to Connect

Connect to the Guest-WiFi network on your device and enter the credentials below:

Username
@result.Username
Password
@result.Password
Session: @result.SessionTimeMinutes Mins
Data Cap: @result.DataLimitMb MB
@if (!string.IsNullOrEmpty(copyNotification)) {
@copyNotification
}
}
@code { private string guestName = string.Empty; private bool isSubmitting = false; private string errorMessage = string.Empty; private RegistrationResultDto? result; private SystemConfigDto? config; private string copyNotification = string.Empty; protected override async Task OnInitializedAsync() { try { config = await RadiusService.GetSystemConfigAsync(); } catch (Exception ex) { errorMessage = "Database connection offline or initializing: " + ex.Message; } } private async Task HandleRegistration() { if (string.IsNullOrWhiteSpace(guestName)) return; isSubmitting = true; errorMessage = string.Empty; copyNotification = string.Empty; try { result = await RadiusService.RegisterGuestAsync(guestName); } catch (Exception ex) { errorMessage = "Failed to create credentials: " + ex.Message; } finally { isSubmitting = false; } } private async Task CopyToClipboard(string text, string label) { try { await JS.InvokeVoidAsync("navigator.clipboard.writeText", text); copyNotification = $"{label} copied to clipboard!"; StateHasChanged(); await Task.Delay(2500); copyNotification = string.Empty; StateHasChanged(); } catch { copyNotification = $"Failed to copy {label} automatically."; } } }