Feature: Job Queues

Also UI style, theme and element changes
This commit is contained in:
Gary Sharp
2014-02-03 14:50:08 +11:00
parent bdb3e1e6b4
commit 3f63281dc4
212 changed files with 17334 additions and 5441 deletions
@@ -4,7 +4,7 @@ using System.Linq;
using System.Web;
using Disco.Data.Repository;
using Disco.Models.UI.Config.AuthorizationRole;
using Disco.Models.Authorization;
using Disco.Models.Services.Authorization;
namespace Disco.Web.Areas.Config.Models.AuthorizationRole
{
@@ -1,4 +1,4 @@
using Disco.Models.Authorization;
using Disco.Models.Services.Authorization;
using Disco.Models.Interop.ActiveDirectory;
using Disco.Models.UI.Config.AuthorizationRole;
using Disco.Web.Models.Shared;
@@ -16,17 +16,7 @@ namespace Disco.Web.Areas.Config.Models.DocumentTemplate
public List<Disco.BI.Expressions.Expression> TemplateExpressions { get; set; }
public List<string> Types { get; set; }
public List<string> SubTypes { get; set; }
public List<Disco.Models.Repository.JobType> JobTypes { get; set; }
public List<Disco.Models.Repository.JobSubType> JobSubTypes { get; set; }
public ShowModel()
{
this.Types = new List<string>();
this.SubTypes = new List<string>();
}
public List<string> Scopes
{
@@ -53,23 +43,7 @@ namespace Disco.Web.Areas.Config.Models.DocumentTemplate
}
if (this.JobTypes == null)
JobTypes = Database.JobTypes.ToList();
if (this.JobSubTypes == null)
JobSubTypes = Database.JobSubTypes.ToList();
if (DocumentTemplate != null)
{
if (DocumentTemplate.JobSubTypes != null)
{
foreach (var jst in DocumentTemplate.JobSubTypes)
{
if (!Types.Contains(jst.JobTypeId))
Types.Add(jst.JobTypeId);
SubTypes.Add(string.Format("{0}_{1}", jst.JobTypeId, jst.Id));
}
}
}
JobTypes = Database.JobTypes.Include("JobSubTypes").ToList();
}
}
}
@@ -0,0 +1,13 @@
using Disco.Models.UI.Config.JobQueue;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Disco.Web.Areas.Config.Models.JobQueue
{
public class CreateModel : ConfigJobQueueCreateModel
{
public Disco.Models.Repository.JobQueue JobQueue { get; set; }
}
}
@@ -0,0 +1,14 @@
using Disco.Models.Services.Jobs.JobQueues;
using Disco.Models.UI.Config.JobQueue;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Disco.Web.Areas.Config.Models.JobQueue
{
public class IndexModel : ConfigJobQueueIndexModel
{
public List<IJobQueueToken> Tokens { get; set; }
}
}
@@ -0,0 +1,46 @@
using Disco.Models.Interop.ActiveDirectory;
using Disco.Models.Services.Jobs.JobQueues;
using Disco.Models.UI.Config.JobQueue;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Disco.Web.Areas.Config.Models.JobQueue
{
public class ShowModel : ConfigJobQueueShowModel
{
public IJobQueueToken Token { get; set; }
public List<SubjectDescriptor> Subjects { get; set; }
public class SubjectDescriptor
{
public bool IsGroup { get; set; }
public string Name { get; set; }
public string Id { get; set; }
public static SubjectDescriptor FromActiveDirectoryObject(IActiveDirectoryObject ADObject)
{
var item = new SubjectDescriptor()
{
Id = ADObject.SamAccountName,
Name = ADObject.Name
};
if (ADObject is ActiveDirectoryGroup)
item.IsGroup = true;
return item;
}
}
public int OpenJobCount { get; set; }
public int TotalJobCount { get; set; }
public List<Disco.Models.Repository.JobType> JobTypes { get; set; }
public bool CanDelete { get; set; }
}
}