Add "show only completed" to query
This commit is contained in:
@@ -1,6 +1,4 @@
|
|||||||
using System.Collections.Specialized;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
|
|
||||||
namespace LeafWeb.WebCms.Models
|
namespace LeafWeb.WebCms.Models
|
||||||
{
|
{
|
||||||
@@ -58,6 +56,9 @@ namespace LeafWeb.WebCms.Models
|
|||||||
[RegularExpression(FloatingPointRegex, ErrorMessage = "Must be numeric")]
|
[RegularExpression(FloatingPointRegex, ErrorMessage = "Must be numeric")]
|
||||||
public string phips2 { get; set; }
|
public string phips2 { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Show Only Successfully Completed")]
|
||||||
|
public bool completed { get; set; }
|
||||||
|
|
||||||
public bool HasExtendedParameters =>
|
public bool HasExtendedParameters =>
|
||||||
!(
|
!(
|
||||||
string.IsNullOrEmpty(siteid)
|
string.IsNullOrEmpty(siteid)
|
||||||
@@ -70,6 +71,7 @@ namespace LeafWeb.WebCms.Models
|
|||||||
&& string.IsNullOrEmpty(pari)
|
&& string.IsNullOrEmpty(pari)
|
||||||
&& string.IsNullOrEmpty(tleaf)
|
&& string.IsNullOrEmpty(tleaf)
|
||||||
&& string.IsNullOrEmpty(phips2)
|
&& string.IsNullOrEmpty(phips2)
|
||||||
|
&& !completed
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
using System;
|
using System.Collections.Specialized;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.Specialized;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
|
||||||
using System.Web.Routing;
|
using System.Web.Routing;
|
||||||
|
|
||||||
namespace LeafWeb.WebCms.Utility
|
namespace LeafWeb.WebCms.Utility
|
||||||
@@ -21,9 +18,15 @@ namespace LeafWeb.WebCms.Utility
|
|||||||
foreach (var pi in obj.GetType().GetProperties().Where(p => p.CanWrite))
|
foreach (var pi in obj.GetType().GetProperties().Where(p => p.CanWrite))
|
||||||
{
|
{
|
||||||
var value = pi.GetValue(obj, null);
|
var value = pi.GetValue(obj, null);
|
||||||
if (value == null)
|
switch (value)
|
||||||
continue;
|
{
|
||||||
nvs.Add(prefix + pi.Name, value.ToString());
|
case null:
|
||||||
|
case bool b when b == false:
|
||||||
|
continue;
|
||||||
|
default:
|
||||||
|
nvs.Add(prefix + pi.Name, value.ToString());
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nvs;
|
return nvs;
|
||||||
|
|||||||
@@ -143,6 +143,15 @@ namespace LeafWeb.WebCms.Utility
|
|||||||
select li;
|
select li;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (query.completed)
|
||||||
|
{
|
||||||
|
resultItems =
|
||||||
|
from li in resultItems
|
||||||
|
where
|
||||||
|
li.CurrentStatus == LeafInputStatusType.Complete
|
||||||
|
select li;
|
||||||
|
}
|
||||||
|
|
||||||
return resultItems;
|
return resultItems;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
@using (Html.BeginUmbracoForm("Search", "Queue", null, new { @action = "/leaf-data/manage-queue/" }))
|
@using (Html.BeginUmbracoForm("Search", "Queue", null, new { @action = "/leaf-data/manage-queue/" }))
|
||||||
{
|
{
|
||||||
<div class="row">
|
<div class="row align-items-start">
|
||||||
<div class="col font-italic font-weight-light">
|
<div class="col font-italic font-weight-light">
|
||||||
@Model.Items.Count() results<br />
|
@Model.Items.Count() results<br />
|
||||||
Service description: @Model.ServerDescription
|
Service description: @Model.ServerDescription
|
||||||
@@ -24,10 +24,6 @@
|
|||||||
<i class="fa fa-file-o"></i> 10: <strong>@Model.TimeInProgressEstimater.EstimateTimeInProgress(10).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>*@
|
<i class="fa fa-file-o"></i> 100: <strong>@Model.TimeInProgressEstimater.EstimateTimeInProgress(100).ToRoundedReadableString()</strong>*@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-3">
|
|
||||||
@DownloadResultsInput()
|
|
||||||
@DownloadResultsOutput_ToUser()
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input name="Q.q" type="text" class="form-control" placeholder="Search for..." value="@Model.Q.q">
|
<input name="Q.q" type="text" class="form-control" placeholder="Search for..." value="@Model.Q.q">
|
||||||
@@ -77,7 +73,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<hr />
|
<hr />
|
||||||
<div class="text-body font-weight-bold pb-3">Curve Variation range minimum</div>
|
<div class="text-body font-weight-bold pb-3">Curve Variation range minimum</div>
|
||||||
<div class="row">
|
<div class="row align-items-end">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@Html.EditorFor(m => m.Q.co2s, new { size = "small", append = "umol/m", prepend = ">" })
|
@Html.EditorFor(m => m.Q.co2s, new { size = "small", append = "umol/m", prepend = ">" })
|
||||||
</div>
|
</div>
|
||||||
@@ -91,6 +87,12 @@
|
|||||||
@Html.EditorFor(m => m.Q.phips2, new { size = "small", prepend = ">" })
|
@Html.EditorFor(m => m.Q.phips2, new { size = "small", prepend = ">" })
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<hr />
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
@Html.EditorFor(m => m.Q.completed)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
@@ -109,8 +111,14 @@
|
|||||||
grid.Column("", format: item => Actions(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" }
|
htmlAttributes: new { @class = "table table-sm table-striped table-bordered table-hover" }
|
||||||
)
|
)
|
||||||
@grid.PagerList()
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row justify-content-end">
|
||||||
|
<div class="col-sm">@grid.PagerList()</div>
|
||||||
|
<div class="col-sm col-lg-5 pl-4 pt-3 pt-sm-0" >
|
||||||
|
<span class="pr-2">Download Results</span>
|
||||||
|
@DownloadResults()
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -263,16 +271,15 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@helper DownloadResultsInput()
|
@helper DownloadResults()
|
||||||
{
|
{
|
||||||
<a class="btn btn-outline-secondary" role="button" href="@Url.Action("DownloadResultsInputZip", "Queue", Model.Q.GetNameValueCollection().ToRouteValueDictionary())">
|
<div class="btn-group" role="group" aria-label="Download">
|
||||||
<span class="fa fa-download"></span> Input
|
<a class="btn btn-outline-secondary small" role="button" href="@Url.Action("DownloadResultsInputZip", "Queue", Model.Q.GetNameValueCollection().ToRouteValueDictionary())">
|
||||||
</a>
|
<span class="fa fa-download"></span> Input
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-outline-secondary small" role="button" href="@Url.Action("DownloadResultsOutputZip", "Queue", Model.Q.GetNameValueCollection().ToRouteValueDictionary())">
|
||||||
|
<span class="fa fa-download"></span> Output
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@helper DownloadResultsOutput_ToUser()
|
|
||||||
{
|
|
||||||
<a class="btn btn-outline-secondary" role="button" href="@Url.Action("DownloadResultsOutputZip", "Queue", Model.Q.GetNameValueCollection().ToRouteValueDictionary())">
|
|
||||||
<span class="fa fa-download"></span> Output
|
|
||||||
</a>
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user