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

View File

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

View File

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