2026-05-28 19:54:33 -05:00
|
|
|
@page "/Files"
|
|
|
|
|
@using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage
|
2024-10-16 02:06:02 -05:00
|
|
|
@attribute [Authorize(Roles = RoleService.AdministratorRoleName)]
|
2026-05-28 19:54:33 -05:00
|
|
|
@inject ProtectedLocalStorage BrowserStorage
|
2023-09-09 17:36:20 -05:00
|
|
|
|
2026-05-28 19:54:33 -05:00
|
|
|
<FileManager WorkingDirectory="@RootPath" ColumnVisibility="ColumnVisibility" ColumnVisibilityChanged="OnColumnVisibilityChanged" />
|
2023-09-09 17:36:20 -05:00
|
|
|
|
|
|
|
|
@code {
|
2023-09-11 19:33:07 -05:00
|
|
|
string RootPath = Path.GetPathRoot(Directory.GetCurrentDirectory());
|
2026-05-28 19:54:33 -05:00
|
|
|
Dictionary<string, bool> ColumnVisibility;
|
|
|
|
|
|
|
|
|
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
|
|
|
{
|
|
|
|
|
if (firstRender)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var stored = await BrowserStorage.GetAsync<Dictionary<string, bool>>("FileManager.ColumnVisibility");
|
|
|
|
|
|
|
|
|
|
if (stored.Success && stored.Value != null)
|
|
|
|
|
{
|
|
|
|
|
ColumnVisibility = stored.Value;
|
|
|
|
|
StateHasChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
ColumnVisibility = new Dictionary<string, bool>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async Task OnColumnVisibilityChanged(Dictionary<string, bool> visibility)
|
|
|
|
|
{
|
|
|
|
|
ColumnVisibility = visibility;
|
|
|
|
|
await BrowserStorage.SetAsync("FileManager.ColumnVisibility", visibility);
|
|
|
|
|
}
|
2023-09-09 17:36:20 -05:00
|
|
|
}
|