@using ClientDependency.Core.Mvc
@using LeafWeb.Core.Entities
@using LeafWeb.WebCms.Utility
@model QueueViewModel
@{
Html.RequiresJs("~/scripts/jquery.validate.min.js", 2);
Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.min.js", 2);
Html.RequiresJs("~/scripts/jquery.validate.custom.js", 2);
Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.bootstrap.js", 2);
Html.RequiresJs("~/scripts/Queue.js");
var grid = new WebGrid(Model.Items, rowsPerPage: 45);
}
@using (Html.BeginUmbracoForm("Search", "Queue", null, new { @action = "/leaf-data/manage-queue/" }))
{
@Model.Items.Count() results
Service description: @Model.ServerDescription
@*Est. processing time by LeafInput size -
1: @Model.TimeInProgressEstimater.EstimateTimeInProgress(1).ToRoundedReadableString()
10: @Model.TimeInProgressEstimater.EstimateTimeInProgress(10).ToRoundedReadableString()
100: @Model.TimeInProgressEstimater.EstimateTimeInProgress(100).ToRoundedReadableString()*@
@Html.EditorFor(m => m.Q.siteid)
@Html.EditorFor(m => m.Q.species)
@Html.EditorFor(m => m.Q.lat, new { size = "small", append = "°" })
@Html.EditorFor(m => m.Q.latr, new { size = "small", prepend = "±", append = "°" })
@Html.EditorFor(m => m.Q.lon, new { size = "small", append = "°" })
@Html.EditorFor(m => m.Q.lonr, new { size = "small", prepend = "±", append = "°" })
}
@if (Model.Items.Any())
{
@grid.Table(columns:
grid.Columns(
grid.Column("Identifier", "Identifier"),
grid.Column("SiteId", "Site Id"),
grid.Column("Name", "Submitted By"),
grid.Column("TimeInProgress", "Statistics", item => Statistics(item.Value), canSort: false),
grid.Column("CurrentStatus", "Status", item => Status(item.Value), canSort: false),
grid.Column("", format: item => Actions(item.Value), canSort: false)),
htmlAttributes: new { @class = "table table-sm table-striped table-bordered table-hover" }
)
@grid.PagerList()
}
else
{
No results.
}
@helper Status(LeafInput leafInput)
{
@Html.Partial("DisplayTemplates/_LeafInputStatus", leafInput)
}
@helper Actions(LeafInput item)
{
}
@helper DetailsLink(dynamic item)
{
var cssClass= CssClassUtil.CreateCssClassDataDictionary("dropdown-item");
@Html.Partial("DisplayTemplates/_DetailsLink", (int)item.Id, cssClass)
}
@helper ChartLink(dynamic item)
{
var cssClass= CssClassUtil.CreateCssClassDataDictionary("dropdown-item");
if (!item.HasLeafChart)
{
cssClass.SetCssDisabled();
}
@Html.Partial("DisplayTemplates/_ChartLink", (int)item.Id, cssClass)
}
@helper DownloadInput(dynamic item)
{
Input
}
@helper DownloadOutputToUser(dynamic item)
{
ToUser
}
@helper Statistics(LeafInput leafInput)
{
var summary = new List { "Added Time: " + leafInput.Added };
if (leafInput.StartTime.HasValue)
{
summary.Add("Start Time: " + leafInput.StartTime.Value);
}
if (leafInput.EndTime.HasValue)
{
summary.Add("End Time: " + leafInput.EndTime.Value);
}
var summaryText = string.Join(Environment.NewLine, summary);
@leafInput.InputFiles.Count @if (leafInput.InputFiles.Count > 1)
{inputs}
else
{ input}
@if (leafInput.TimeInProgress > TimeSpan.Zero)
{
@leafInput.TimeInProgress.ToRoundedReadableString()
}
else if (leafInput.IsPending)
{
@Html.Partial("DisplayTemplates/_TimeRemaining", Tuple.Create(leafInput, Model.TimeInProgressEstimater)) est.
}
@if (leafInput.IsRunning)
{
@Html.Partial("DisplayTemplates/_TimeRemaining", Tuple.Create(leafInput, Model.TimeInProgressEstimater)) left
}
}
@helper DeleteLink(LeafInput item)
{
var cssClass
= CssClassUtil.CreateCssClassDataDictionary("dropdown-item");
if (!item.IsDeletable)
{
cssClass.SetCssDisabled();
}
@Html.Partial("DisplayTemplates/_DeleteForm", Tuple.Create(item.Id, item.Identifier), cssClass)
}
@helper CancelLink(LeafInput item)
{
var cssClass
= CssClassUtil.CreateCssClassDataDictionary("dropdown-item");
if (!item.IsCancellable)
{
cssClass.SetCssDisabled();
}
@Html.Partial("DisplayTemplates/_CancelForm", Tuple.Create(item.Id, item.Identifier), cssClass)
}
@helper PriorityForm(LeafInput item, Priority priority)
{
var cssClass
= CssClassUtil.CreateCssClassDataDictionary("dropdown-item");
@Html.Partial("DisplayTemplates/_PriorityForm", Tuple.Create(item.Id, item.PendingPriority, priority), cssClass)
}
@helper DisableItem(bool disabled)
{
if (disabled)
{disabled}
}