Add cancel

This commit is contained in:
2017-01-26 08:36:54 -05:00
parent 295b40bed8
commit 4338b4fee5
30 changed files with 333 additions and 62 deletions
+6 -3
View File
@@ -47,15 +47,15 @@ namespace LeafWeb.WebCms.Models
[Display(Name = "Piscal Warning")]
public string OutputWarningMessage { get; set; }
//[UIHint("Status")]
//public string CurrentStatus { get; set; }
[UIHint("LeafInputStatusViewModels")]
public List<LeafInputStatusViewModel> StatusHistory { get; set; }
[HiddenInput(DisplayValue = false)]
public bool HasLeafChart { get; set; }
[HiddenInput(DisplayValue = false)]
public bool HasOutputFiles { get; set; }
[HiddenInput(DisplayValue = false)]
public bool IsRunning { get; set; }
@@ -65,6 +65,9 @@ namespace LeafWeb.WebCms.Models
[HiddenInput(DisplayValue = false)]
public bool IsDeletable { get; set; }
[HiddenInput(DisplayValue = false)]
public bool IsCancellable { get; set; }
static LeafInputDetails()
{
Mapper.CreateMap<LeafInputFile, string>().ConvertUsing(file => file?.Contents.GetString());
@@ -4,7 +4,7 @@ using LeafWeb.Core.Entities;
namespace LeafWeb.WebCms.Models
{
public class ResultItemViewModel
public class QueueItemViewModel
{
public int LeafInputId { get; set; }
public string LeafInputName { get; set; }
@@ -15,16 +15,18 @@ namespace LeafWeb.WebCms.Models
public bool IsRunning { get; set; }
public bool IsComplete { get; set; }
public bool IsDeletable { get; set; }
public bool IsCancellable { get; set; }
public bool IsPending { get; set; }
public bool HasOutputFiles { get; set; }
public string CurrentStatus { get; set; }
//public string[] ErrorMessages { get; set; }
//public string[] LeafOutputFilenames { get; set; }
//public bool HasLeafChartOutputFile { get; set; }
static ResultItemViewModel()
static QueueItemViewModel()
{
Mapper.CreateMap<LeafInput, ResultItemViewModel>()
Mapper.CreateMap<LeafInput, QueueItemViewModel>()
.ForMember(dest => dest.LeafInputId, opt => opt.MapFrom(src => src.Id))
.ForMember(dest => dest.HasLeafChart, opt => opt.ResolveUsing(src => src.OutputFiles.Any(o => o.IsLeafChartFile)))
//.ForMember(dest => dest.LeafOutputFilenames,
@@ -52,7 +54,7 @@ namespace LeafWeb.WebCms.Models
;
}
public ResultItemViewModel(LeafInput leafInput)
public QueueItemViewModel(LeafInput leafInput)
{
Mapper.Map(leafInput, this);
}
+1 -1
View File
@@ -6,6 +6,6 @@ namespace LeafWeb.WebCms.Models
{
public string ServerDescription { get; set; }
public string ServerStatus { get; set; }
public IEnumerable<ResultItemViewModel> Items { get; set; }
public IEnumerable<QueueItemViewModel> Items { get; set; }
}
}