diff --git a/src/UniversalDashboard.Materialize/Components/ud-navigation.jsx b/src/UniversalDashboard.Materialize/Components/ud-navigation.jsx index 9990fa40..5ef33459 100644 --- a/src/UniversalDashboard.Materialize/Components/ud-navigation.jsx +++ b/src/UniversalDashboard.Materialize/Components/ud-navigation.jsx @@ -136,10 +136,10 @@ class UDSideNavItem extends React.Component { if (!url.startsWith("/")) { url = "/" + url; } - this.props.history.push(`${url.replace(/ /g, "-")}`); + this.props.history.push(`${window.baseUrl + url.replace(/ /g, "-")}`); } else if (this.props.name != null) { - this.props.history.push(`/${this.props.name.replace(/ /g, "-")}`); + this.props.history.push(window.baseUrl + `/${this.props.name.replace(/ /g, "-")}`); } if (!this.props.fixed) { diff --git a/src/UniversalDashboard/Controllers/ComponentController.cs b/src/UniversalDashboard/Controllers/ComponentController.cs index f340fc0f..856573a7 100644 --- a/src/UniversalDashboard/Controllers/ComponentController.cs +++ b/src/UniversalDashboard/Controllers/ComponentController.cs @@ -21,6 +21,7 @@ using UniversalDashboard.Interfaces; using UniversalDashboard.Models.Basics; using System.Security; +using StackExchange.Profiling; namespace UniversalDashboard.Controllers { @@ -80,13 +81,16 @@ private async Task RunScript(Endpoint endpoint, Dictionary + using (MiniProfiler.Current.Step($"Execute: {endpoint.Name}")) { - var result = _executionService.ExecuteEndpoint(executionContext, endpoint); - var actionResult = ConvertToActionResult(result); + return await Task.Run(() => + { + var result = _executionService.ExecuteEndpoint(executionContext, endpoint); + var actionResult = ConvertToActionResult(result); - return actionResult; - }); + return actionResult; + }); + } } catch (Exception ex) { Log.Warn("RunScript() " + ex.Message + Environment.NewLine + ex.StackTrace); diff --git a/src/UniversalDashboard/Server/ServerStartup.cs b/src/UniversalDashboard/Server/ServerStartup.cs index e00d29d3..e58044e6 100644 --- a/src/UniversalDashboard/Server/ServerStartup.cs +++ b/src/UniversalDashboard/Server/ServerStartup.cs @@ -1,7 +1,5 @@ using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.FileProviders; @@ -15,7 +13,6 @@ using Microsoft.Extensions.Hosting; using UniversalDashboard.Interfaces; using Microsoft.AspNetCore.Mvc.Filters; -using UniversalDashboard.Controllers; using System.IO; using UniversalDashboard.Utilities; @@ -71,6 +68,8 @@ public void ConfigureServices(IServiceCollection services) options.Cookie.SecurePolicy = CookieSecurePolicy.SameAsRequest; }); + services.AddMiniProfiler(); + var serviceDescriptor = services.FirstOrDefault(descriptor => descriptor.ServiceType.Name == "IRegistryPolicyResolver"); services.Remove(serviceDescriptor); } @@ -152,6 +151,8 @@ public void Configure(IApplicationBuilder app, Microsoft.AspNetCore.Hosting.IHos app.UseSession(); + app.UseMiniProfiler(); + app.UseMvc(); } } diff --git a/src/UniversalDashboard/UniversalDashboard.csproj b/src/UniversalDashboard/UniversalDashboard.csproj index 61aff7da..a3b024f1 100644 --- a/src/UniversalDashboard/UniversalDashboard.csproj +++ b/src/UniversalDashboard/UniversalDashboard.csproj @@ -28,6 +28,7 @@ + diff --git a/src/client/src/app/ud-dashboard.jsx b/src/client/src/app/ud-dashboard.jsx index 44442d3c..1c66fc79 100644 --- a/src/client/src/app/ud-dashboard.jsx +++ b/src/client/src/app/ud-dashboard.jsx @@ -350,15 +350,15 @@ export default class UdDashboard extends React.Component { {staticPages} {dynamicPages} - - } /> + + } /> , }> , , - }>