2012-01-14 22:50:37 -08:00
|
|
|
using System.Web.Mvc;
|
2011-11-08 09:48:34 -08:00
|
|
|
using NzbDrone.Common;
|
2012-12-22 21:35:36 -08:00
|
|
|
using NzbDrone.Core.Providers;
|
2011-11-08 09:48:34 -08:00
|
|
|
using NzbDrone.Web.Models;
|
2011-01-28 22:10:22 -08:00
|
|
|
|
|
|
|
namespace NzbDrone.Web.Controllers
|
|
|
|
{
|
|
|
|
public class SharedController : Controller
|
|
|
|
{
|
2012-03-06 18:59:43 -08:00
|
|
|
private readonly EnvironmentProvider _environmentProvider;
|
2012-12-22 21:35:36 -08:00
|
|
|
private readonly RootDirProvider _rootDirProvider;
|
2011-02-09 22:51:04 -08:00
|
|
|
|
2012-12-22 21:35:36 -08:00
|
|
|
public SharedController(EnvironmentProvider environmentProvider, RootDirProvider rootDirProvider)
|
2011-02-09 22:51:04 -08:00
|
|
|
{
|
2012-03-06 18:59:43 -08:00
|
|
|
_environmentProvider = environmentProvider;
|
2012-12-22 21:35:36 -08:00
|
|
|
_rootDirProvider = rootDirProvider;
|
2011-02-09 22:51:04 -08:00
|
|
|
}
|
2011-01-28 22:10:22 -08:00
|
|
|
|
|
|
|
public ActionResult Index()
|
|
|
|
{
|
|
|
|
return RedirectToAction("Index", "Series");
|
|
|
|
}
|
|
|
|
|
|
|
|
[ChildActionOnly]
|
2012-01-14 22:50:37 -08:00
|
|
|
[OutputCache(Duration = 3600)]
|
2011-01-28 22:10:22 -08:00
|
|
|
public ActionResult Footer()
|
|
|
|
{
|
2012-03-06 18:59:43 -08:00
|
|
|
return PartialView(new FooterModel { BuildTime = _environmentProvider.BuildDateTime, Version = _environmentProvider.Version });
|
2011-01-28 22:10:22 -08:00
|
|
|
}
|
2012-12-22 21:35:36 -08:00
|
|
|
|
|
|
|
[ChildActionOnly]
|
2012-12-22 22:03:26 -08:00
|
|
|
[OutputCache(Duration = 600)]
|
2012-12-22 21:35:36 -08:00
|
|
|
public ActionResult FreeSpace()
|
|
|
|
{
|
2012-12-23 23:16:43 -08:00
|
|
|
var rootDirs = _rootDirProvider.FreeSpaceOnDrives();
|
2012-12-22 21:35:36 -08:00
|
|
|
|
|
|
|
return PartialView(rootDirs);
|
|
|
|
}
|
2011-01-28 22:10:22 -08:00
|
|
|
}
|
2011-04-09 19:44:01 -07:00
|
|
|
}
|