2011-04-10 05:44:01 +03:00
|
|
|
using System.Web.Mvc;
|
2010-10-24 10:46:58 +03:00
|
|
|
using NzbDrone.Core.Instrumentation;
|
2011-08-22 04:00:12 +03:00
|
|
|
using NzbDrone.Web.Models;
|
2010-10-24 10:46:58 +03:00
|
|
|
using Telerik.Web.Mvc;
|
|
|
|
|
|
|
|
namespace NzbDrone.Web.Controllers
|
|
|
|
{
|
|
|
|
public class LogController : Controller
|
|
|
|
{
|
2011-04-10 03:14:51 +03:00
|
|
|
private readonly LogProvider _logProvider;
|
2010-10-24 10:46:58 +03:00
|
|
|
|
2011-04-10 03:14:51 +03:00
|
|
|
public LogController(LogProvider logProvider)
|
2010-10-24 10:46:58 +03:00
|
|
|
{
|
|
|
|
_logProvider = logProvider;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ActionResult Index()
|
|
|
|
{
|
|
|
|
return View();
|
|
|
|
}
|
|
|
|
|
2011-08-06 05:04:35 +03:00
|
|
|
public JsonResult Clear()
|
2010-10-24 10:46:58 +03:00
|
|
|
{
|
|
|
|
_logProvider.DeleteAll();
|
2011-08-06 05:04:35 +03:00
|
|
|
|
2012-01-19 08:01:47 +03:00
|
|
|
return JsonNotificationResult.Info("Logs Cleared");
|
2011-09-05 22:59:39 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
[GridAction]
|
2011-11-23 09:41:38 +03:00
|
|
|
public ActionResult AjaxBinding()
|
2011-09-05 22:59:39 +03:00
|
|
|
{
|
2011-11-23 08:58:26 +03:00
|
|
|
return View(new GridModel(_logProvider.GetAllLogs()));
|
2010-10-24 10:46:58 +03:00
|
|
|
}
|
|
|
|
}
|
2011-04-10 05:44:01 +03:00
|
|
|
}
|