Split pane archive browser

dashboard
Pat Hartl 2023-02-07 01:34:20 -06:00
parent c3b4c6dea2
commit a0145a83dc
3 changed files with 38 additions and 37 deletions

View File

@ -3,17 +3,14 @@
@using System.IO.Compression;
@inject ArchiveService ArchiveService;
<MudGrid>
<MudItem xs="4">
<MudTreeView Items="Root.Children" Hover="true" @bind-SelectedValue="SelectedDirectory" T="ArchiveDirectory">
<MudStack Row="true" Style="max-height: 100%">
<MudTreeView Items="Directories" Hover="true" @bind-SelectedValue="SelectedDirectory" T="ArchiveDirectory" Style="min-width: 18%">
<ItemTemplate>
<MudTreeViewItem Value="@context" Items="@context.Children" Text="@context.Name" T="ArchiveDirectory" OnClick="() => ChangeDirectory(context)"></MudTreeViewItem>
</ItemTemplate>
</MudTreeView>
</MudItem>
<MudItem xs="8">
<MudTable Items="@CurrentPathEntries" Hover="true">
<MudTable Items="@CurrentPathEntries" Hover="true" Class="flex-grow-1" FixedHeader="true" Elevation="0" Height="calc(100vh - 64px)">
<HeaderContent>
<MudTh></MudTh>
<MudTh>Name</MudTh>
@ -35,9 +32,7 @@
}
</RowTemplate>
</MudTable>
</MudItem>
</MudGrid>
</MudStack>
@code {
[Parameter] public Guid ArchiveId { get; set; }
@ -73,6 +68,9 @@
if (SelectedDirectory == null)
SelectedDirectory = selectedDirectory;
if (SelectedDirectory.FullName == "")
CurrentPathEntries = Entries.Where(e => !e.FullName.TrimEnd('/').Contains('/'));
else
CurrentPathEntries = Entries.Where(e => e.FullName.StartsWith(SelectedDirectory.FullName) && e.FullName != SelectedDirectory.FullName);
}

View File

@ -6,9 +6,7 @@
</TitleContent>
<DialogContent>
<MudContainer Style="overflow-y: scroll">
<ArchiveBrowser ArchiveId="ArchiveId" OnFileSelected="FileSelected" />
</MudContainer>
</DialogContent>
<DialogActions>

View File

@ -2,3 +2,8 @@
.mud-table-cell .mud-input-control {
margin-top: 0;
}
.mud-dialog-fullscreen .mud-dialog-title + div > div,
.mud-dialog-fullscreen .mud-dialog-content {
max-height: calc(100vh - 64px);
}