1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Web/Controllers/SharedController.cs
Mark McDowall 4212da9146 Free diskspace in UI
New: View Diskspace for root directories visible in UI
#ND-98 fixed
2012-12-22 21:35:36 -08:00

40 lines
1.1 KiB
C#

using System.Web.Mvc;
using NzbDrone.Common;
using NzbDrone.Core.Providers;
using NzbDrone.Web.Models;
namespace NzbDrone.Web.Controllers
{
public class SharedController : Controller
{
private readonly EnvironmentProvider _environmentProvider;
private readonly RootDirProvider _rootDirProvider;
public SharedController(EnvironmentProvider environmentProvider, RootDirProvider rootDirProvider)
{
_environmentProvider = environmentProvider;
_rootDirProvider = rootDirProvider;
}
public ActionResult Index()
{
return RedirectToAction("Index", "Series");
}
[ChildActionOnly]
[OutputCache(Duration = 3600)]
public ActionResult Footer()
{
return PartialView(new FooterModel { BuildTime = _environmentProvider.BuildDateTime, Version = _environmentProvider.Version });
}
[ChildActionOnly]
//[OutputCache(Duration = 600)]
public ActionResult FreeSpace()
{
var rootDirs = _rootDirProvider.AllWithFreeSpace();
return PartialView(rootDirs);
}
}
}