Remaining time estimate
This commit is contained in:
@@ -30,10 +30,9 @@
|
||||
grid.Column("Identifier", "Identifier"),
|
||||
grid.Column("SiteId", "Site Id"),
|
||||
grid.Column("Name", "Submitted By"),
|
||||
//grid.Column("FileCount", "Input files"),
|
||||
grid.Column("TimeInProgress", "Time In Progress", item => TimeInProgress(item.TimeInProgress)),
|
||||
grid.Column("CurrentStatus", "Status", item => Html.Partial("DisplayTemplates/_LeafInputStatus", (string) item.CurrentStatus.ToString())),
|
||||
grid.Column("Total Results: " + Model.Items.Count(), format: item => Btns(item))),
|
||||
grid.Column("TimeInProgress", "Time In Progress", item => TimeInProgress(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()
|
||||
@@ -43,7 +42,24 @@ else
|
||||
<p>No results.</p>
|
||||
}
|
||||
|
||||
@helper Btns(dynamic item)
|
||||
@helper Status(LeafInput leafInput)
|
||||
{
|
||||
if (leafInput.IsPending)
|
||||
{
|
||||
<span class="text-nowrap">
|
||||
<span class="text-muted" title="@leafInput.PendingPriority.ToString() Priority">
|
||||
@Html.Partial("DisplayTemplates/PriorityIcon", leafInput.PendingPriority)
|
||||
</span>
|
||||
@Html.Partial("DisplayTemplates/_LeafInputStatus", leafInput.CurrentStatus.ToString())
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.Partial("DisplayTemplates/_LeafInputStatus", leafInput.CurrentStatus.ToString())
|
||||
}
|
||||
}
|
||||
|
||||
@helper Btns(LeafInput item)
|
||||
{
|
||||
<div class="btn-group text-nowrap" role="group">
|
||||
<div class="btn-group" role="group">
|
||||
@@ -61,12 +77,12 @@ else
|
||||
<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>
|
||||
@@ -100,16 +116,45 @@ else
|
||||
<span class="glyphicon glyphicon-download"></span> ToUser
|
||||
</a>
|
||||
}
|
||||
@helper TimeInProgress(TimeSpan timeSpan)
|
||||
@helper TimeInProgress(LeafInput leafInput)
|
||||
{
|
||||
if (timeSpan > TimeSpan.Zero)
|
||||
var summary = new List<string> { "Added Time: " + leafInput.Added };
|
||||
if (leafInput.StartTime.HasValue)
|
||||
{
|
||||
@timeSpan.ToRoundedReadableString()
|
||||
summary.Add("Start Time: " + leafInput.StartTime.Value);
|
||||
}
|
||||
}
|
||||
@helper DeleteLink(dynamic item)
|
||||
if (leafInput.EndTime.HasValue)
|
||||
{
|
||||
@Html.Partial("DisplayTemplates/_DeleteForm", (Tuple<int, string, bool>)Tuple.Create(item.Id, item.Identifier, item.IsDeletable))
|
||||
summary.Add("End Time: " + leafInput.EndTime.Value);
|
||||
}
|
||||
var summaryText = string.Join(Environment.NewLine, summary);
|
||||
<span class="text-nowrap" title="@summaryText">
|
||||
@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.CompletedLeafInput)) est.
|
||||
</text>
|
||||
}
|
||||
@if (leafInput.IsRunning)
|
||||
{
|
||||
<text>
|
||||
<br />
|
||||
<i class="fa fa-hourglass-half"></i> @Html.Partial("DisplayTemplates/_TimeRemaining", Tuple.Create(leafInput, Model.CompletedLeafInput)) left
|
||||
</text>
|
||||
}
|
||||
<br />
|
||||
<i class="fa fa-file-o"></i> @leafInput.InputFiles.Count input files
|
||||
</span>
|
||||
}
|
||||
@helper DeleteLink(LeafInput item)
|
||||
{
|
||||
@Html.Partial("DisplayTemplates/_DeleteForm", Tuple.Create(item.Id, item.Identifier, item.IsDeletable))
|
||||
}
|
||||
|
||||
@helper CancelLink(dynamic item)
|
||||
|
||||
Reference in New Issue
Block a user