Display improvements

This commit is contained in:
2017-02-06 14:01:56 -05:00
parent 7dcd9dec75
commit 223a1c996a
13 changed files with 82 additions and 17 deletions
+8 -4
View File
@@ -8,7 +8,11 @@
<div class="row panel">
<div class="col-lg-8">
Service description: @Model.ServerDescription
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))
@@ -129,7 +133,7 @@ if (leafInput.EndTime.HasValue)
}
var summaryText = string.Join(Environment.NewLine, summary);
<span class="text-nowrap" title="@summaryText">
<i class="fa fa-file-o"></i> @leafInput.InputFiles.Count input @if(leafInput.InputFiles.Count > 1) {<text>files</text>} else { <text>file</text>}
<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)
{
@@ -140,14 +144,14 @@ var summaryText = string.Join(Environment.NewLine, summary);
else if (leafInput.IsPending)
{
<text>
<i class="fa fa-hourglass-start"></i> @Html.Partial("DisplayTemplates/_TimeRemaining", Tuple.Create(leafInput, Model.CompletedLeafInput)) est.
<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.CompletedLeafInput)) left
<i class="fa fa-hourglass-half"></i> @Html.Partial("DisplayTemplates/_TimeRemaining", Tuple.Create(leafInput, Model.TimeInProgressEstimater)) left
</text>
}
</span>
@@ -0,0 +1,13 @@
@{
Layout = "~/Views/Shared/DisplayTemplates/_FieldLayout.cshtml";
var lowerPropertyName = ViewData.ModelMetadata.PropertyName.ToFirstLower();
}
@if (Model == null)
{
@Html.Encode(ViewData.ModelMetadata.NullDisplayText)
}
else
{
<pre id="@lowerPropertyName-read" class="read read-less">@Html.Raw(Model)</pre>
<small><a href="#" readcontrol="@lowerPropertyName-read" class="read-more">Show More</a></small>
}
@@ -1,10 +1,9 @@
@using LeafWeb.Core.Entities
@model Tuple<LeafInput,IQueryable<LeafInput>>
@model Tuple<LeafInput,TimeInProgressEstimater>
@{
var leafInput = Model.Item1;
var observations = Model.Item2.Take(20);
var estimater = Model.Item2;
var estimater = new TimeInProgressEstimater(observations);
var totalTimeEstimate = estimater.EstimateTimeInProgress(leafInput);
var remaining = totalTimeEstimate - leafInput.TimeInProgress;
if (remaining > TimeSpan.Zero)