Menus are now custom built, using AJAX loading of links where acceptable.

This commit is contained in:
Mark McDowall 2011-08-05 19:04:35 -07:00
commit aa82264774
16 changed files with 130 additions and 111 deletions

View file

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NzbDrone.Core.Providers.Jobs;
namespace NzbDrone.Web.Controllers
{
public class CommandController : Controller
{
private readonly JobProvider _jobProvider;
public CommandController(JobProvider jobProvider)
{
_jobProvider = jobProvider;
}
public JsonResult RssSync()
{
_jobProvider.QueueJob(typeof(RssSyncJob));
return new JsonResult { Data = "ok" };
}
public JsonResult SyncEpisodesOnDisk(int seriesId)
{
//Syncs the episodes on disk for the specified series
_jobProvider.QueueJob(typeof(DiskScanJob), seriesId);
return new JsonResult { Data = "ok" };
}
public JsonResult UpdateInfo(int seriesId)
{
//Syncs the episodes on disk for the specified series
_jobProvider.QueueJob(typeof(UpdateInfoJob), seriesId);
return new JsonResult { Data = "ok" };
}
public JsonResult RenameSeries(int seriesId)
{
//Syncs the episodes on disk for the specified series
//_jobProvider.QueueJob(typeof(UpdateInfoJob), seriesId);
return new JsonResult { Data = "ok" };
}
}
}

View file

@ -26,16 +26,16 @@ namespace NzbDrone.Web.Controllers
return View();
}
public ActionResult Trim()
public JsonResult Trim()
{
_historyProvider.Trim();
return RedirectToAction("Index");
return new JsonResult { Data = "ok" };
}
public ActionResult Purge()
public JsonResult Purge()
{
_historyProvider.Purge();
return RedirectToAction("Index");
return new JsonResult { Data = "ok" };
}
[GridAction]

View file

@ -18,11 +18,11 @@ namespace NzbDrone.Web.Controllers
return View();
}
public ActionResult Clear()
public JsonResult Clear()
{
_logProvider.DeleteAll();
return RedirectToAction("Index");
return new JsonResult { Data = "ok" };
}
[GridAction]

View file

@ -47,12 +47,6 @@ namespace NzbDrone.Web.Controllers
return View();
}
public ActionResult RssSync()
{
_jobProvider.QueueJob(typeof(RssSyncJob));
return RedirectToAction("Index");
}
public ActionResult SeasonEditor(int seriesId)
{
var model = new List<SeasonEditModel>();
@ -185,21 +179,6 @@ namespace NzbDrone.Web.Controllers
return View(model);
}
public ActionResult SyncEpisodesOnDisk(int seriesId)
{
//Syncs the episodes on disk for the specified series
_jobProvider.QueueJob(typeof(DiskScanJob), seriesId);
return RedirectToAction("Details", new { seriesId });
}
public ActionResult UpdateInfo(int seriesId)
{
//Syncs the episodes on disk for the specified series
_jobProvider.QueueJob(typeof(UpdateInfoJob), seriesId);
return RedirectToAction("Details", new { seriesId });
}
private List<SeriesModel> GetSeriesModels(IList<Series> seriesInDb)
{
var series = seriesInDb.Select(s => new SeriesModel