2019-11-15 11:07:37 +01:00
|
|
|
using Umbraco.Core;
|
|
|
|
|
using Umbraco.Core.Cache;
|
|
|
|
|
using Umbraco.Core.Configuration;
|
2020-03-25 15:06:22 +11:00
|
|
|
using Umbraco.Core.Hosting;
|
2019-11-15 11:07:37 +01:00
|
|
|
using Umbraco.Core.Logging;
|
2020-01-20 14:15:54 -08:00
|
|
|
using Umbraco.Core.Mapping;
|
2019-11-15 11:07:37 +01:00
|
|
|
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;
|
2020-02-14 13:04:49 +01:00
|
|
|
using Umbraco.Web.Routing;
|
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
|
|
|
|
|
{
|
2020-03-25 15:06:22 +11:00
|
|
|
private readonly IHostingEnvironment _hosting;
|
2019-11-15 11:07:37 +01:00
|
|
|
|
2020-02-14 13:04:49 +01:00
|
|
|
public WebProfilingController(
|
|
|
|
|
IGlobalSettings globalSettings,
|
|
|
|
|
IUmbracoContextAccessor umbracoContextAccessor,
|
|
|
|
|
ISqlContext sqlContext,
|
|
|
|
|
ServiceContext services,
|
|
|
|
|
AppCaches appCaches,
|
|
|
|
|
IProfilingLogger logger,
|
|
|
|
|
IRuntimeState runtimeState,
|
|
|
|
|
IShortStringHelper shortStringHelper,
|
|
|
|
|
UmbracoMapper umbracoMapper,
|
2020-03-25 15:06:22 +11:00
|
|
|
IPublishedUrlProvider publishedUrlProvider,
|
|
|
|
|
IHostingEnvironment hosting)
|
2020-03-03 11:59:17 +01:00
|
|
|
: base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, shortStringHelper, umbracoMapper, publishedUrlProvider)
|
2019-11-15 11:07:37 +01:00
|
|
|
{
|
2020-03-25 15:06:22 +11:00
|
|
|
_hosting = hosting;
|
2019-11-15 11:07:37 +01:00
|
|
|
}
|
|
|
|
|
|
2019-06-23 12:40:23 +02:00
|
|
|
public object GetStatus()
|
|
|
|
|
{
|
|
|
|
|
return new
|
|
|
|
|
{
|
2020-03-25 15:06:22 +11:00
|
|
|
Enabled = _hosting.IsDebugMode
|
2019-06-23 12:40:23 +02:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}}
|