Aggiunta pagina ForceReset
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
@page "/ForceReset"
|
||||
<h3>Force Reset All Data...</h3>
|
||||
|
||||
@if (isResetting)
|
||||
{
|
||||
<LoadingData DisplaySize="LoadingData.CtrlSize.Large" DisplayMode="LoadingData.SpinMode.Growl"></LoadingData>
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using SMGen.Data.Services;
|
||||
using StackExchange.Redis;
|
||||
|
||||
namespace SMGen.Pages
|
||||
{
|
||||
public partial class ForceReset
|
||||
{
|
||||
[Inject]
|
||||
protected SMGDataService SMGDService { get; set; } = null!;
|
||||
[Inject]
|
||||
protected NavigationManager NavMan { get; set; } = null!;
|
||||
|
||||
//protected override Task OnParametersSetAsync()
|
||||
//{
|
||||
// return base.OnParametersSetAsync();
|
||||
//}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
isResetting = true;
|
||||
RedisValue currKey = new RedisValue($"{Core.Constants.redisBaseAddr}:*");
|
||||
await SMGDService.ExecFlushRedisPattern(currKey);
|
||||
await Task.Delay(500);
|
||||
isResetting = false;
|
||||
NavMan.NavigateTo("/", true);
|
||||
}
|
||||
|
||||
private bool isResetting = false;
|
||||
}
|
||||
}
|
||||
@@ -35,10 +35,15 @@
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link p-2" href="FilesFIx">
|
||||
<NavLink class="nav-link p-2" href="FilesFix">
|
||||
<span class="oi oi-file" aria-hidden="true"></span> Fix files
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link p-2" href="ForceReset">
|
||||
<span class="oi oi-reload" aria-hidden="true"></span> Reset All
|
||||
</NavLink>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user