From 3febdb0e5bf4c9ee3e12d628572ff5ac4bcfdc31 Mon Sep 17 00:00:00 2001 From: Peggy Date: Thu, 5 Dec 2024 14:06:28 -0800 Subject: [PATCH 1/2] fix maintenance page-show images (#1971) # Description This PR includes the following proposed change(s): - screening maintenance - fix image issue --- src/Spd.Presentation.Licensing/Program.cs | 19 +++++++++++-------- src/Spd.Presentation.Screening/Program.cs | 10 ++++++++++ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/Spd.Presentation.Licensing/Program.cs b/src/Spd.Presentation.Licensing/Program.cs index 30a6edd3d..cbf7e9105 100644 --- a/src/Spd.Presentation.Licensing/Program.cs +++ b/src/Spd.Presentation.Licensing/Program.cs @@ -75,15 +75,18 @@ app.UseResponseCaching(); app.UseRequestDecompression(); app.UseResponseCompression(); - app.UseStaticFiles(); - if (app.Configuration.GetValue("MaintenanceMode", false)) - { - app.MapFallbackToFile("maintenance/offline.html"); - } - else + app.Use(async (context, next) => { - app.MapFallbackToFile("index.html"); - } + var isMaintenance = builder.Configuration.GetValue("MaintenanceMode"); // Get the value from appsettings.json + if (isMaintenance && !context.Request.Path.Value.Contains("maintenance")) + { + context.Response.Redirect("/licensing/maintenance/offline.html"); + return; + } + await next(); + }); + app.UseStaticFiles(); + app.MapFallbackToFile("index.html"); app.UseRouting(); app.UseObservabilityMiddleware(); app.UseHealthChecks(); diff --git a/src/Spd.Presentation.Screening/Program.cs b/src/Spd.Presentation.Screening/Program.cs index 78af16c30..867504547 100644 --- a/src/Spd.Presentation.Screening/Program.cs +++ b/src/Spd.Presentation.Screening/Program.cs @@ -77,6 +77,16 @@ app.UseResponseCaching(); app.UseRequestDecompression(); app.UseResponseCompression(); + app.Use(async (context, next) => + { + var isMaintenance = builder.Configuration.GetValue("MaintenanceMode"); // Get the value from appsettings.json + if (isMaintenance && !context.Request.Path.Value.Contains("maintenance")) + { + context.Response.Redirect("/screening/maintenance/offline.html"); + return; + } + await next(); + }); app.UseStaticFiles(); app.MapFallbackToFile("index.html"); app.UseRouting(); From 64bc06a901a31487d86c72aedc0289abe66d818b Mon Sep 17 00:00:00 2001 From: Peggy Date: Thu, 5 Dec 2024 15:04:38 -0800 Subject: [PATCH 2/2] fix screening: angular json (#1972) # Description This PR includes the following proposed change(s): - screening: angular json --- src/Spd.Presentation.Screening/ClientApp/angular.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Spd.Presentation.Screening/ClientApp/angular.json b/src/Spd.Presentation.Screening/ClientApp/angular.json index d452c618b..6a70d25ab 100644 --- a/src/Spd.Presentation.Screening/ClientApp/angular.json +++ b/src/Spd.Presentation.Screening/ClientApp/angular.json @@ -33,7 +33,8 @@ "inlineStyleLanguage": "scss", "assets": [ "src/favicon.ico", - "src/assets" + "src/assets", + "src/maintenance" ], "styles": [ "node_modules/bootstrap/dist/css/bootstrap.min.css", @@ -105,7 +106,8 @@ "inlineStyleLanguage": "scss", "assets": [ "src/favicon.ico", - "src/assets" + "src/assets", + "src/maintenance" ], "styles": [ "node_modules/bootstrap/dist/css/bootstrap.min.css",