Display improvements
This commit is contained in:
@@ -23,12 +23,16 @@ namespace LeafWeb.Core.Utility
|
|||||||
_yData = yData.ToArray();
|
_yData = yData.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Func<double, double> FitFunc => Fit.PolynomialFunc(_xData, _yData, 3);
|
||||||
|
|
||||||
public TimeSpan EstimateTimeInProgress(ILeafInput leafInput)
|
public TimeSpan EstimateTimeInProgress(ILeafInput leafInput)
|
||||||
{
|
{
|
||||||
//var lineFunc = Fit.LineFunc(_xData, _yData);
|
return EstimateTimeInProgress(leafInput.InputFiles.Count);
|
||||||
var lineFunc = Fit.PolynomialFunc(_xData, _yData, 3);
|
}
|
||||||
var estimate = lineFunc(leafInput.InputFiles.Count);
|
|
||||||
return ConvertToTimeSpan(estimate);
|
public TimeSpan EstimateTimeInProgress(int inputFileCount)
|
||||||
|
{
|
||||||
|
return ConvertToTimeSpan(FitFunc(inputFileCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static double ConvertFromTimeSpan(TimeSpan timeSpan)
|
private static double ConvertFromTimeSpan(TimeSpan timeSpan)
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
C:\Users\poprhythm\AppData\Local\Temp\Temporary ASP.NET Files\vs\f80e29bb\faae20bf\App_Web_all.generated.cs.8f9494c4.idigbf5n.dll
|
C:\Users\poprhythm\AppData\Local\Temp\Temporary ASP.NET Files\vs\f80e29bb\faae20bf\App_Web_all.generated.cs.8f9494c4.g_xi0dfe.dll
|
||||||
@@ -188,3 +188,15 @@ form .validation-summary-errors ul {
|
|||||||
.divider-right {
|
.divider-right {
|
||||||
border-right: 1px dashed #333; }
|
border-right: 1px dashed #333; }
|
||||||
|
|
||||||
|
.read {
|
||||||
|
overflow: hidden;
|
||||||
|
font-size: 16px !important;
|
||||||
|
transition: all 0.3s;
|
||||||
|
margin-bottom: 10px; }
|
||||||
|
|
||||||
|
.read-less {
|
||||||
|
height: 90px !important; }
|
||||||
|
|
||||||
|
code, pre {
|
||||||
|
line-height: 1; }
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
body.debug header .brand{position:relative;}body.debug header .brand:before{content:"";font-family:FontAwesome;font-style:normal;font-weight:normal;text-decoration:inherit;color:#f00;font-size:60px;padding-right:.5em;position:absolute;top:10px;left:0;}h1{padding:24px 0 12px 0;}p{padding:12px 0;}footer{margin-top:24px !important;}.row-no-padding [class*="col-"]{padding-left:0 !important;padding-right:0 !important;}.home .dark .row:first-child .column:first-child h1{padding-top:0;}.home .blogarchive{padding-top:20px;}.top-buffer{margin-top:20px;}.detail-actions>a,.detail-actions>form>button{margin-top:20px;float:left;clear:left;}.banner-link{white-space:normal;padding:20px;background:#000;background:rgba(0,0,0,.5);-moz-border-radius:10px;border-radius:10px;}.banner-link .glyphicon{color:#8cc641;}a.banner-link:hover{text-decoration:none;background:rgba(0,0,0,.6);}a.banner-link:hover .glyphicon{color:#a8ed4f;}.headline-icon h1:after{color:rgba(172,214,118,.8);font-family:"Glyphicons Halflings";font-size:.8em;padding-left:10px;}.headline-icon.headline-icon-file h1:after{content:"";}.headline-icon.headline-icon-leaf h1:after{content:"";}.headline-icon.headline-icon-question h1:after{content:"";}.headline-icon.headline-icon-stats h1:after{content:"";}.headline-icon.headline-icon-user h1:after{content:"";}.headline-icon.headline-icon-list h1:after{content:"";}.status{white-space:nowrap;}.status:after{font-family:"Glyphicons Halflings";font-size:.8em;padding-left:5px;}.status.status-pending{color:#f0ad4e;}.status.status-pending:after{content:"";}.status.status-complete{color:#337ab7;}.status.status-complete:after{content:"";}.status.status-exception{color:#a94442;}.status.status-exception:after{content:"";}.status.status-running,.status.status-starting,.status.status-finishing{color:#3c763d;}.status.status-running:after{content:"";}.status.status-starting:after{content:"";}.status.status-finishing:after{content:"";}.status.status-cancelpending,.status.status-cancelling{color:#f0ad4e;}.status.status-cancelled{color:#ec971f;}.status.status-cancelpending:after{content:"";}.status.status-cancelling:after{content:"";}.status.status-cancelled:after{content:"";}#chart{padding-top:20px;}.btn-file{position:relative;overflow:hidden;}.btn-file input[type=file]{position:absolute;top:0;right:0;min-width:100%;min-height:100%;font-size:100px;text-align:right;filter:alpha(opacity=0);opacity:0;outline:none;background:#fff;cursor:inherit;display:block;}form .validation-summary-errors ul{list-style-type:none;}.autocomplete-suggestions{border:1px solid #999;background:#fff;overflow:auto;}.autocomplete-suggestion{padding:2px 5px;white-space:nowrap;overflow:hidden;}.autocomplete-selected{background:#f0f0f0;}.autocomplete-suggestions strong{font-weight:normal;color:#39f;}.autocomplete-group{padding:2px 5px;}.autocomplete-group strong{display:block;border-bottom:1px solid #000;}.toggle{width:15px;}.dropdown-menu li form .btn-link{display:block;color:#333;clear:both;float:left;font-size:1rem;font-weight:normal;line-height:1.42857;min-width:160px;padding:3px 20px;text-align:left;white-space:nowrap;}.dropdown-menu li form .btn-link:focus,.dropdown-menu li form .btn-link:hover{text-decoration:none;color:#262626;background-color:#f5f5f5;}.divider-right{border-right:1px dashed #333;}
|
body.debug header .brand{position:relative;}body.debug header .brand:before{content:"";font-family:FontAwesome;font-style:normal;font-weight:normal;text-decoration:inherit;color:#f00;font-size:60px;padding-right:.5em;position:absolute;top:10px;left:0;}h1{padding:24px 0 12px 0;}p{padding:12px 0;}footer{margin-top:24px !important;}.row-no-padding [class*="col-"]{padding-left:0 !important;padding-right:0 !important;}.home .dark .row:first-child .column:first-child h1{padding-top:0;}.home .blogarchive{padding-top:20px;}.top-buffer{margin-top:20px;}.detail-actions>a,.detail-actions>form>button{margin-top:20px;float:left;clear:left;}.banner-link{white-space:normal;padding:20px;background:#000;background:rgba(0,0,0,.5);-moz-border-radius:10px;border-radius:10px;}.banner-link .glyphicon{color:#8cc641;}a.banner-link:hover{text-decoration:none;background:rgba(0,0,0,.6);}a.banner-link:hover .glyphicon{color:#a8ed4f;}.headline-icon h1:after{color:rgba(172,214,118,.8);font-family:"Glyphicons Halflings";font-size:.8em;padding-left:10px;}.headline-icon.headline-icon-file h1:after{content:"";}.headline-icon.headline-icon-leaf h1:after{content:"";}.headline-icon.headline-icon-question h1:after{content:"";}.headline-icon.headline-icon-stats h1:after{content:"";}.headline-icon.headline-icon-user h1:after{content:"";}.headline-icon.headline-icon-list h1:after{content:"";}.status{white-space:nowrap;}.status:after{font-family:"Glyphicons Halflings";font-size:.8em;padding-left:5px;}.status.status-pending{color:#f0ad4e;}.status.status-pending:after{content:"";}.status.status-complete{color:#337ab7;}.status.status-complete:after{content:"";}.status.status-exception{color:#a94442;}.status.status-exception:after{content:"";}.status.status-running,.status.status-starting,.status.status-finishing{color:#3c763d;}.status.status-running:after{content:"";}.status.status-starting:after{content:"";}.status.status-finishing:after{content:"";}.status.status-cancelpending,.status.status-cancelling{color:#f0ad4e;}.status.status-cancelled{color:#ec971f;}.status.status-cancelpending:after{content:"";}.status.status-cancelling:after{content:"";}.status.status-cancelled:after{content:"";}#chart{padding-top:20px;}.btn-file{position:relative;overflow:hidden;}.btn-file input[type=file]{position:absolute;top:0;right:0;min-width:100%;min-height:100%;font-size:100px;text-align:right;filter:alpha(opacity=0);opacity:0;outline:none;background:#fff;cursor:inherit;display:block;}form .validation-summary-errors ul{list-style-type:none;}.autocomplete-suggestions{border:1px solid #999;background:#fff;overflow:auto;}.autocomplete-suggestion{padding:2px 5px;white-space:nowrap;overflow:hidden;}.autocomplete-selected{background:#f0f0f0;}.autocomplete-suggestions strong{font-weight:normal;color:#39f;}.autocomplete-group{padding:2px 5px;}.autocomplete-group strong{display:block;border-bottom:1px solid #000;}.toggle{width:15px;}.dropdown-menu li form .btn-link{display:block;color:#333;clear:both;float:left;font-size:1rem;font-weight:normal;line-height:1.42857;min-width:160px;padding:3px 20px;text-align:left;white-space:nowrap;}.dropdown-menu li form .btn-link:focus,.dropdown-menu li form .btn-link:hover{text-decoration:none;color:#262626;background-color:#f5f5f5;}.divider-right{border-right:1px dashed #333;}.read{overflow:hidden;font-size:16px !important;transition:all .3s;margin-bottom:10px;}.read-less{height:90px !important;}code,pre{line-height:1;}
|
||||||
@@ -238,4 +238,18 @@ form .validation-summary-errors ul {
|
|||||||
|
|
||||||
.divider-right {
|
.divider-right {
|
||||||
border-right: 1px dashed #333;
|
border-right: 1px dashed #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.read{
|
||||||
|
overflow: hidden;
|
||||||
|
font-size: 16px !important;
|
||||||
|
transition: all 0.3s;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.read-less{
|
||||||
|
height: 90px!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
code,pre {
|
||||||
|
line-height: 1;
|
||||||
}
|
}
|
||||||
@@ -20,6 +20,7 @@ namespace LeafWeb.WebCms.Controllers
|
|||||||
var resultItems =
|
var resultItems =
|
||||||
DataService.GetLeafInputsOrdered() ;
|
DataService.GetLeafInputsOrdered() ;
|
||||||
|
|
||||||
|
// search functionality
|
||||||
if (!string.IsNullOrEmpty(query))
|
if (!string.IsNullOrEmpty(query))
|
||||||
{
|
{
|
||||||
foreach (var piece in query.Split(' ').Select(p => p.Trim()))
|
foreach (var piece in query.Split(' ').Select(p => p.Trim()))
|
||||||
@@ -33,13 +34,16 @@ namespace LeafWeb.WebCms.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// completed leaf input for computing runtime statistics
|
||||||
var completedLeafInput = DataService.GetLeafInputsOrdered().Where(li => li.CurrentStatus == LeafInputStatusType.Complete);
|
var completedLeafInput = DataService.GetLeafInputsOrdered().Where(li => li.CurrentStatus == LeafInputStatusType.Complete);
|
||||||
|
var timeInProgressEstimater = new TimeInProgressEstimater(completedLeafInput.Take(20));
|
||||||
|
|
||||||
var serviceDescription = ServiceDescription();
|
var serviceDescription = ServiceDescription();
|
||||||
|
|
||||||
var queueViewModel = new QueueViewModel
|
var queueViewModel = new QueueViewModel
|
||||||
{
|
{
|
||||||
Items = resultItems, ServerDescription = serviceDescription, Query = query, CompletedLeafInput = completedLeafInput
|
Items = resultItems, ServerDescription = serviceDescription, Query = query,
|
||||||
|
TimeInProgressEstimater = timeInProgressEstimater
|
||||||
};
|
};
|
||||||
|
|
||||||
return View(queueViewModel);
|
return View(queueViewModel);
|
||||||
|
|||||||
@@ -42,9 +42,11 @@ namespace LeafWeb.WebCms.Models
|
|||||||
public DateTime Added { get; set; }
|
public DateTime Added { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Piscal Error")]
|
[Display(Name = "Piscal Error")]
|
||||||
|
[UIHint("PreReadMore")]
|
||||||
public string OutputErrorMessage { get; set; }
|
public string OutputErrorMessage { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Piscal Warning")]
|
[Display(Name = "Piscal Warning")]
|
||||||
|
[UIHint("PreReadMore")]
|
||||||
public string OutputWarningMessage { get; set; }
|
public string OutputWarningMessage { get; set; }
|
||||||
|
|
||||||
[Display(Name = "Time In Progress")]
|
[Display(Name = "Time In Progress")]
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using LeafWeb.Core.Entities;
|
using LeafWeb.Core.Entities;
|
||||||
|
using LeafWeb.Core.Utility;
|
||||||
|
|
||||||
namespace LeafWeb.WebCms.Models
|
namespace LeafWeb.WebCms.Models
|
||||||
{
|
{
|
||||||
@@ -10,6 +11,6 @@ namespace LeafWeb.WebCms.Models
|
|||||||
public string ServerStatus { get; set; }
|
public string ServerStatus { get; set; }
|
||||||
public IEnumerable<LeafInput> Items { get; set; }
|
public IEnumerable<LeafInput> Items { get; set; }
|
||||||
public string Query { get; set; }
|
public string Query { get; set; }
|
||||||
public IQueryable<LeafInput> CompletedLeafInput { get; set; }
|
public TimeInProgressEstimater TimeInProgressEstimater { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,11 @@
|
|||||||
|
|
||||||
<div class="row panel">
|
<div class="row panel">
|
||||||
<div class="col-lg-8">
|
<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>
|
||||||
<div class="col-lg-4">
|
<div class="col-lg-4">
|
||||||
@using (Html.BeginUmbracoForm<QueueController>("Search", FormMethod.Post))
|
@using (Html.BeginUmbracoForm<QueueController>("Search", FormMethod.Post))
|
||||||
@@ -129,7 +133,7 @@ if (leafInput.EndTime.HasValue)
|
|||||||
}
|
}
|
||||||
var summaryText = string.Join(Environment.NewLine, summary);
|
var summaryText = string.Join(Environment.NewLine, summary);
|
||||||
<span class="text-nowrap" title="@summaryText">
|
<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 />
|
<br />
|
||||||
@if (leafInput.TimeInProgress > TimeSpan.Zero)
|
@if (leafInput.TimeInProgress > TimeSpan.Zero)
|
||||||
{
|
{
|
||||||
@@ -140,14 +144,14 @@ var summaryText = string.Join(Environment.NewLine, summary);
|
|||||||
else if (leafInput.IsPending)
|
else if (leafInput.IsPending)
|
||||||
{
|
{
|
||||||
<text>
|
<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>
|
</text>
|
||||||
}
|
}
|
||||||
@if (leafInput.IsRunning)
|
@if (leafInput.IsRunning)
|
||||||
{
|
{
|
||||||
<text>
|
<text>
|
||||||
<br />
|
<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>
|
</text>
|
||||||
}
|
}
|
||||||
</span>
|
</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
|
@using LeafWeb.Core.Entities
|
||||||
@model Tuple<LeafInput,IQueryable<LeafInput>>
|
@model Tuple<LeafInput,TimeInProgressEstimater>
|
||||||
@{
|
@{
|
||||||
var leafInput = Model.Item1;
|
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 totalTimeEstimate = estimater.EstimateTimeInProgress(leafInput);
|
||||||
var remaining = totalTimeEstimate - leafInput.TimeInProgress;
|
var remaining = totalTimeEstimate - leafInput.TimeInProgress;
|
||||||
if (remaining > TimeSpan.Zero)
|
if (remaining > TimeSpan.Zero)
|
||||||
|
|||||||
@@ -893,6 +893,7 @@
|
|||||||
<Content Include="Views\Shared\DisplayTemplates\_PriorityForm.cshtml" />
|
<Content Include="Views\Shared\DisplayTemplates\_PriorityForm.cshtml" />
|
||||||
<Content Include="Views\Shared\DisplayTemplates\PriorityIcon.cshtml" />
|
<Content Include="Views\Shared\DisplayTemplates\PriorityIcon.cshtml" />
|
||||||
<Content Include="Views\Shared\DisplayTemplates\_TimeRemaining.cshtml" />
|
<Content Include="Views\Shared\DisplayTemplates\_TimeRemaining.cshtml" />
|
||||||
|
<Content Include="Views\Shared\DisplayTemplates\PreReadMore.cshtml" />
|
||||||
<None Include="Web.Debug.config">
|
<None Include="Web.Debug.config">
|
||||||
<DependentUpon>Web.config</DependentUpon>
|
<DependentUpon>Web.config</DependentUpon>
|
||||||
</None>
|
</None>
|
||||||
|
|||||||
+13
-2
@@ -38,8 +38,8 @@
|
|||||||
$(container).find('.equal').each(function() {
|
$(container).find('.equal').each(function() {
|
||||||
|
|
||||||
$el = $(this);
|
$el = $(this);
|
||||||
$($el).height('auto')
|
$($el).height('auto');
|
||||||
topPostion = $el.position().top;
|
topPostion = $el.position().top;
|
||||||
|
|
||||||
if (currentRowStart != topPostion) {
|
if (currentRowStart != topPostion) {
|
||||||
for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) {
|
for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) {
|
||||||
@@ -110,4 +110,15 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(".read-more")
|
||||||
|
.click(function () {
|
||||||
|
var control = $(this).attr('readcontrol');
|
||||||
|
$("#" + control).toggleClass("read-less");
|
||||||
|
if ($(this).text() === "Show Less")
|
||||||
|
$(this).text("Show More");
|
||||||
|
else
|
||||||
|
$(this).text("Show Less");
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
Reference in New Issue
Block a user