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.Runtime.CompilerServices;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace LeafWeb.WebCms.Models
|
||||
{
|
||||
@@ -58,6 +56,9 @@ namespace LeafWeb.WebCms.Models
|
||||
[RegularExpression(FloatingPointRegex, ErrorMessage = "Must be numeric")]
|
||||
public string phips2 { get; set; }
|
||||
|
||||
[Display(Name = "Show Only Successfully Completed")]
|
||||
public bool completed { get; set; }
|
||||
|
||||
public bool HasExtendedParameters =>
|
||||
!(
|
||||
string.IsNullOrEmpty(siteid)
|
||||
@@ -70,6 +71,7 @@ namespace LeafWeb.WebCms.Models
|
||||
&& string.IsNullOrEmpty(pari)
|
||||
&& string.IsNullOrEmpty(tleaf)
|
||||
&& string.IsNullOrEmpty(phips2)
|
||||
&& !completed
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace LeafWeb.WebCms.Utility
|
||||
@@ -21,9 +18,15 @@ namespace LeafWeb.WebCms.Utility
|
||||
foreach (var pi in obj.GetType().GetProperties().Where(p => p.CanWrite))
|
||||
{
|
||||
var value = pi.GetValue(obj, null);
|
||||
if (value == null)
|
||||
continue;
|
||||
nvs.Add(prefix + pi.Name, value.ToString());
|
||||
switch (value)
|
||||
{
|
||||
case null:
|
||||
case bool b when b == false:
|
||||
continue;
|
||||
default:
|
||||
nvs.Add(prefix + pi.Name, value.ToString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return nvs;
|
||||
|
||||
@@ -143,6 +143,15 @@ namespace LeafWeb.WebCms.Utility
|
||||
select li;
|
||||
}
|
||||
|
||||
if (query.completed)
|
||||
{
|
||||
resultItems =
|
||||
from li in resultItems
|
||||
where
|
||||
li.CurrentStatus == LeafInputStatusType.Complete
|
||||
select li;
|
||||
}
|
||||
|
||||
return resultItems;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
@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">
|
||||
@Model.Items.Count() results<br />
|
||||
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> 100: <strong>@Model.TimeInProgressEstimater.EstimateTimeInProgress(100).ToRoundedReadableString()</strong>*@
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
@DownloadResultsInput()
|
||||
@DownloadResultsOutput_ToUser()
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="input-group">
|
||||
<input name="Q.q" type="text" class="form-control" placeholder="Search for..." value="@Model.Q.q">
|
||||
@@ -77,7 +73,7 @@
|
||||
</div>
|
||||
<hr />
|
||||
<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">
|
||||
@Html.EditorFor(m => m.Q.co2s, new { size = "small", append = "umol/m", prepend = ">" })
|
||||
</div>
|
||||
@@ -91,6 +87,12 @@
|
||||
@Html.EditorFor(m => m.Q.phips2, new { size = "small", prepend = ">" })
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
@Html.EditorFor(m => m.Q.completed)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -109,8 +111,14 @@
|
||||
grid.Column("", format: item => Actions(item.Value), canSort: false)),
|
||||
htmlAttributes: new { @class = "table table-sm table-striped table-bordered table-hover" }
|
||||
)
|
||||
@grid.PagerList()
|
||||
</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
|
||||
{
|
||||
@@ -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())">
|
||||
<span class="fa fa-download"></span> Input
|
||||
</a>
|
||||
<div class="btn-group" role="group" aria-label="Download">
|
||||
<a class="btn btn-outline-secondary small" role="button" href="@Url.Action("DownloadResultsInputZip", "Queue", Model.Q.GetNameValueCollection().ToRouteValueDictionary())">
|
||||
<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