System/Indexers moved to DataTables

pull/2/head
Mark McDowall 13 years ago
parent 185edfb7f7
commit f21f3517cf

@ -65,7 +65,10 @@ namespace NzbDrone.Web.Controllers
public ActionResult Indexers() public ActionResult Indexers()
{ {
return View(_indexerProvider.All()); var indexers = _indexerProvider.All();
var serialized = new JavaScriptSerializer().Serialize(indexers);
return View((object)serialized);
} }
public ActionResult Config() public ActionResult Config()

@ -1,5 +1,43 @@
@model IEnumerable<NzbDrone.Core.Repository.IndexerDefinition> @model string
@{ViewBag.Title = "Indexers";}
@{Html.Telerik().Grid(Model).Name("Grid") <div class="grid-container">
.TableHtmlAttributes(new { @class = "Grid" }) <table id="indexersGrid" class="dataTablesGrid hidden-grid no-details">
.Render();} <thead>
<tr>
<th>ID</th>
<th>Enable</th>
<th>Index Provider Type</th>
<th>Name</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
@section Scripts{
<script type="text/javascript">
$(document).ready(function() {
$('#indexersGrid').removeClass('hidden-grid');
oTable = $('.dataTablesGrid').dataTable({
"bShowAll": false,
"aaData": @Html.Raw(Model),
"bPaginate": false,
"bLengthChange": false,
"bFilter": false,
"bSort": false,
"bInfo": false,
"bAutoWidth": false,
"iDisplayLength": 20,
"sPaginationType": "four_button",
"aoColumns": [
{ sWidth: '100px', "mDataProp": "Id"}, //Id
{ sWidth: '100px', "mDataProp": "Enable"}, //Enable
{ sWidth: 'autopx', "mDataProp": "IndexProviderType" }, //Type
{ sWidth: '150px', "mDataProp": "Name" } //Name
]
});
});
</script>
}

@ -102,34 +102,4 @@
}); });
}); });
</script> </script>
} }
@*@{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(@<text> @{ 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)
}
}
</text>))
.Sortable(c=>c.OrderBy(col=>col.Add(g=>g.Interval)))
.Render();}
<h1>Items currently in queue</h1>
@{Html.Telerik().Grid((IEnumerable<JobQueueItemModel>)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();}*@
Loading…
Cancel
Save