Attempt to get a WebAPI Controller setup

This commit is contained in:
Warren
2018-08-27 20:05:59 +01:00
parent cae468eaeb
commit df13af9dc2
2 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
using System.Web.Mvc;
using Umbraco.Core.Logging.Viewer;
using Umbraco.Web.Mvc;
namespace Umbraco.Web.Editors
{
/// <summary>
/// Backoffice controller supporting the dashboard for language administration.
/// </summary>
[PluginController("UmbracoApi")]
public class LogsController : UmbracoAuthorizedJsonController
{
private LogViewer _logViewer;
public LogsController()
{
_logViewer = new LogViewer();
}
[HttpGet]
public int GetNumberOfErrors()
{
return _logViewer.GetNumberOfErrors();
}
[HttpGet]
public LogLevelCounts GetLogLevelCounts()
{
return _logViewer.GetLogLevelCounts();
}
}
}

View File

@@ -113,6 +113,7 @@
<Compile Include="Editors\BackOfficeAssetsController.cs" />
<Compile Include="Editors\BackOfficeModel.cs" />
<Compile Include="Editors\BackOfficeServerVariables.cs" />
<Compile Include="Editors\LogsController.cs" />
<Compile Include="Models\ContentEditing\ContentSavedState.cs" />
<Compile Include="Trees\LogsTreeController.cs" />
<Compile Include="WebApi\HttpActionContextExtensions.cs" />