2019-11-15 11:07:37 +01:00
|
|
|
using Umbraco.Core;
|
|
|
|
|
using Umbraco.Core.Cache;
|
|
|
|
|
using Umbraco.Core.Configuration;
|
|
|
|
|
using Umbraco.Core.Logging;
|
|
|
|
|
using Umbraco.Core.Persistence;
|
|
|
|
|
using Umbraco.Core.Services;
|
2019-12-20 17:36:44 +01:00
|
|
|
using Umbraco.Core.Strings;
|
2019-11-15 11:07:37 +01:00
|
|
|
using Umbraco.Web.Editors;
|
2019-06-23 12:40:23 +02:00
|
|
|
using Umbraco.Web.WebApi.Filters;
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Profiling
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The API controller used to display the state of the web profiler
|
|
|
|
|
/// </summary>
|
|
|
|
|
[UmbracoApplicationAuthorize(Core.Constants.Applications.Settings)]
|
|
|
|
|
public class WebProfilingController : UmbracoAuthorizedJsonController
|
|
|
|
|
{
|
2019-11-15 11:07:37 +01:00
|
|
|
private readonly IRuntimeState _runtimeState;
|
|
|
|
|
|
2019-12-20 17:36:44 +01:00
|
|
|
public WebProfilingController(IGlobalSettings globalSettings, IUmbracoContextAccessor umbracoContextAccessor, ISqlContext sqlContext, ServiceContext services, AppCaches appCaches, IProfilingLogger logger, IRuntimeState runtimeState, UmbracoHelper umbracoHelper, IShortStringHelper shortStringHelper)
|
|
|
|
|
: base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, umbracoHelper, shortStringHelper)
|
2019-11-15 11:07:37 +01:00
|
|
|
{
|
|
|
|
|
_runtimeState = runtimeState;
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-23 12:40:23 +02:00
|
|
|
public object GetStatus()
|
|
|
|
|
{
|
|
|
|
|
return new
|
|
|
|
|
{
|
2019-11-15 11:07:37 +01:00
|
|
|
Enabled = _runtimeState.Debug
|
2019-06-23 12:40:23 +02:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}}
|