Minor UI fixes

This commit is contained in:
Alexander Shabarshov 2025-11-03 14:50:49 +00:00
parent 2a7a24c9e7
commit e08cfa84bb
2 changed files with 21 additions and 10 deletions

View File

@ -382,6 +382,18 @@
return InvokeAsync(StateHasChanged); return InvokeAsync(StateHasChanged);
} }
private static IEnumerable<TreeNode<IndexTreeItem>> GetAllNodes(TreeNode<IndexTreeItem> node)
{
yield return node;
foreach (var child in node.Children)
{
foreach (var descendant in GetAllNodes(child))
{
yield return descendant;
}
}
}
private async Task OnDownload() private async Task OnDownload()
{ {
var newJob = new MigrationJob var newJob = new MigrationJob
@ -395,7 +407,7 @@
Upsert = false, Upsert = false,
ClearDestinationBefore = false, ClearDestinationBefore = false,
BatchSize = 1, BatchSize = 1,
Status = _currentNodes[0].Children Status = GetAllNodes(_currentNodes[0])
.Where(x => (x.Data?.IsSelected ?? false) && x.Data.Collection != null) .Where(x => (x.Data?.IsSelected ?? false) && x.Data.Collection != null)
.Select(x => new MigrationJob.CollectionJob .Select(x => new MigrationJob.CollectionJob
{ {
@ -403,7 +415,6 @@
DestinationCollection = x.Data!.Collection!.Name, DestinationCollection = x.Data!.Collection!.Name,
}) })
.ToList() .ToList()
}; };
if (newJob.Status.Count == 0) if (newJob.Status.Count == 0)

View File

@ -104,7 +104,7 @@
{ {
<div class="m-1">Sharded</div> <div class="m-1">Sharded</div>
} }
<div class="m-1 ">@NumbersUtils.ToHumanReadable(stat.TotalSize)</div> <div class="m-1 ">@NumbersUtils.ToHumanReadable(stat.Size)</div>
} }
</div> </div>
</OptionTemplate> </OptionTemplate>