2011-05-19 03:59:12 +00:00
|
|
|
|
using System.Web.Mvc;
|
2011-04-22 06:23:29 +00:00
|
|
|
|
using NzbDrone.Core.Providers;
|
2011-04-22 17:09:06 +00:00
|
|
|
|
using NzbDrone.Core.Providers.Core;
|
2011-04-22 06:23:29 +00:00
|
|
|
|
using NzbDrone.Core.Providers.Jobs;
|
2011-05-09 04:23:57 +00:00
|
|
|
|
using Telerik.Web.Mvc;
|
2011-04-22 06:23:29 +00:00
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Web.Controllers
|
|
|
|
|
{
|
|
|
|
|
public class SystemController : Controller
|
|
|
|
|
{
|
|
|
|
|
private readonly JobProvider _jobProvider;
|
|
|
|
|
private readonly IndexerProvider _indexerProvider;
|
2011-04-22 17:09:06 +00:00
|
|
|
|
private readonly ConfigProvider _configProvider;
|
2011-04-22 06:23:29 +00:00
|
|
|
|
|
2011-04-22 17:09:06 +00:00
|
|
|
|
public SystemController(JobProvider jobProvider, IndexerProvider indexerProvider, ConfigProvider configProvider)
|
2011-04-22 06:23:29 +00:00
|
|
|
|
{
|
|
|
|
|
_jobProvider = jobProvider;
|
|
|
|
|
_indexerProvider = indexerProvider;
|
2011-04-22 17:09:06 +00:00
|
|
|
|
_configProvider = configProvider;
|
2011-04-22 06:23:29 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ActionResult Jobs()
|
|
|
|
|
{
|
|
|
|
|
return View(_jobProvider.All());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ActionResult Indexers()
|
|
|
|
|
{
|
|
|
|
|
return View(_indexerProvider.All());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2011-04-22 17:09:06 +00:00
|
|
|
|
public ActionResult Config()
|
|
|
|
|
{
|
|
|
|
|
return View(_configProvider.All());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2011-05-09 04:23:57 +00:00
|
|
|
|
[GridAction]
|
|
|
|
|
public ActionResult _SelectAjaxEditing()
|
|
|
|
|
{
|
|
|
|
|
return View(new GridModel(_configProvider.All()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[AcceptVerbs(HttpVerbs.Post)]
|
|
|
|
|
[GridAction]
|
|
|
|
|
public ActionResult _SaveAjaxEditing(string key, string value)
|
|
|
|
|
{
|
|
|
|
|
_configProvider.SetValue(key, value);
|
|
|
|
|
return View(new GridModel(_configProvider.All()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[AcceptVerbs(HttpVerbs.Post)]
|
|
|
|
|
[GridAction]
|
|
|
|
|
public ActionResult _InsertAjaxEditing(string key, string value)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
_configProvider.SetValue(key, value);
|
|
|
|
|
return View(new GridModel(_configProvider.All()));
|
|
|
|
|
}
|
2011-04-22 06:23:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|