Attempt to get a WebAPI Controller setup
This commit is contained in:
32
src/Umbraco.Web/Editors/LogsController.cs
Normal file
32
src/Umbraco.Web/Editors/LogsController.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user