Default path to root

dashboard
Pat Hartl 2023-02-05 16:13:35 -06:00
parent d98e0e2ac9
commit d14a323f5b
1 changed files with 8 additions and 4 deletions

View File

@ -39,7 +39,7 @@
</MudGrid>
@code {
@code {
[Parameter] public Guid ArchiveId { get; set; }
[Parameter] public Guid Archive { get; set; }
[Parameter] public EventCallback<string> OnFileSelected { get; set; }
@ -48,20 +48,24 @@
private IEnumerable<ZipArchiveEntry> Entries { get; set; }
private IEnumerable<ZipArchiveEntry> CurrentPathEntries { get; set; }
private string CurrentPath { get; set; }
private ArchiveDirectory Root { get; set; }
private HashSet<ArchiveDirectory> Directories { get; set; }
private ArchiveDirectory SelectedDirectory { get; set; }
protected override async Task OnInitializedAsync()
{
Entries = await ArchiveService.GetContents(ArchiveId);
Directories = new HashSet<ArchiveDirectory>();
Root = new ArchiveDirectory()
var root = new ArchiveDirectory()
{
Name = "/",
FullName = ""
};
Root.PopulateChildren(Entries);
root.PopulateChildren(Entries);
Directories.Add(root);
SelectedDirectory = root;
}
private void ChangeDirectory(ArchiveDirectory selectedDirectory)