mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-12 08:07:10 -07:00
Update logs are now in the UI
This commit is contained in:
parent
54e5874770
commit
3520b56bb6
11 changed files with 158 additions and 25 deletions
|
@ -1,5 +1,8 @@
|
|||
using System.Linq;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Core.Providers;
|
||||
using NzbDrone.Core.Providers.Jobs;
|
||||
using NzbDrone.Web.Models;
|
||||
|
@ -10,23 +13,39 @@ namespace NzbDrone.Web.Controllers
|
|||
{
|
||||
private readonly UpdateProvider _updateProvider;
|
||||
private readonly JobProvider _jobProvider;
|
||||
private readonly EnviromentProvider _enviromentProvider;
|
||||
private readonly DiskProvider _diskProvider;
|
||||
|
||||
public UpdateController(UpdateProvider updateProvider, JobProvider jobProvider)
|
||||
public UpdateController(UpdateProvider updateProvider, JobProvider jobProvider,
|
||||
EnviromentProvider enviromentProvider, DiskProvider diskProvider)
|
||||
{
|
||||
_updateProvider = updateProvider;
|
||||
_jobProvider = jobProvider;
|
||||
_enviromentProvider = enviromentProvider;
|
||||
_diskProvider = diskProvider;
|
||||
}
|
||||
|
||||
public ActionResult Index()
|
||||
{
|
||||
return View(_updateProvider.GetAvilableUpdate());
|
||||
var updateModel = new UpdateModel();
|
||||
updateModel.UpdatePackage = _updateProvider.GetAvilableUpdate();
|
||||
updateModel.LogFiles = _updateProvider.UpdateLogFile();
|
||||
updateModel.LogFolder = _enviromentProvider.GetUpdateLogFolder();
|
||||
|
||||
return View(updateModel);
|
||||
}
|
||||
|
||||
public ActionResult StartUpdate()
|
||||
{
|
||||
_jobProvider.QueueJob(typeof(AppUpdateJob), 0, 0);
|
||||
|
||||
return Json(new NotificationResult() { Title = "Update will begin shortly", NotificationType = NotificationType.Info, Text = "NzbDrone will restart automatically."});
|
||||
return Json(new NotificationResult { Title = "Update will begin shortly", NotificationType = NotificationType.Info, Text = "NzbDrone will restart automatically." });
|
||||
}
|
||||
|
||||
public ActionResult ViewLog( string filepath)
|
||||
{
|
||||
ViewBag.Log = _diskProvider.ReadAllText(filepath).Replace(Environment.NewLine, "<br/>");
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue