2011-04-10 02:44:01 +00:00
|
|
|
|
using System.Web.Mvc;
|
2010-10-24 07:46:58 +00:00
|
|
|
|
using NzbDrone.Core.Instrumentation;
|
2011-08-22 01:00:12 +00:00
|
|
|
|
using NzbDrone.Web.Models;
|
2010-10-24 07:46:58 +00:00
|
|
|
|
using Telerik.Web.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Web.Controllers
|
|
|
|
|
{
|
|
|
|
|
public class LogController : Controller
|
|
|
|
|
{
|
2011-04-10 00:14:51 +00:00
|
|
|
|
private readonly LogProvider _logProvider;
|
2010-10-24 07:46:58 +00:00
|
|
|
|
|
2011-04-10 00:14:51 +00:00
|
|
|
|
public LogController(LogProvider logProvider)
|
2010-10-24 07:46:58 +00:00
|
|
|
|
{
|
|
|
|
|
_logProvider = logProvider;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ActionResult Index()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
|
2011-08-06 02:04:35 +00:00
|
|
|
|
public JsonResult Clear()
|
2010-10-24 07:46:58 +00:00
|
|
|
|
{
|
|
|
|
|
_logProvider.DeleteAll();
|
2011-08-06 02:04:35 +00:00
|
|
|
|
|
2011-08-22 01:00:12 +00:00
|
|
|
|
return Json(new NotificationResult() { Title = "Logs Cleared" });
|
2010-10-24 07:46:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-09-03 06:41:50 +00:00
|
|
|
|
[GridAction(EnableCustomBinding = true)]
|
|
|
|
|
public ActionResult _AjaxBinding(GridCommand gridCommand)
|
2010-10-24 07:46:58 +00:00
|
|
|
|
{
|
2011-09-03 06:41:50 +00:00
|
|
|
|
var logs = _logProvider.GetPagedLogs(gridCommand.Page, gridCommand.PageSize);
|
|
|
|
|
|
|
|
|
|
return View(new GridModel{ Data = logs.Items, Total = (int)logs.TotalItems });
|
2010-10-24 07:46:58 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2011-04-10 02:44:01 +00:00
|
|
|
|
}
|