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