Clean up import dialog
This commit is contained in:
parent
272195f032
commit
ea3cfc35ef
1 changed files with 38 additions and 18 deletions
|
|
@ -56,26 +56,44 @@ else if (_stage == ImportStage.RecordSelection)
|
|||
@bind-CheckedKeys="_selectedKeys">
|
||||
@foreach (var group in ImportItems.GroupBy(i => i.Type))
|
||||
{
|
||||
var size = group.Sum(i => i.Size);
|
||||
|
||||
<TreeNode Title="@($"{group.Key} ({group.Count()})")">
|
||||
@foreach (var item in group)
|
||||
{
|
||||
<TreeNode Key="@item.Id.ToString()">
|
||||
<TitleTemplate>
|
||||
<GridRow>
|
||||
<GridCol Flex=@("auto")>
|
||||
@item.Name
|
||||
</GridCol>
|
||||
|
||||
@if (item.Size > 0)
|
||||
{
|
||||
<GridCol Flex=@("none")>
|
||||
<ByteSize Value="@item.Size" />
|
||||
<TitleTemplate>
|
||||
<GridRow>
|
||||
<GridCol Flex=@("auto")>
|
||||
@group.Key.GetDisplayName() (@group.Count())
|
||||
</GridCol>
|
||||
|
||||
@if (size > 0)
|
||||
{
|
||||
<GridCol Flex=@("none")>
|
||||
<ByteSize Value="@size" />
|
||||
</GridCol>
|
||||
}
|
||||
</GridRow>
|
||||
</TitleTemplate>
|
||||
<ChildContent>
|
||||
@foreach (var item in group)
|
||||
{
|
||||
<TreeNode Key="@item.Id.ToString()">
|
||||
<TitleTemplate>
|
||||
<GridRow>
|
||||
<GridCol Flex=@("auto")>
|
||||
@item.Name
|
||||
</GridCol>
|
||||
}
|
||||
</GridRow>
|
||||
</TitleTemplate>
|
||||
</TreeNode>
|
||||
}
|
||||
|
||||
@if (item.Size > 0)
|
||||
{
|
||||
<GridCol Flex=@("none")>
|
||||
<ByteSize Value="@item.Size"/>
|
||||
</GridCol>
|
||||
}
|
||||
</GridRow>
|
||||
</TitleTemplate>
|
||||
</TreeNode>
|
||||
}
|
||||
</ChildContent>
|
||||
</TreeNode>
|
||||
}
|
||||
</Tree>
|
||||
|
|
@ -259,6 +277,8 @@ else if (_stage == ImportStage.Importing)
|
|||
{
|
||||
ImportItems = await ImportContext.InitializeImportAsync(path);
|
||||
|
||||
_selectedKeys = ImportItems.Select(i => i.Id.ToString()).ToArray();
|
||||
|
||||
_stage = ImportStage.RecordSelection;
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue