From f21f3517cf25d364ca5f03c94dc20d8667534d58 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 9 Feb 2012 22:26:48 -0800 Subject: [PATCH] System/Indexers moved to DataTables --- NzbDrone.Web/Controllers/SystemController.cs | 5 +- NzbDrone.Web/Views/System/Indexers.cshtml | 48 ++++++++++++++++++-- NzbDrone.Web/Views/System/Jobs.cshtml | 32 +------------ 3 files changed, 48 insertions(+), 37 deletions(-) diff --git a/NzbDrone.Web/Controllers/SystemController.cs b/NzbDrone.Web/Controllers/SystemController.cs index 427af1098..40343b88b 100644 --- a/NzbDrone.Web/Controllers/SystemController.cs +++ b/NzbDrone.Web/Controllers/SystemController.cs @@ -65,7 +65,10 @@ namespace NzbDrone.Web.Controllers public ActionResult Indexers() { - return View(_indexerProvider.All()); + var indexers = _indexerProvider.All(); + var serialized = new JavaScriptSerializer().Serialize(indexers); + + return View((object)serialized); } public ActionResult Config() diff --git a/NzbDrone.Web/Views/System/Indexers.cshtml b/NzbDrone.Web/Views/System/Indexers.cshtml index 0a5a6a656..e9dd0e203 100644 --- a/NzbDrone.Web/Views/System/Indexers.cshtml +++ b/NzbDrone.Web/Views/System/Indexers.cshtml @@ -1,5 +1,43 @@ -@model IEnumerable -@{ViewBag.Title = "Indexers";} -@{Html.Telerik().Grid(Model).Name("Grid") - .TableHtmlAttributes(new { @class = "Grid" }) - .Render();} +@model string + +
+ + + + + + + + + + + +
IDEnableIndex Provider TypeName
+
+ +@section Scripts{ + +} \ No newline at end of file diff --git a/NzbDrone.Web/Views/System/Jobs.cshtml b/NzbDrone.Web/Views/System/Jobs.cshtml index 39961a747..f4328cf9c 100644 --- a/NzbDrone.Web/Views/System/Jobs.cshtml +++ b/NzbDrone.Web/Views/System/Jobs.cshtml @@ -102,34 +102,4 @@ }); }); -} - - - - -@*@{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)) - .Columns(c => c.Bound(g => g.Name)) - .Columns(c => c.Bound(g => g.Interval)) - .Columns(c => c.Bound(g => g.LastExecution)) - .Columns(c => c.Bound(g => g.Success)) - .Columns(c => c.Bound(g => g.Id) - .Title("Command") - .Template(@ @{ if(item.Enable) - { - @Ajax.ImageActionLink("../../Content/Images/Gear.png", new { Alt = "Run", Width = 18, Height = 18, Title = "Run Job" }, "RunJob", new { TypeName = item.TypeName }, null, null) - } - } - )) - .Sortable(c=>c.OrderBy(col=>col.Add(g=>g.Interval))) - .Render();} - -

Items currently in queue

- - @{Html.Telerik().Grid((IEnumerable)ViewData["Queue"]).Name("QueueGrid") - .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 +} \ No newline at end of file