Count9 #7
@@ -3,6 +3,7 @@
|
|||||||
@inject IRadiusService RadiusService
|
@inject IRadiusService RadiusService
|
||||||
@inject AdminAuthService AuthService
|
@inject AdminAuthService AuthService
|
||||||
@inject NavigationManager NavManager
|
@inject NavigationManager NavManager
|
||||||
|
@implements IDisposable
|
||||||
|
|
||||||
<div style="max-width: 1280px; margin: 0 auto;">
|
<div style="max-width: 1280px; margin: 0 auto;">
|
||||||
@if (!AuthService.IsAuthenticated)
|
@if (!AuthService.IsAuthenticated)
|
||||||
@@ -406,6 +407,7 @@
|
|||||||
private string activeTab = "users";
|
private string activeTab = "users";
|
||||||
private string searchQuery = string.Empty;
|
private string searchQuery = string.Empty;
|
||||||
private string? notificationMessage;
|
private string? notificationMessage;
|
||||||
|
private System.Threading.Timer? autoRefreshTimer;
|
||||||
|
|
||||||
private SystemConfigDto? config;
|
private SystemConfigDto? config;
|
||||||
private List<UserUsageDto> users = new();
|
private List<UserUsageDto> users = new();
|
||||||
@@ -434,9 +436,26 @@
|
|||||||
|
|
||||||
await LoadDataAsync();
|
await LoadDataAsync();
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
|
|
||||||
|
autoRefreshTimer = new System.Threading.Timer(async _ =>
|
||||||
|
{
|
||||||
|
await InvokeAsync(async () =>
|
||||||
|
{
|
||||||
|
if (AuthService.IsAuthenticated)
|
||||||
|
{
|
||||||
|
await LoadDataAsync();
|
||||||
|
StateHasChanged();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, null, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(10));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
autoRefreshTimer?.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
private async Task LogoutAdmin()
|
private async Task LogoutAdmin()
|
||||||
{
|
{
|
||||||
await AuthService.LogoutAsync();
|
await AuthService.LogoutAsync();
|
||||||
|
|||||||
Reference in New Issue
Block a user