Some checks failed
Publish SDK NuGet Package / publish (push) Failing after 1m42s
LANCommander Release / prep (push) Has been cancelled
LANCommander Release / build_server_win-x64 (push) Has been cancelled
LANCommander Release / build_launcher_linux-arm64 (push) Has been cancelled
LANCommander Release / build_launcher_linux-x64 (push) Has been cancelled
LANCommander Release / build_launcher_osx-arm64 (push) Has been cancelled
LANCommander Release / build_launcher_osx-x64 (push) Has been cancelled
LANCommander Release / build_launcher_win-arm64 (push) Has been cancelled
LANCommander Release / build_launcher_win-x64 (push) Has been cancelled
LANCommander Release / build_server_linux-arm64 (push) Has been cancelled
LANCommander Release / build_server_linux-x64 (push) Has been cancelled
LANCommander Release / build_server_osx-arm64 (push) Has been cancelled
LANCommander Release / build_server_osx-x64 (push) Has been cancelled
LANCommander Release / build_server_win-arm64 (push) Has been cancelled
LANCommander Release / build_release (push) Has been cancelled
109 lines
3.4 KiB
Text
109 lines
3.4 KiB
Text
@using LANCommander.Launcher.Models
|
|
@inject InstallService InstallService
|
|
@inject NavigationManager NavigationManager
|
|
|
|
<Drawer Placement="DrawerPlacement.Bottom" Class="download-queue" @bind-Visible="@Visible" OnClose="Hide">
|
|
|
|
@if (InstallService.Queue.Any(qi => qi.State))
|
|
{
|
|
<h2>In Progress</h2>
|
|
@foreach (var queueItem in InstallService.Queue.Where(qi => qi.State))
|
|
{
|
|
<div class="queue-item">
|
|
<MediaImage Id="@queueItem.CoverId" Class="queue-item-cover" />
|
|
<div class="queue-item-info">
|
|
<div>
|
|
<h3>@queueItem.Title</h3>
|
|
</div>
|
|
</div>
|
|
<div class="queue-item-current-download">
|
|
<CurrentDownloadItem />
|
|
</div>
|
|
</div>
|
|
}
|
|
}
|
|
|
|
<h2>Up Next</h2>
|
|
@foreach (var queueItem in InstallService.Queue.Where(qi => !qi.State && qi.Status == SDK.Enums.InstallStatus.Queued))
|
|
{
|
|
<div class="queue-item">
|
|
<MediaImage Id="@queueItem.CoverId" Class="queue-item-cover" />
|
|
<div class="queue-item-info">
|
|
<div>
|
|
<h3>@queueItem.Title</h3>
|
|
</div>
|
|
</div>
|
|
<div class="queue-item-actions">
|
|
<Button Icon="@IconType.Outline.Close" Size="ButtonSize.Large" Danger OnClick="() => Remove(queueItem)" />
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
@if (!InstallService.Queue.Any(qi => qi.Status == SDK.Enums.InstallStatus.Queued))
|
|
{
|
|
<Empty Simple Description="@("The queue is empty")" />
|
|
}
|
|
|
|
@if (InstallService.Queue.Any(qi => !qi.State && qi.Status != SDK.Enums.InstallStatus.Queued && qi.Status != SDK.Enums.InstallStatus.Failed && qi.Status != SDK.Enums.InstallStatus.Canceled))
|
|
{
|
|
<h2>Completed</h2>
|
|
@foreach (var queueItem in InstallService.Queue.Where(qi => !qi.State))
|
|
{
|
|
<div class="queue-item">
|
|
<MediaImage Id="@queueItem.CoverId" Class="queue-item-cover" />
|
|
<div class="queue-item-info">
|
|
<div>
|
|
<h3>@queueItem.Title</h3>
|
|
<span><ByteSize Value="queueItem.TotalBytes" /></span>
|
|
</div>
|
|
</div>
|
|
<div class="queue-item-actions">
|
|
<PlayButton LibraryItemId="@queueItem.Id">
|
|
<MenuExtra>
|
|
<MenuItem OnClick="() => ViewInLibrary(queueItem)">
|
|
View in Library
|
|
</MenuItem>
|
|
</MenuExtra>
|
|
</PlayButton>
|
|
</div>
|
|
</div>
|
|
}
|
|
}
|
|
</Drawer>
|
|
|
|
@code {
|
|
bool Visible { get; set; } = false;
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
InstallService.OnQueueChanged += async () =>
|
|
{
|
|
StateHasChanged();
|
|
};
|
|
}
|
|
|
|
async Task Remove(IInstallQueueItem queueItem)
|
|
{
|
|
InstallService.Remove(queueItem);
|
|
}
|
|
|
|
async Task ViewInLibrary(IInstallQueueItem queueItem)
|
|
{
|
|
Visible = false;
|
|
NavigationManager.NavigateTo("/" + queueItem.Id);
|
|
}
|
|
|
|
public async Task Show()
|
|
{
|
|
Visible = true;
|
|
|
|
await InvokeAsync(StateHasChanged);
|
|
}
|
|
|
|
public async Task Hide()
|
|
{
|
|
Visible = false;
|
|
|
|
await InvokeAsync(StateHasChanged);
|
|
}
|
|
}
|