diff --git a/NzbDrone.Web/Controllers/SystemController.cs b/NzbDrone.Web/Controllers/SystemController.cs index ae6b99a9d..427af1098 100644 --- a/NzbDrone.Web/Controllers/SystemController.cs +++ b/NzbDrone.Web/Controllers/SystemController.cs @@ -36,15 +36,31 @@ namespace NzbDrone.Web.Controllers public ActionResult Jobs() { - ViewData["Queue"] = _jobProvider.Queue.Select(c => new JobQueueItemModel + var queue = _jobProvider.Queue.Select(c => new JobQueueItemModel { Name = c.JobType.Name, TargetId = c.TargetId, SecondaryTargetId = c.SecondaryTargetId }); - var jobs = _jobProvider.All(); - return View(jobs); + var serializedQueue = new JavaScriptSerializer().Serialize(queue); + + ViewData["Queue"] = serializedQueue; + + var jobs = _jobProvider.All().Select(j => new JobModel + { + Id = j.Id, + Enable = j.Enable, + TypeName = j.TypeName, + Name = j.Name, + Interval = j.Interval, + LastExecution = j.LastExecution.ToString(), + Success = j.Success + }).OrderBy(j => j.Interval); + + var serializedJobs = new JavaScriptSerializer().Serialize(jobs); + + return View((object)serializedJobs); } public ActionResult Indexers() diff --git a/NzbDrone.Web/Models/JobModel.cs b/NzbDrone.Web/Models/JobModel.cs new file mode 100644 index 000000000..2f1df5a59 --- /dev/null +++ b/NzbDrone.Web/Models/JobModel.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace NzbDrone.Web.Models +{ + public class JobModel + { + public Int32 Id { get; set; } + public Boolean Enable { get; set; } + public String TypeName { get; set; } + public String Name { get; set; } + public Int32 Interval { get; set; } + public String LastExecution { get; set; } + public Boolean Success { get; set; } + public string Actions { get; set; } + } +} \ No newline at end of file diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index 4d3a79049..cd4c97de0 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -245,6 +245,7 @@ + diff --git a/NzbDrone.Web/Views/History/Index.cshtml b/NzbDrone.Web/Views/History/Index.cshtml index ee05c6824..bc4a4eca7 100644 --- a/NzbDrone.Web/Views/History/Index.cshtml +++ b/NzbDrone.Web/Views/History/Index.cshtml @@ -71,7 +71,7 @@ { sWidth: 'auto', "mDataProp": "SeriesTitle" }, //Series Title { sWidth: '80px', "mDataProp": "EpisodeNumbering", "bSortable": false }, //EpisodeNumbering { sWidth: 'auto', "mDataProp": "EpisodeTitle", "bSortable": false }, //Episode Title - { sWidth: '70px', "mDataProp": "Quality", "bSoratble": false }, //Quality + { sWidth: '70px', "mDataProp": "Quality", "bSortable": false }, //Quality { sWidth: '150px', "mDataProp": "Date" }, //Grabbed On { sWidth: '40px', "mDataProp": "HistoryId", "bSortable": false, "fnRender": function (row) { var deleteImage = "\"Delete\""; diff --git a/NzbDrone.Web/Views/System/Jobs.cshtml b/NzbDrone.Web/Views/System/Jobs.cshtml index bd8d2a766..39961a747 100644 --- a/NzbDrone.Web/Views/System/Jobs.cshtml +++ b/NzbDrone.Web/Views/System/Jobs.cshtml @@ -1,9 +1,113 @@ @using NzbDrone.Web.Models @using NzbDrone.Web.Helpers -@model IEnumerable +@model string @{ViewBag.Title = "Jobs";} - @{Html.Telerik().Grid(Model).Name("Grid") +@section HeaderContent +{ + @Html.IncludeCss("Grid.css") +} + +
+ + + + + + + + + + + + @*Commands Column*@ + + + + + +
IDEnableType NameNameIntervalLast ExecutionSuccessActions
+
+ +

Items currently in queue

+ +
+ + + + + + + + + + +
TypeTargetSecondary
+
+ +@section Scripts{ + +} + + + + +@*@{Html.Telerik().Grid(Model).Name("Grid") .Columns(c => c.Bound(g => g.Id)) .Columns(c => c.Bound(g => g.Enable)) .Columns(c => c.Bound(g => g.TypeName)) @@ -28,4 +132,4 @@ .Columns(c => c.Bound(g => g.Name).Title("Type").Width(100)) .Columns(c => c.Bound(g => g.TargetId).Title("Target")) .Columns(c => c.Bound(g => g.SecondaryTargetId).Title("Secondary Target")) - .Render();} \ No newline at end of file + .Render();}*@ \ No newline at end of file