From 28c5fdc46119e6c127bc667a9bccd5703de0693d Mon Sep 17 00:00:00 2001 From: Yuchen Ji Date: Tue, 21 Jun 2022 15:45:18 +0800 Subject: [PATCH] Remove test pages, update index page --- GC-local-server-rewrite/server/Server.cs | 10 +++++++- MudAdmin/MudAdmin.csproj | 4 ++++ MudAdmin/Pages/Counter.razor | 18 --------------- MudAdmin/Pages/Index.razor | 10 ++------ MudAdmin/Shared/MainLayout.razor | 4 ++-- MudAdmin/Shared/NavMenu.razor | 1 - MudAdmin/wwwroot/news.png | Bin 0 -> 818 bytes MudAdmin/wwwroot/sample-data/weather.json | 27 ---------------------- 8 files changed, 17 insertions(+), 57 deletions(-) delete mode 100644 MudAdmin/Pages/Counter.razor create mode 100644 MudAdmin/wwwroot/news.png delete mode 100644 MudAdmin/wwwroot/sample-data/weather.json diff --git a/GC-local-server-rewrite/server/Server.cs b/GC-local-server-rewrite/server/Server.cs index 160c8c3..1f652fc 100644 --- a/GC-local-server-rewrite/server/Server.cs +++ b/GC-local-server-rewrite/server/Server.cs @@ -43,12 +43,18 @@ public class Server module => module.WithController()) .WithStaticFolder(Configs.STATIC_BASE_ROUTE, PathHelper.HtmlRootPath, true, m => m .WithContentCaching(Configs.USE_FILE_CACHE)) - // Add static files after other modules to avoid conflicts .WithStaticFolder("/", PathHelper.HtmlRootPath, true, m => m .WithContentCaching(Configs.USE_FILE_CACHE)) .WithModule(new ActionModule("/", HttpVerbs.Any, ctx => ctx.SendDataAsync(new { Message = "Error" }))); + server.AddCustomMimeType(".dll", "application/octet-stream"); + server.AddCustomMimeType(".blat", "application/octet-stream"); + server.AddCustomMimeType(".dat", "application/octet-stream"); + server.AddCustomMimeType(".json", "application/json"); + server.AddCustomMimeType(".wasm", "application/wasm"); + server.AddCustomMimeType(".woff", "application/font-woff"); + server.AddCustomMimeType(".woff2", "application/font-woff2"); server.HandleHttpException(async (context, exception) => { context.Response.StatusCode = exception.StatusCode; @@ -57,9 +63,11 @@ public class Server { case 404: await context.SendStringAsync("404 NOT FOUND!", "text/html", new UTF8Encoding(false)); + break; default: await HttpExceptionHandler.Default(context, exception); + break; } }); diff --git a/MudAdmin/MudAdmin.csproj b/MudAdmin/MudAdmin.csproj index 8161d5f..55f89f4 100644 --- a/MudAdmin/MudAdmin.csproj +++ b/MudAdmin/MudAdmin.csproj @@ -30,6 +30,10 @@ PreserveNewest true + + PreserveNewest + true + diff --git a/MudAdmin/Pages/Counter.razor b/MudAdmin/Pages/Counter.razor deleted file mode 100644 index cf7aaff..0000000 --- a/MudAdmin/Pages/Counter.razor +++ /dev/null @@ -1,18 +0,0 @@ -@page "/counter" - -Counter - -Counter -Current count: @currentCount -Click me - - -@code { - private int currentCount = 0; - - private void IncrementCount() - { - currentCount++; - } - -} \ No newline at end of file diff --git a/MudAdmin/Pages/Index.razor b/MudAdmin/Pages/Index.razor index 62270c4..f416456 100644 --- a/MudAdmin/Pages/Index.razor +++ b/MudAdmin/Pages/Index.razor @@ -2,11 +2,5 @@ Index -Hello, world! -Welcome to your new app, powered by MudBlazor! - - You can find documentation and examples on our website here: - - www.mudblazor.com - - \ No newline at end of file +Admin page for GC local server +Powered by MudBlazor \ No newline at end of file diff --git a/MudAdmin/Shared/MainLayout.razor b/MudAdmin/Shared/MainLayout.razor index 7d9b80b..f882806 100644 --- a/MudAdmin/Shared/MainLayout.razor +++ b/MudAdmin/Shared/MainLayout.razor @@ -9,11 +9,11 @@ - + - MudAdmin + GC local server Admin diff --git a/MudAdmin/Shared/NavMenu.razor b/MudAdmin/Shared/NavMenu.razor index 9b23ec3..246001d 100644 --- a/MudAdmin/Shared/NavMenu.razor +++ b/MudAdmin/Shared/NavMenu.razor @@ -1,5 +1,4 @@  Home - Counter Users \ No newline at end of file diff --git a/MudAdmin/wwwroot/news.png b/MudAdmin/wwwroot/news.png new file mode 100644 index 0000000000000000000000000000000000000000..f7208594bc09cb5a18550486f1300c2910010dfd GIT binary patch literal 818 zcmeAS@N?(olHy`uVBq!ia0y~yU;;9k7&w@L)Zt|+CxDb>iEBhjaDG}zd16s2gJVj5 zQmTSyZen_BP-y?a~42pceQbHDC5)qjmdynf;cUac54jG%yG-FgY-A zFfb}Gtn0DcapUM=e>JK1ZVXHU4Gb&_42&EOU?xyi!Xt)H=8h1hEMR>JO$^tTb3qh< z)G9E5#lN!@{JnV~!Th7OB1C`*XhB2$U5-_H_wVO;e;%(0N+3dYDd(|#ZQ^`)CFHjd zHfbh-1AiGs-m|C)f9h2r&F%+B8FT!*?E8^p4(?QpprTa3=2CbABg1TE7bg`3QzMXR Mp00i_>zopr0EX$D4gdfE literal 0 HcmV?d00001 diff --git a/MudAdmin/wwwroot/sample-data/weather.json b/MudAdmin/wwwroot/sample-data/weather.json deleted file mode 100644 index 06463c0..0000000 --- a/MudAdmin/wwwroot/sample-data/weather.json +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "date": "2018-05-06", - "temperatureC": 1, - "summary": "Freezing" - }, - { - "date": "2018-05-07", - "temperatureC": 14, - "summary": "Bracing" - }, - { - "date": "2018-05-08", - "temperatureC": -13, - "summary": "Freezing" - }, - { - "date": "2018-05-09", - "temperatureC": -16, - "summary": "Balmy" - }, - { - "date": "2018-05-10", - "temperatureC": -2, - "summary": "Chilly" - } -]