@page "/queue/{queue?}/{pagination:int?}/{status?}" @inject QueueService QueueSvc @using Iceshrimp.Backend.Core.Database.Tables @using Iceshrimp.Backend.Core.Extensions @using Iceshrimp.Backend.Core.Services @model QueueModel @{ ViewData["title"] = "Queue dashboard - Iceshrimp.NET"; } @section head { } @section scripts { }

Queue Dashboard

@foreach (var queue in QueueSvc.QueueNames) { }
@if (Model.Queue == null) {

Please pick a queue.

} else { if (Model.Filter == null) {

Listing @Model.TotalCount @Model.Queue jobs, out of which @Model.RunningCount are running, @Model.QueuedCount are queued and @Model.DelayedCount are delayed.

} else {

Listing @Model.TotalCount @Model.Filter.Value.ToString().ToLowerInvariant() @Model.Queue jobs.

} @foreach (var job in Model.Jobs) { await RenderJob(job); }
ID Status Actions
@if (Model.PrevPage != null) { if (Model.Filter.HasValue) { } else { } } else { } @if (Model.NextPage != null) { if (Model.Filter.HasValue) { } else { } } else { }
} @{ async Task RenderJob(Job job) { var id = job.Id.ToStringLower(); var additional = job.Status switch { Job.JobStatus.Queued => $"for {job.QueueDuration.ToDurationDisplayString()}", Job.JobStatus.Running => $"for {job.Duration.ToDurationDisplayString()}", Job.JobStatus.Delayed => $"until {job.DelayedUntil?.ToDisplayStringTz() ?? ""}", Job.JobStatus.Completed => $"at {job.FinishedAt?.ToDisplayStringTz() ?? ""}", Job.JobStatus.Failed => $"at {job.FinishedAt?.ToDisplayStringTz() ?? ""}", _ => throw new ArgumentOutOfRangeException() }; @id @job.Status @additional View details } }