Noah
10 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with
23 additions and
4 deletions
-
backend/src/Squidex/Areas/Api/Controllers/UI/MyUIOptions.cs
-
backend/src/Squidex/Areas/Frontend/Startup.cs
-
backend/src/Squidex/Config/Domain/FontendServices.cs
-
backend/src/Squidex/Startup.cs
-
backend/src/Squidex/appsettings.json
|
|
|
@ -56,6 +56,9 @@ public sealed record MyUIOptions |
|
|
|
[JsonPropertyName("collaborationService")] |
|
|
|
public string CollaborationService { get; set; } |
|
|
|
|
|
|
|
[JsonPropertyName("disable")] |
|
|
|
public bool Disable { get; set; } |
|
|
|
|
|
|
|
public sealed class MapOptions |
|
|
|
{ |
|
|
|
[JsonPropertyName("type")] |
|
|
|
|
|
|
|
@ -7,6 +7,7 @@ |
|
|
|
|
|
|
|
using Microsoft.Extensions.FileProviders; |
|
|
|
using Microsoft.Net.Http.Headers; |
|
|
|
using Squidex.Areas.Api.Controllers.UI; |
|
|
|
using Squidex.Areas.Frontend.Middlewares; |
|
|
|
using Squidex.Hosting.Web; |
|
|
|
using Squidex.Pipeline.Squid; |
|
|
|
@ -17,8 +18,14 @@ namespace Squidex.Areas.Frontend; |
|
|
|
|
|
|
|
public static class Startup |
|
|
|
{ |
|
|
|
public static void UseFrontend(this IApplicationBuilder app) |
|
|
|
public static void UseFrontend(this IApplicationBuilder app, IConfiguration config) |
|
|
|
{ |
|
|
|
var uiOptions = config.GetSection("ui").Get<MyUIOptions>(); |
|
|
|
if (uiOptions is { Disable: true }) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
var environment = app.ApplicationServices.GetRequiredService<IWebHostEnvironment>(); |
|
|
|
|
|
|
|
var fileProvider = environment.WebRootFileProvider; |
|
|
|
|
|
|
|
@ -19,8 +19,14 @@ namespace Squidex.Config.Domain; |
|
|
|
|
|
|
|
public static class FontendServices |
|
|
|
{ |
|
|
|
public static void AddSquidexFrontend(this IServiceCollection services) |
|
|
|
public static void AddSquidexFrontend(this IServiceCollection services, IConfiguration config) |
|
|
|
{ |
|
|
|
var uiOptions = config.GetSection("ui").Get<MyUIOptions>(); |
|
|
|
if (uiOptions is { Disable: true }) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
services.Configure<MyUIOptions>((services, options) => |
|
|
|
{ |
|
|
|
var jsonOptions = services.GetRequiredService<JsonSerializerOptions>(); |
|
|
|
|
|
|
|
@ -43,7 +43,7 @@ public sealed class Startup(IConfiguration config) |
|
|
|
services.AddSquidexContents(config); |
|
|
|
services.AddSquidexControllerServices(config); |
|
|
|
services.AddSquidexEventSourcing(config); |
|
|
|
services.AddSquidexFrontend(); |
|
|
|
services.AddSquidexFrontend(config); |
|
|
|
services.AddSquidexGraphQL(); |
|
|
|
services.AddSquidexHealthChecks(config); |
|
|
|
services.AddSquidexHistory(config); |
|
|
|
@ -119,7 +119,7 @@ public sealed class Startup(IConfiguration config) |
|
|
|
builder.Use404(); |
|
|
|
}); |
|
|
|
|
|
|
|
app.UseFrontend(); |
|
|
|
app.UseFrontend(config); |
|
|
|
app.UsePlugins(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -149,6 +149,9 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
"ui": { |
|
|
|
// Admin UI disable |
|
|
|
"disable": false, |
|
|
|
|
|
|
|
// Regex suggestions for the UI |
|
|
|
"regexSuggestions": { |
|
|
|
// Regex for emails. |
|
|
|
|