67 lines
1.9 KiB
Text
67 lines
1.9 KiB
Text
@using LANCommander.SDK.Models
|
|
@inherits FeedbackComponent<Data.Models.Game>
|
|
@inject SaveService SaveService
|
|
@inject SDK.Client Client
|
|
@inject IMessageService MessageService
|
|
|
|
<Table DataSource="Conflicts" Resizable Size="TableSize.Small" RowKey="c => c.FullName" @bind-SelectedRows="Selected" Loading="Loading">
|
|
<Selection Type="SelectionType.Checkbox" />
|
|
<PropertyColumn Property="c => c.FullName" Title="Name" />
|
|
<Column TData="string" Title="Created">
|
|
@context.LocalFileInfo?.CreationTime
|
|
</Column>
|
|
<Column TData="string" Title="Modified">
|
|
@context.LocalFileInfo?.LastWriteTime
|
|
</Column>
|
|
<Column TData="string" Title="Local Size">
|
|
@if (context.LocalFileInfo?.Length > 0)
|
|
{
|
|
<ByteSize Value="context.LocalFileInfo.Length" />
|
|
}
|
|
</Column>
|
|
<PropertyColumn Property="c => c.Length" Title="Original Size">
|
|
@if (context.Length > 0)
|
|
{
|
|
<ByteSize Value="context.Length" />
|
|
}
|
|
</PropertyColumn>
|
|
</Table>
|
|
|
|
@code {
|
|
IEnumerable<ArchiveValidationConflict> Conflicts = new List<ArchiveValidationConflict>();
|
|
IEnumerable<ArchiveValidationConflict> Selected = new List<ArchiveValidationConflict>();
|
|
|
|
bool Loading = true;
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
await LoadData();
|
|
}
|
|
|
|
async Task Close()
|
|
{
|
|
await CloseFeedbackAsync();
|
|
}
|
|
|
|
async Task LoadData()
|
|
{
|
|
Conflicts = await Client.Games.ValidateFilesAsync(Options.InstallDirectory, Options.Id);
|
|
|
|
Loading = false;
|
|
}
|
|
|
|
public override async Task OnFeedbackOkAsync(ModalClosingEventArgs args)
|
|
{
|
|
Loading = true;
|
|
StateHasChanged();
|
|
await Task.Yield();
|
|
|
|
await Client.Games.DownloadFilesAsync(Options.InstallDirectory, Options.Id, Selected.Select(e => e.FullName));
|
|
|
|
Loading = false;
|
|
StateHasChanged();
|
|
await Task.Yield();
|
|
|
|
await base.CloseFeedbackAsync();
|
|
}
|
|
}
|