File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,6 +56,9 @@ public sealed record MyUIOptions
5656 [ JsonPropertyName ( "collaborationService" ) ]
5757 public string CollaborationService { get ; set ; }
5858
59+ [ JsonPropertyName ( "disable" ) ]
60+ public bool Disable { get ; set ; }
61+
5962 public sealed class MapOptions
6063 {
6164 [ JsonPropertyName ( "type" ) ]
Original file line number Diff line number Diff line change 77
88using Microsoft . Extensions . FileProviders ;
99using Microsoft . Net . Http . Headers ;
10+ using Squidex . Areas . Api . Controllers . UI ;
1011using Squidex . Areas . Frontend . Middlewares ;
1112using Squidex . Hosting . Web ;
1213using Squidex . Pipeline . Squid ;
@@ -17,8 +18,14 @@ namespace Squidex.Areas.Frontend;
1718
1819public static class Startup
1920{
20- public static void UseFrontend ( this IApplicationBuilder app )
21+ public static void UseFrontend ( this IApplicationBuilder app , IConfiguration config )
2122 {
23+ var uiOptions = config . GetSection ( "ui" ) . Get < MyUIOptions > ( ) ;
24+ if ( uiOptions is { Disable : true } )
25+ {
26+ return ;
27+ }
28+
2229 var environment = app . ApplicationServices . GetRequiredService < IWebHostEnvironment > ( ) ;
2330
2431 var fileProvider = environment . WebRootFileProvider ;
Original file line number Diff line number Diff line change @@ -19,8 +19,14 @@ namespace Squidex.Config.Domain;
1919
2020public static class FontendServices
2121{
22- public static void AddSquidexFrontend ( this IServiceCollection services )
22+ public static void AddSquidexFrontend ( this IServiceCollection services , IConfiguration config )
2323 {
24+ var uiOptions = config . GetSection ( "ui" ) . Get < MyUIOptions > ( ) ;
25+ if ( uiOptions is { Disable : true } )
26+ {
27+ return ;
28+ }
29+
2430 services . Configure < MyUIOptions > ( ( services , options ) =>
2531 {
2632 var jsonOptions = services . GetRequiredService < JsonSerializerOptions > ( ) ;
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ public void ConfigureServices(IServiceCollection services)
4343 services . AddSquidexContents ( config ) ;
4444 services . AddSquidexControllerServices ( config ) ;
4545 services . AddSquidexEventSourcing ( config ) ;
46- services . AddSquidexFrontend ( ) ;
46+ services . AddSquidexFrontend ( config ) ;
4747 services . AddSquidexGraphQL ( ) ;
4848 services . AddSquidexHealthChecks ( config ) ;
4949 services . AddSquidexHistory ( config ) ;
@@ -119,7 +119,7 @@ public void Configure(IApplicationBuilder app)
119119 builder . Use404 ( ) ;
120120 } ) ;
121121
122- app . UseFrontend ( ) ;
122+ app . UseFrontend ( config ) ;
123123 app . UsePlugins ( ) ;
124124 }
125125}
Original file line number Diff line number Diff line change 149149 },
150150
151151 "ui" : {
152+ // Admin UI disable
153+ "disable" : false ,
154+
152155 // Regex suggestions for the UI
153156 "regexSuggestions" : {
154157 // Regex for emails.
You can’t perform that action at this time.
0 commit comments