Default Log view uses client operations, added all logs view that uses paging (No support for sorting or filtering).

This commit is contained in:
Mark McDowall 2011-09-05 12:59:39 -07:00
commit c13c9d15c4
11 changed files with 146 additions and 15 deletions

View file

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using NLog;
using PetaPoco;
@ -21,6 +22,20 @@ namespace NzbDrone.Core.Instrumentation
return _database.Fetch<Log>();
}
public IList<Log> TopLogs()
{
var logs = _database.Fetch<Log>("SELECT TOP 7500 * FROM Logs ORDER BY Time Desc");
logs.Add(new Log
{
Time = DateTime.Now.AddYears(-100),
Level = "Info",
Logger = "NzbDrone.Core.Instrumentation.LogProvider",
Message = String.Format("Number of logs currently shown: 7500. More may exist, check 'All' to see everything")
});
return logs;
}
public Page<Log> GetPagedLogs(int pageNumber, int pageSize)
{
return _database.Page<Log>(pageNumber, pageSize, "SELECT * FROM Logs ORDER BY Time DESC");