mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-17 15:02:34 +02:00
Fixed: History grid loads faster (lazy loaded)
This commit is contained in:
parent
69a19b14c8
commit
d44c07b27b
26
NzbDrone.Core/Model/HistoryQueryModel.cs
Normal file
26
NzbDrone.Core/Model/HistoryQueryModel.cs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
using System;
|
||||||
|
using NzbDrone.Core.Repository;
|
||||||
|
using NzbDrone.Core.Repository.Quality;
|
||||||
|
using PetaPoco;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.Model
|
||||||
|
{
|
||||||
|
public class HistoryQueryModel
|
||||||
|
{
|
||||||
|
public int HistoryId { get; set; }
|
||||||
|
public int EpisodeId { get; set; }
|
||||||
|
public int SeriesId { get; set; }
|
||||||
|
public string NzbTitle { get; set; }
|
||||||
|
public QualityTypes Quality { get; set; }
|
||||||
|
public DateTime Date { get; set; }
|
||||||
|
public bool IsProper { get; set; }
|
||||||
|
public string Indexer { get; set; }
|
||||||
|
public string NzbInfoUrl { get; set; }
|
||||||
|
|
||||||
|
public string EpisodeTitle { get; set; }
|
||||||
|
public int SeasonNumber { get; set; }
|
||||||
|
public int EpisodeNumber { get; set; }
|
||||||
|
public string EpisodeOverview { get; set; }
|
||||||
|
public string SeriesTitle { get; set; }public int Id { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -123,6 +123,10 @@
|
|||||||
<StartupObject />
|
<StartupObject />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="DataTables.Mvc.Core, Version=0.1.0.85, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\packages\DataTables.Mvc.Core.0.1.0.85\lib\DataTables.Mvc.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="DeskMetrics.NET">
|
<Reference Include="DeskMetrics.NET">
|
||||||
<HintPath>..\Libraries\DeskMetrics\DeskMetrics.NET.dll</HintPath>
|
<HintPath>..\Libraries\DeskMetrics\DeskMetrics.NET.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@ -251,6 +255,7 @@
|
|||||||
<Compile Include="Jobs\RefreshEpsiodeMetadata.cs" />
|
<Compile Include="Jobs\RefreshEpsiodeMetadata.cs" />
|
||||||
<Compile Include="Jobs\PastWeekBacklogSearchJob.cs" />
|
<Compile Include="Jobs\PastWeekBacklogSearchJob.cs" />
|
||||||
<Compile Include="Jobs\SearchHistoryCleanupJob.cs" />
|
<Compile Include="Jobs\SearchHistoryCleanupJob.cs" />
|
||||||
|
<Compile Include="Model\HistoryQueryModel.cs" />
|
||||||
<Compile Include="Model\DownloadClientType.cs" />
|
<Compile Include="Model\DownloadClientType.cs" />
|
||||||
<Compile Include="Instrumentation\LogDbContext.cs" />
|
<Compile Include="Instrumentation\LogDbContext.cs" />
|
||||||
<Compile Include="Instrumentation\LogProvider.cs" />
|
<Compile Include="Instrumentation\LogProvider.cs" />
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using DataTables.Mvc.Core.Helpers;
|
||||||
|
using DataTables.Mvc.Core.Models;
|
||||||
using Ninject;
|
using Ninject;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Core.Model;
|
using NzbDrone.Core.Model;
|
||||||
@ -77,5 +79,42 @@ public virtual void Delete(int historyId)
|
|||||||
{
|
{
|
||||||
_database.Delete<History>(historyId);
|
_database.Delete<History>(historyId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual Page<HistoryQueryModel> GetPagedItems(DataTablesPageRequest pageRequest)
|
||||||
|
{
|
||||||
|
var query = Sql.Builder
|
||||||
|
.Select(@"History.*, Series.Title as SeriesTitle, Episodes.Title as EpisodeTitle,
|
||||||
|
Episodes.SeasonNumber as SeasonNumber, Episodes.EpisodeNumber as EpisodeNumber,
|
||||||
|
Episodes.Overview as EpisodeOverview")
|
||||||
|
.From("History")
|
||||||
|
.InnerJoin("Series")
|
||||||
|
.On("History.SeriesId = Series.SeriesId")
|
||||||
|
.InnerJoin("Episodes")
|
||||||
|
.On("History.EpisodeId = Episodes.EpisodeId");
|
||||||
|
|
||||||
|
var startPage = (pageRequest.DisplayLength == 0) ? 1 : pageRequest.DisplayStart / pageRequest.DisplayLength + 1;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(pageRequest.Search))
|
||||||
|
{
|
||||||
|
var whereClause = string.Join(" OR ", SqlBuilderHelper.GetSearchClause(pageRequest));
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(whereClause))
|
||||||
|
query.Append("WHERE " + whereClause, "%" + pageRequest.Search + "%");
|
||||||
|
}
|
||||||
|
|
||||||
|
var orderBy = string.Join(",", SqlBuilderHelper.GetOrderByClause(pageRequest));
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(orderBy))
|
||||||
|
{
|
||||||
|
query.Append("ORDER BY " + orderBy);
|
||||||
|
}
|
||||||
|
|
||||||
|
return _database.Page<HistoryQueryModel>(startPage, pageRequest.DisplayLength, query);
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual long Count()
|
||||||
|
{
|
||||||
|
return _database.Single<long>(@"SELECT COUNT(*) from History");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
|
<package id="DataTables.Mvc.Core" version="0.1.0.85" />
|
||||||
<package id="DotNetZip" version="1.9.1.8" />
|
<package id="DotNetZip" version="1.9.1.8" />
|
||||||
<package id="EntityFramework" version="4.3.0" />
|
<package id="EntityFramework" version="4.3.0" />
|
||||||
<package id="EntityFramework.SqlServerCompact" version="4.1.8482.2" />
|
<package id="EntityFramework.SqlServerCompact" version="4.1.8482.2" />
|
||||||
|
@ -10,8 +10,8 @@ public static class DataTablesModelBinderActivator
|
|||||||
{
|
{
|
||||||
public static void Start()
|
public static void Start()
|
||||||
{
|
{
|
||||||
if (!ModelBinders.Binders.ContainsKey(typeof(DataTablesParams)))
|
if (!ModelBinders.Binders.ContainsKey(typeof(DataTablesPageRequest)))
|
||||||
ModelBinders.Binders.Add(typeof(DataTablesParams), new DataTablesModelBinder());
|
ModelBinders.Binders.Add(typeof(DataTablesPageRequest), new DataTablesModelBinder());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,6 +1,9 @@
|
|||||||
using System.Linq;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Linq.Dynamic;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using System.Web.Script.Serialization;
|
using System.Web.Script.Serialization;
|
||||||
|
using DataTables.Mvc.Core.Models;
|
||||||
using NzbDrone.Core.Helpers;
|
using NzbDrone.Core.Helpers;
|
||||||
using NzbDrone.Core.Jobs;
|
using NzbDrone.Core.Jobs;
|
||||||
using NzbDrone.Core.Providers;
|
using NzbDrone.Core.Providers;
|
||||||
@ -24,15 +27,46 @@ public ActionResult Index()
|
|||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
public JsonResult AjaxBinding()
|
//public JsonResult AjaxBinding()
|
||||||
|
//{
|
||||||
|
// var history = _historyProvider.AllItemsWithRelationships().Select(h => new HistoryModel
|
||||||
|
// {
|
||||||
|
// HistoryId = h.HistoryId,
|
||||||
|
// SeriesId = h.SeriesId,
|
||||||
|
// EpisodeNumbering = string.Format("{0}x{1:00}", h.Episode.SeasonNumber, h.Episode.EpisodeNumber),
|
||||||
|
// EpisodeTitle = h.Episode.Title,
|
||||||
|
// EpisodeOverview = h.Episode.Overview,
|
||||||
|
// SeriesTitle = h.SeriesTitle,
|
||||||
|
// SeriesTitleSorter = SortHelper.SkipArticles(h.SeriesTitle),
|
||||||
|
// NzbTitle = h.NzbTitle,
|
||||||
|
// Quality = h.Quality.ToString(),
|
||||||
|
// IsProper = h.IsProper,
|
||||||
|
// Date = h.Date.ToString(),
|
||||||
|
// DateSorter = h.Date.ToString("MM/dd/yyyy h:mm:ss tt"),
|
||||||
|
// Indexer = h.Indexer,
|
||||||
|
// EpisodeId = h.EpisodeId,
|
||||||
|
// NzbInfoUrl = h.NzbInfoUrl
|
||||||
|
// }).OrderByDescending(h => h.Date).ToList();
|
||||||
|
|
||||||
|
// return Json(new
|
||||||
|
// {
|
||||||
|
// aaData = history
|
||||||
|
// },
|
||||||
|
// JsonRequestBehavior.AllowGet);
|
||||||
|
//}
|
||||||
|
|
||||||
|
public ActionResult AjaxBinding(DataTablesPageRequest pageRequest)
|
||||||
{
|
{
|
||||||
var history = _historyProvider.AllItemsWithRelationships().Select(h => new HistoryModel
|
var pageResult = _historyProvider.GetPagedItems(pageRequest);
|
||||||
|
var totalItems = _historyProvider.Count();
|
||||||
|
|
||||||
|
var items = pageResult.Items.Select(h => new HistoryModel
|
||||||
{
|
{
|
||||||
HistoryId = h.HistoryId,
|
HistoryId = h.HistoryId,
|
||||||
SeriesId = h.SeriesId,
|
SeriesId = h.SeriesId,
|
||||||
EpisodeNumbering = string.Format("{0}x{1:00}", h.Episode.SeasonNumber, h.Episode.EpisodeNumber),
|
EpisodeNumbering = string.Format("{0}x{1:00}", h.SeasonNumber, h.EpisodeNumber),
|
||||||
EpisodeTitle = h.Episode.Title,
|
EpisodeTitle = h.EpisodeTitle,
|
||||||
EpisodeOverview = h.Episode.Overview,
|
EpisodeOverview = h.EpisodeOverview,
|
||||||
SeriesTitle = h.SeriesTitle,
|
SeriesTitle = h.SeriesTitle,
|
||||||
SeriesTitleSorter = SortHelper.SkipArticles(h.SeriesTitle),
|
SeriesTitleSorter = SortHelper.SkipArticles(h.SeriesTitle),
|
||||||
NzbTitle = h.NzbTitle,
|
NzbTitle = h.NzbTitle,
|
||||||
@ -43,11 +77,14 @@ public JsonResult AjaxBinding()
|
|||||||
Indexer = h.Indexer,
|
Indexer = h.Indexer,
|
||||||
EpisodeId = h.EpisodeId,
|
EpisodeId = h.EpisodeId,
|
||||||
NzbInfoUrl = h.NzbInfoUrl
|
NzbInfoUrl = h.NzbInfoUrl
|
||||||
}).OrderByDescending(h => h.Date).ToList();
|
});
|
||||||
|
|
||||||
return Json(new
|
return Json(new
|
||||||
{
|
{
|
||||||
aaData = history
|
sEcho = pageRequest.Echo,
|
||||||
|
iTotalRecords = totalItems,
|
||||||
|
iTotalDisplayRecords = pageResult.TotalItems,
|
||||||
|
aaData = items
|
||||||
},
|
},
|
||||||
JsonRequestBehavior.AllowGet);
|
JsonRequestBehavior.AllowGet);
|
||||||
}
|
}
|
||||||
|
@ -52,36 +52,36 @@ public JsonResult Clear()
|
|||||||
return JsonNotificationResult.Info("Logs Cleared");
|
return JsonNotificationResult.Info("Logs Cleared");
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult AjaxBinding(DataTablesParams dataTablesParams)
|
public ActionResult AjaxBinding(DataTablesPageRequest pageRequest)
|
||||||
{
|
{
|
||||||
var logs = _logProvider.GetAllLogs();
|
var logs = _logProvider.GetAllLogs();
|
||||||
var totalCount = logs.Count();
|
var totalCount = logs.Count();
|
||||||
|
|
||||||
IQueryable<Log> q = logs;
|
IQueryable<Log> q = logs;
|
||||||
if (!string.IsNullOrEmpty(dataTablesParams.sSearch))
|
if (!string.IsNullOrEmpty(pageRequest.Search))
|
||||||
{
|
{
|
||||||
q = q.Where(b => b.Logger.Contains(dataTablesParams.sSearch)
|
q = q.Where(b => b.Logger.Contains(pageRequest.Search)
|
||||||
|| b.Exception.Contains(dataTablesParams.sSearch)
|
|| b.Exception.Contains(pageRequest.Search)
|
||||||
|| b.Message.Contains(dataTablesParams.sSearch));
|
|| b.Message.Contains(pageRequest.Search));
|
||||||
}
|
}
|
||||||
|
|
||||||
int filteredCount = q.Count();
|
int filteredCount = q.Count();
|
||||||
|
|
||||||
IQueryable<Log> sorted = q;
|
IQueryable<Log> sorted = q;
|
||||||
|
|
||||||
for (int i = 0; i < dataTablesParams.iSortingCols; i++)
|
for (int i = 0; i < pageRequest.SortingCols; i++)
|
||||||
{
|
{
|
||||||
int sortCol = dataTablesParams.iSortCol[i];
|
int sortCol = pageRequest.SortCol[i];
|
||||||
var sortColName = sortCol == 0 ? "Time" : sortCol == 1 ? "Level" : "Logger";
|
var sortColName = sortCol == 0 ? "Time" : sortCol == 1 ? "Level" : "Logger";
|
||||||
var sortExpression = String.Format("{0} {1}", sortColName, dataTablesParams.sSortDir[i]);
|
var sortExpression = String.Format("{0} {1}", sortColName, pageRequest.SortDir[i]);
|
||||||
|
|
||||||
sorted = sorted.OrderBy(sortExpression);
|
sorted = sorted.OrderBy(sortExpression);
|
||||||
}
|
}
|
||||||
|
|
||||||
IQueryable<Log> filteredAndSorted = sorted;
|
IQueryable<Log> filteredAndSorted = sorted;
|
||||||
if (filteredCount > dataTablesParams.iDisplayLength)
|
if (filteredCount > pageRequest.DisplayLength)
|
||||||
{
|
{
|
||||||
filteredAndSorted = sorted.Skip(dataTablesParams.iDisplayStart).Take(dataTablesParams.iDisplayLength);
|
filteredAndSorted = sorted.Skip(pageRequest.DisplayStart).Take(pageRequest.DisplayLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
var logModels = filteredAndSorted.ToList().Select(s => new LogModel
|
var logModels = filteredAndSorted.ToList().Select(s => new LogModel
|
||||||
@ -97,7 +97,7 @@ public ActionResult AjaxBinding(DataTablesParams dataTablesParams)
|
|||||||
|
|
||||||
return Json(new
|
return Json(new
|
||||||
{
|
{
|
||||||
sEcho = dataTablesParams.sEcho,
|
sEcho = pageRequest.Echo,
|
||||||
iTotalRecords = totalCount,
|
iTotalRecords = totalCount,
|
||||||
iTotalDisplayRecords = filteredCount,
|
iTotalDisplayRecords = filteredCount,
|
||||||
aaData = logModels
|
aaData = logModels
|
||||||
|
@ -53,9 +53,9 @@
|
|||||||
<PlatformTarget>x86</PlatformTarget>
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="DataTables.Mvc.Core">
|
<Reference Include="DataTables.Mvc.Core, Version=0.1.0.85, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\DataTables.Mvc.0.1.0.79\lib\DataTables.Mvc.Core.dll</HintPath>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<Private>True</Private>
|
<HintPath>..\packages\DataTables.Mvc.Core.0.1.0.85\lib\DataTables.Mvc.Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Dynamic">
|
<Reference Include="Dynamic">
|
||||||
<HintPath>..\packages\DynamicQuery.1.0\lib\35\Dynamic.dll</HintPath>
|
<HintPath>..\packages\DynamicQuery.1.0\lib\35\Dynamic.dll</HintPath>
|
||||||
@ -142,9 +142,9 @@
|
|||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\Libraries\TvdbLib.dll</HintPath>
|
<HintPath>..\Libraries\TvdbLib.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="WebActivator, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="WebActivator, Version=1.5.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\packages\WebActivator.1.5\lib\net40\WebActivator.dll</HintPath>
|
<HintPath>..\packages\WebActivator.1.5.1\lib\net40\WebActivator.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -363,6 +363,7 @@
|
|||||||
<Content Include="Scripts\DataTables-1.9.0\media\js\jquery.dataTables.editable.js" />
|
<Content Include="Scripts\DataTables-1.9.0\media\js\jquery.dataTables.editable.js" />
|
||||||
<Content Include="Scripts\DataTables-1.9.0\media\js\jquery.dataTables.js" />
|
<Content Include="Scripts\DataTables-1.9.0\media\js\jquery.dataTables.js" />
|
||||||
<Content Include="Scripts\DataTables-1.9.0\media\js\jquery.dataTables.min.js" />
|
<Content Include="Scripts\DataTables-1.9.0\media\js\jquery.dataTables.min.js" />
|
||||||
|
<Content Include="Scripts\DataTables-1.9.0\media\js\jquery.dataTablesFilteringDelay.js" />
|
||||||
<Content Include="Scripts\DataTables-1.9.0\media\js\jquery.jeditable.js" />
|
<Content Include="Scripts\DataTables-1.9.0\media\js\jquery.jeditable.js" />
|
||||||
<Content Include="Scripts\jquery-1.7.1-vsdoc.js" />
|
<Content Include="Scripts\jquery-1.7.1-vsdoc.js" />
|
||||||
<Content Include="Scripts\jquery-1.7.1.min.js" />
|
<Content Include="Scripts\jquery-1.7.1.min.js" />
|
||||||
|
@ -0,0 +1,33 @@
|
|||||||
|
$.fn.dataTableExt.oApi.fnSetFilteringDelay = function (oSettings, iDelay) {
|
||||||
|
/*
|
||||||
|
* Inputs: object:oSettings - dataTables settings object - automatically given
|
||||||
|
* integer:iDelay - delay in milliseconds
|
||||||
|
* Usage: $('#example').dataTable().fnSetFilteringDelay(250);
|
||||||
|
* Author: Zygimantas Berziunas (www.zygimantas.com) and Allan Jardine
|
||||||
|
* License: GPL v2 or BSD 3 point style
|
||||||
|
* Contact: zygimantas.berziunas /AT\ hotmail.com
|
||||||
|
*/
|
||||||
|
var _that = this,
|
||||||
|
iDelay = (typeof iDelay == 'undefined') ? 250 : iDelay;
|
||||||
|
|
||||||
|
this.each(function (i) {
|
||||||
|
$.fn.dataTableExt.iApiIndex = i;
|
||||||
|
var oTimerId = null,
|
||||||
|
sPreviousSearch = null,
|
||||||
|
anControl = $('input', _that.fnSettings().aanFeatures.f);
|
||||||
|
|
||||||
|
anControl.unbind('keyup').bind('keyup', function () {
|
||||||
|
if (sPreviousSearch === null || sPreviousSearch != anControl.val()) {
|
||||||
|
window.clearTimeout(oTimerId);
|
||||||
|
sPreviousSearch = anControl.val();
|
||||||
|
oTimerId = window.setTimeout(function () {
|
||||||
|
$.fn.dataTableExt.iApiIndex = i;
|
||||||
|
_that.fnFilter(anControl.val());
|
||||||
|
}, iDelay);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return this;
|
||||||
|
});
|
||||||
|
return this;
|
||||||
|
};
|
@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
oTable = $('#historyGrid').dataTable({
|
oTable = $('#historyGrid').dataTable({
|
||||||
"sAjaxSource": "History/AjaxBinding",
|
"sAjaxSource": "History/AjaxBinding",
|
||||||
"bServerSide": false,
|
"bServerSide": true,
|
||||||
"bProcessing": true,
|
"bProcessing": true,
|
||||||
"bShowAll": false,
|
"bShowAll": false,
|
||||||
"bPaginate": true,
|
"bPaginate": true,
|
||||||
@ -59,7 +59,7 @@
|
|||||||
"sPaginationType": "four_button",
|
"sPaginationType": "four_button",
|
||||||
"aoColumns": [
|
"aoColumns": [
|
||||||
{
|
{
|
||||||
sWidth: '20px', "bSortable": false, "mDataProp": function (source, type, val) {
|
sName: 'Icon', sWidth: '20px', "bSortable": false, "bSearchable": false, "mDataProp": function (source, type, val) {
|
||||||
// 'display' and 'filter' use the image
|
// 'display' and 'filter' use the image
|
||||||
if (type === 'display' || type === 'filter') {
|
if (type === 'display' || type === 'filter') {
|
||||||
if (source['Indexer'].indexOf("Newznab") === 0)
|
if (source['Indexer'].indexOf("Newznab") === 0)
|
||||||
@ -71,7 +71,8 @@
|
|||||||
return source["Indexer"];
|
return source["Indexer"];
|
||||||
}
|
}
|
||||||
}, //Image
|
}, //Image
|
||||||
{ sWidth: 'auto', "mDataProp": function (source, type, val) {
|
{
|
||||||
|
sName: 'Series.Title', sWidth: 'auto', "mDataProp": function (source, type, val) {
|
||||||
// 'display' and 'filter' use our fancy naming
|
// 'display' and 'filter' use our fancy naming
|
||||||
if (type === 'display' || type === 'filter') {
|
if (type === 'display' || type === 'filter') {
|
||||||
return "<a href='/Series/Details?seriesId=" + source["SeriesId"] + "'>" + source["SeriesTitle"] + "</a>";
|
return "<a href='/Series/Details?seriesId=" + source["SeriesId"] + "'>" + source["SeriesTitle"] + "</a>";
|
||||||
@ -80,10 +81,10 @@
|
|||||||
return source["SeriesTitleSorter"];
|
return source["SeriesTitleSorter"];
|
||||||
}
|
}
|
||||||
}, //Series Title
|
}, //Series Title
|
||||||
{ sWidth: '80px', "mDataProp": "EpisodeNumbering", "bSortable": false }, //EpisodeNumbering
|
{ sName: 'EpisodeNumbering', sWidth: '80px', "mDataProp": "EpisodeNumbering", "bSortable": false, "bSearchable": false }, //EpisodeNumbering
|
||||||
{ sWidth: 'auto', "mDataProp": "EpisodeTitle", "bSortable": false }, //Episode Title
|
{ sName: 'Episodes.Title', sWidth: 'auto', "mDataProp": "EpisodeTitle", "bSortable": false }, //Episode Title
|
||||||
{ sWidth: '70px', "mDataProp": "Quality", "bSortable": false }, //Quality
|
{ sName: 'Quality', sWidth: '70px', "mDataProp": "Quality", "bSortable": false, "bSearchable": false }, //Quality
|
||||||
{ sWidth: '150px', "mDataProp": function (source, type, val) {
|
{ sName: 'Date', sWidth: '150px', "bSearchable": false, "mDataProp": function (source, type, val) {
|
||||||
// 'display' and 'filter' use our fancy naming
|
// 'display' and 'filter' use our fancy naming
|
||||||
if (type === 'display' || type === 'filter') {
|
if (type === 'display' || type === 'filter') {
|
||||||
return source["Date"];
|
return source["Date"];
|
||||||
@ -92,7 +93,7 @@
|
|||||||
return source["DateSorter"];
|
return source["DateSorter"];
|
||||||
}
|
}
|
||||||
}, //Date
|
}, //Date
|
||||||
{ sWidth: '40px', "mDataProp": "HistoryId", "bSortable": false, "fnRender": function (row) {
|
{ sName: 'Actions', sWidth: '40px', "mDataProp": "HistoryId", "bSortable": false, "bSearchable": false, "fnRender": function (row) {
|
||||||
var deleteImage = "<img src=\"../../Content/Images/close.png\" alt=\"Delete\" title=\"Delete from History\" class=\"gridAction\" onclick=\"deleteHistory(this.parentNode.parentNode, " + row.aData["HistoryId"] + ")\">";
|
var deleteImage = "<img src=\"../../Content/Images/close.png\" alt=\"Delete\" title=\"Delete from History\" class=\"gridAction\" onclick=\"deleteHistory(this.parentNode.parentNode, " + row.aData["HistoryId"] + ")\">";
|
||||||
var redownloadImage = "<img src=\"../../Content/Images/redownload.png\" alt=\"Redownload\" title=\Redownload Episode\" class=\"gridAction\" onclick=\"redownloadHistory(this.parentNode.parentNode, " + row.aData["HistoryId"] + ", " + row.aData["EpisodeId"] + ")\">";
|
var redownloadImage = "<img src=\"../../Content/Images/redownload.png\" alt=\"Redownload\" title=\Redownload Episode\" class=\"gridAction\" onclick=\"redownloadHistory(this.parentNode.parentNode, " + row.aData["HistoryId"] + ", " + row.aData["EpisodeId"] + ")\">";
|
||||||
|
|
||||||
@ -100,9 +101,10 @@
|
|||||||
}
|
}
|
||||||
}, //Actions
|
}, //Actions
|
||||||
{
|
{
|
||||||
sWidth: 'auto',
|
sName: 'Details', sWidth: 'auto',
|
||||||
"mDataProp": "Details",
|
"mDataProp": "Details",
|
||||||
"bSortable": false,
|
"bSortable": false,
|
||||||
|
"bSearchable": false,
|
||||||
"bVisible": false,
|
"bVisible": false,
|
||||||
"fnRender": function(row) {
|
"fnRender": function(row) {
|
||||||
var result = "<b>Overview: </b>" + row.aData["EpisodeOverview"] + "<br/>" +
|
var result = "<b>Overview: </b>" + row.aData["EpisodeOverview"] + "<br/>" +
|
||||||
@ -118,7 +120,7 @@
|
|||||||
} //Details
|
} //Details
|
||||||
],
|
],
|
||||||
"aaSorting": [[5, 'desc']]
|
"aaSorting": [[5, 'desc']]
|
||||||
});
|
}).fnSetFilteringDelay(500);
|
||||||
});
|
});
|
||||||
|
|
||||||
function deleteHistory(row, historyId) {
|
function deleteHistory(row, historyId) {
|
||||||
|
@ -44,7 +44,8 @@
|
|||||||
@Html.IncludeScript("DataTables-1.9.0/media/js/jquery.dataTables.min.js")
|
@Html.IncludeScript("DataTables-1.9.0/media/js/jquery.dataTables.min.js")
|
||||||
@Html.IncludeScript("DataTables-1.9.0/media/js/jquery.dataTables.reloadAjax.js")
|
@Html.IncludeScript("DataTables-1.9.0/media/js/jquery.dataTables.reloadAjax.js")
|
||||||
@Html.IncludeScript("DataTables-1.9.0/media/js/jquery.dataTables.editable.js")
|
@Html.IncludeScript("DataTables-1.9.0/media/js/jquery.dataTables.editable.js")
|
||||||
@Html.IncludeScript("DataTables-1.9.0/media/js/jquery.jeditable.js")
|
@Html.IncludeScript("DataTables-1.9.0/media/js/jquery.jeditable.js")s
|
||||||
|
@Html.IncludeScript("DataTables-1.9.0/media/js/jquery.dataTablesFilteringDelay.js")
|
||||||
@Html.IncludeScript("jquery.dataTables.4button.pagination.js")
|
@Html.IncludeScript("jquery.dataTables.4button.pagination.js")
|
||||||
@RenderSection("Scripts", required: false)
|
@RenderSection("Scripts", required: false)
|
||||||
</body>
|
</body>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="DataTables.Mvc" version="0.1.0.79" />
|
<package id="DataTables.Mvc" version="0.1.0.85" />
|
||||||
|
<package id="DataTables.Mvc.Core" version="0.1.0.85" />
|
||||||
<package id="DynamicQuery" version="1.0" />
|
<package id="DynamicQuery" version="1.0" />
|
||||||
<package id="EntityFramework" version="4.3.0" />
|
<package id="EntityFramework" version="4.3.0" />
|
||||||
<package id="EntityFramework.SqlServerCompact" version="4.1.8482.2" />
|
<package id="EntityFramework.SqlServerCompact" version="4.1.8482.2" />
|
||||||
@ -27,5 +28,5 @@
|
|||||||
<package id="SignalR.Js" version="0.4.0.1" />
|
<package id="SignalR.Js" version="0.4.0.1" />
|
||||||
<package id="SignalR.Server" version="0.4.0.0" />
|
<package id="SignalR.Server" version="0.4.0.0" />
|
||||||
<package id="SqlServerCompact" version="4.0.8482.1" />
|
<package id="SqlServerCompact" version="4.0.8482.1" />
|
||||||
<package id="WebActivator" version="1.5" />
|
<package id="WebActivator" version="1.5.1" />
|
||||||
</packages>
|
</packages>
|
19
ServiceHelpers/ServiceInstall/ServiceInstall.ncrunchproject
Normal file
19
ServiceHelpers/ServiceInstall/ServiceInstall.ncrunchproject
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<ProjectConfiguration>
|
||||||
|
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
|
||||||
|
<ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing>
|
||||||
|
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
|
||||||
|
<AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking>
|
||||||
|
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
|
||||||
|
<IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely>
|
||||||
|
<RunPreBuildEvents>false</RunPreBuildEvents>
|
||||||
|
<RunPostBuildEvents>false</RunPostBuildEvents>
|
||||||
|
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
|
||||||
|
<InstrumentAssembly>true</InstrumentAssembly>
|
||||||
|
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
|
||||||
|
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
|
||||||
|
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
|
||||||
|
<DefaultTestTimeout>60000</DefaultTestTimeout>
|
||||||
|
<UseBuildConfiguration />
|
||||||
|
<ProxyProcessPath />
|
||||||
|
<UseCPUArchitecture>AutoDetect</UseCPUArchitecture>
|
||||||
|
</ProjectConfiguration>
|
@ -0,0 +1,19 @@
|
|||||||
|
<ProjectConfiguration>
|
||||||
|
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
|
||||||
|
<ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing>
|
||||||
|
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
|
||||||
|
<AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking>
|
||||||
|
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
|
||||||
|
<IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely>
|
||||||
|
<RunPreBuildEvents>false</RunPreBuildEvents>
|
||||||
|
<RunPostBuildEvents>false</RunPostBuildEvents>
|
||||||
|
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
|
||||||
|
<InstrumentAssembly>true</InstrumentAssembly>
|
||||||
|
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
|
||||||
|
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
|
||||||
|
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
|
||||||
|
<DefaultTestTimeout>60000</DefaultTestTimeout>
|
||||||
|
<UseBuildConfiguration />
|
||||||
|
<ProxyProcessPath />
|
||||||
|
<UseCPUArchitecture>AutoDetect</UseCPUArchitecture>
|
||||||
|
</ProjectConfiguration>
|
Binary file not shown.
Binary file not shown.
17
packages/DataTables.Mvc.0.1.0.85/Content/App_Start/DataTablesMvc.cs.pp
vendored
Normal file
17
packages/DataTables.Mvc.0.1.0.85/Content/App_Start/DataTablesMvc.cs.pp
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
using DataTables.Mvc.Core.Helpers;
|
||||||
|
using DataTables.Mvc.Core.Models;
|
||||||
|
using System.Web.Mvc;
|
||||||
|
|
||||||
|
[assembly: WebActivator.PreApplicationStartMethod(typeof($rootnamespace$.App_Start.DataTablesModelBinderActivator), "Start")]
|
||||||
|
|
||||||
|
namespace $rootnamespace$.App_Start
|
||||||
|
{
|
||||||
|
public static class DataTablesModelBinderActivator
|
||||||
|
{
|
||||||
|
public static void Start()
|
||||||
|
{
|
||||||
|
if (!ModelBinders.Binders.ContainsKey(typeof(DataTablesPageRequest)))
|
||||||
|
ModelBinders.Binders.Add(typeof(DataTablesPageRequest), new DataTablesModelBinder());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
BIN
packages/DataTables.Mvc.0.1.0.85/DataTables.Mvc.0.1.0.85.nupkg
vendored
Normal file
BIN
packages/DataTables.Mvc.0.1.0.85/DataTables.Mvc.0.1.0.85.nupkg
vendored
Normal file
Binary file not shown.
5
packages/DataTables.Mvc.0.1.0.85/tools/install.ps1
vendored
Normal file
5
packages/DataTables.Mvc.0.1.0.85/tools/install.ps1
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
param($installPath, $toolsPath, $package, $project)
|
||||||
|
|
||||||
|
$path = [System.IO.Path]
|
||||||
|
$appstart = $path::Combine($path::GetDirectoryName($project.FileName), "App_Start\DataTablesMvc.cs")
|
||||||
|
$DTE.ItemOperations.OpenFile($appstart)
|
BIN
packages/DataTables.Mvc.Core.0.1.0.85/DataTables.Mvc.Core.0.1.0.85.nupkg
vendored
Normal file
BIN
packages/DataTables.Mvc.Core.0.1.0.85/DataTables.Mvc.Core.0.1.0.85.nupkg
vendored
Normal file
Binary file not shown.
BIN
packages/DataTables.Mvc.Core.0.1.0.85/lib/DataTables.Mvc.Core.dll
vendored
Normal file
BIN
packages/DataTables.Mvc.Core.0.1.0.85/lib/DataTables.Mvc.Core.dll
vendored
Normal file
Binary file not shown.
BIN
packages/WebActivator.1.5.1/WebActivator.1.5.1.nupkg
vendored
Normal file
BIN
packages/WebActivator.1.5.1/WebActivator.1.5.1.nupkg
vendored
Normal file
Binary file not shown.
BIN
packages/WebActivator.1.5.1/lib/net40/WebActivator.dll
vendored
Normal file
BIN
packages/WebActivator.1.5.1/lib/net40/WebActivator.dll
vendored
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user