Hidden startup, shutodwn and restart

New: Run without console window by default
New: Added NzbDrone.Console to run with console window
New: Shutdown from UI
New: Restart from UI
This commit is contained in:
Mark McDowall 2013-01-06 00:11:14 -08:00
parent 17d9d0cc4f
commit 125703a2fa
29 changed files with 504 additions and 98 deletions

View file

@ -36,6 +36,16 @@ namespace NzbDrone.Web.Controllers
_statsProvider = statsProvider;
}
public ActionResult Index()
{
return View();
}
public ActionResult Logs()
{
return View();
}
public ActionResult Jobs()
{
var queue = _jobProvider.Queue.Select(c => new JobQueueItemModel
@ -80,32 +90,6 @@ namespace NzbDrone.Web.Controllers
return View((object)serialized);
}
public JsonResult SelectConfigAjax()
{
var config = _configProvider.All();
return Json(new
{
iTotalRecords = config.Count(),
iTotalDisplayRecords = config.Count(),
aaData = config
}, JsonRequestBehavior.AllowGet);
}
[HttpPost]
public string SaveConfigAjax(string id, string value)
{
_configProvider.SetValue(id, value);
return value;
}
[HttpPost]
public string InsertConfigAjax(string key, string value)
{
_configProvider.SetValue(key, value);
return key;
}
//PostDownloadView
public ActionResult PendingProcessing()
{
@ -184,5 +168,43 @@ namespace NzbDrone.Web.Controllers
return View(model);
}
public JsonResult Restart()
{
_jobProvider.QueueJob(typeof(AppRestartJob));
return JsonNotificationResult.Info("NzbDrone will restart shortly");
}
public JsonResult Shutdown()
{
_jobProvider.QueueJob(typeof(AppShutdownJob));
return JsonNotificationResult.Info("NzbDrone will shutdown shortly");
}
public JsonResult SelectConfigAjax()
{
var config = _configProvider.All();
return Json(new
{
iTotalRecords = config.Count(),
iTotalDisplayRecords = config.Count(),
aaData = config
}, JsonRequestBehavior.AllowGet);
}
[HttpPost]
public string SaveConfigAjax(string id, string value)
{
_configProvider.SetValue(id, value);
return value;
}
[HttpPost]
public string InsertConfigAjax(string key, string value)
{
_configProvider.SetValue(key, value);
return key;
}
}
}