166 lines
6.1 KiB
Plaintext
166 lines
6.1 KiB
Plaintext
@using LeafWeb.Core.Entities
|
|
@using LeafWeb.WebCms.Controllers
|
|
@model QueueViewModel
|
|
|
|
@{
|
|
var grid = new WebGrid(Model.Items, rowsPerPage: 45);
|
|
}
|
|
|
|
<div class="row panel">
|
|
<div class="col-lg-8">
|
|
Service description: @Model.ServerDescription<br/>
|
|
@*Est. processing time by LeafInput size -
|
|
<i class="fa fa-file-o"></i> 1: <strong>@Model.TimeInProgressEstimater.EstimateTimeInProgress(1).ToRoundedReadableString()</strong>
|
|
<i class="fa fa-file-o"></i> 10: <strong>@Model.TimeInProgressEstimater.EstimateTimeInProgress(10).ToRoundedReadableString()</strong>
|
|
<i class="fa fa-file-o"></i> 100: <strong>@Model.TimeInProgressEstimater.EstimateTimeInProgress(100).ToRoundedReadableString()</strong>*@
|
|
</div>
|
|
<div class="col-lg-4">
|
|
@using (Html.BeginUmbracoForm<QueueController>("Search", FormMethod.Post))
|
|
{
|
|
<div class="input-group">
|
|
<input name="query" type="text" class="form-control" placeholder="Search for..." value="@Model.Query">
|
|
<span class="input-group-btn">
|
|
<button class="btn btn-default" type="button">Search</button>
|
|
</span>
|
|
</div><!-- /input-group -->
|
|
}
|
|
</div>
|
|
</div>
|
|
|
|
@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)),
|
|
grid.Column("CurrentStatus", "Status", item => Status(item.Value)),
|
|
grid.Column("Total Results: " + Model.Items.Count(), format: item => Btns(item.Value))),
|
|
htmlAttributes: new {@class = "table table-striped table-bordered table-hover table-condensed"}
|
|
)
|
|
@grid.BootstrapPager()
|
|
}
|
|
else
|
|
{
|
|
<p>No results.</p>
|
|
}
|
|
|
|
@helper Status(LeafInput leafInput)
|
|
{
|
|
@Html.Partial("DisplayTemplates/_LeafInputStatus", leafInput)
|
|
}
|
|
|
|
@helper Btns(LeafInput item)
|
|
{
|
|
<div class="btn-group text-nowrap" role="group">
|
|
<div class="btn-group" role="group">
|
|
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
Actions
|
|
<span class="caret"></span>
|
|
</button>
|
|
<ul class="dropdown-menu">
|
|
<li>@DetailsLink(item)</li>
|
|
<li @DisableItem(!item.HasLeafChart)>@ChartLink(item)</li>
|
|
@if (item.IsPending)
|
|
{
|
|
<li role="separator" class="divider"></li>
|
|
<li class="dropdown-header">Priority</li>
|
|
<li @DisableItem(item.PendingPriority == Priority.High)>@PriorityForm(item, Priority.High)</li>
|
|
<li @DisableItem(item.PendingPriority == Priority.Normal)>@PriorityForm(item, Priority.Normal)</li>
|
|
<li @DisableItem(item.PendingPriority == Priority.Low)>@PriorityForm(item, Priority.Low)</li>
|
|
}
|
|
@if (item.IsCancellable)
|
|
{
|
|
<li role="separator" class="divider"></li>
|
|
<li>@CancelLink(item)</li>
|
|
}
|
|
<li role="separator" class="divider"></li>
|
|
<li class="dropdown-header">Download</li>
|
|
<li>@DownloadInput(item)</li>
|
|
<li @DisableItem(!item.HasOutputFiles)>@DownloadOutputToUser(item)</li>
|
|
<li role="separator" class="divider"></li>
|
|
<li @DisableItem(!item.IsDeletable)>@DeleteLink(item)</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
@helper DetailsLink(dynamic item)
|
|
{
|
|
@Html.Partial("DisplayTemplates/_DetailsLink", (int)item.Id)
|
|
}
|
|
|
|
@helper ChartLink(dynamic item)
|
|
{
|
|
@Html.Partial("DisplayTemplates/_ChartLink", (int)item.Id)
|
|
}
|
|
|
|
@helper DownloadInput(dynamic item)
|
|
{
|
|
<a href="@Url.Action("DownloadInput", "Queue", new {id = item.Id})">
|
|
<span class="glyphicon glyphicon-download"></span> Input
|
|
</a>
|
|
}
|
|
@helper DownloadOutputToUser(dynamic item)
|
|
{
|
|
<a href="@Url.Action("DownloadOutputToUser", "Queue", new {id = item.Id})">
|
|
<span class="glyphicon glyphicon-download"></span> ToUser
|
|
</a>
|
|
}
|
|
@helper Statistics(LeafInput leafInput)
|
|
{
|
|
var summary = new List<string> { "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);
|
|
<span class="text-nowrap" title="@summaryText">
|
|
<i class="fa fa-file-o"></i> @leafInput.InputFiles.Count @if(leafInput.InputFiles.Count > 1) {<text>LeafInputs</text>} else { <text>LeafInput</text>}
|
|
<br />
|
|
@if (leafInput.TimeInProgress > TimeSpan.Zero)
|
|
{
|
|
<text>
|
|
<i class="fa fa-clock-o"></i> @leafInput.TimeInProgress.ToRoundedReadableString()
|
|
</text>
|
|
}
|
|
else if (leafInput.IsPending)
|
|
{
|
|
<text>
|
|
<i class="fa fa-hourglass-start"></i> @Html.Partial("DisplayTemplates/_TimeRemaining", Tuple.Create(leafInput, Model.TimeInProgressEstimater)) est.
|
|
</text>
|
|
}
|
|
@if (leafInput.IsRunning)
|
|
{
|
|
<text>
|
|
<br />
|
|
<i class="fa fa-hourglass-half"></i> @Html.Partial("DisplayTemplates/_TimeRemaining", Tuple.Create(leafInput, Model.TimeInProgressEstimater)) left
|
|
</text>
|
|
}
|
|
</span>
|
|
}
|
|
@helper DeleteLink(LeafInput item)
|
|
{
|
|
@Html.Partial("DisplayTemplates/_DeleteForm", Tuple.Create(item.Id, item.Identifier, item.IsDeletable))
|
|
}
|
|
|
|
@helper CancelLink(dynamic item)
|
|
{
|
|
@Html.Partial("DisplayTemplates/_CancelForm", (Tuple<int, string>)Tuple.Create(item.Id, item.Identifier))
|
|
}
|
|
|
|
@helper PriorityForm(dynamic item, Priority priority)
|
|
{
|
|
@Html.Partial("DisplayTemplates/_PriorityForm", (Tuple<int, Priority, Priority>)Tuple.Create(item.Id, item.PendingPriority, priority))
|
|
}
|
|
|
|
@helper DisableItem(bool disabled)
|
|
{
|
|
if (disabled)
|
|
{<text>class="disabled"</text>}
|
|
} |