From 4448378bcf1e580a0c65f4f6289d7f82cf1a1ba3 Mon Sep 17 00:00:00 2001 From: daniel-c-harvey Date: Sat, 30 Aug 2025 01:04:19 -0400 Subject: [PATCH] Initial MudBlazor app --- .gitignore | 295 ++++++++++++++++++ DeepDrftHome.sln | 22 ++ .../DeepDrftWeb.Client.csproj | 16 + .../Layout/MainLayout.razor | 103 ++++++ .../DeepDrftWeb.Client/Layout/NavMenu.razor | 10 + .../DeepDrftWeb.Client/Pages/Counter.razor | 19 ++ .../DeepDrftWeb.Client/Pages/Home.razor | 59 ++++ .../DeepDrftWeb.Client/Pages/Weather.razor | 60 ++++ DeepDrftWeb/DeepDrftWeb.Client/Program.cs | 8 + DeepDrftWeb/DeepDrftWeb.Client/Routes.razor | 6 + DeepDrftWeb/DeepDrftWeb.Client/_Imports.razor | 10 + .../wwwroot/appsettings.Development.json | 8 + .../wwwroot/appsettings.json | 8 + DeepDrftWeb/DeepDrftWeb.sln | 50 +++ DeepDrftWeb/DeepDrftWeb/Components/App.razor | 21 ++ .../DeepDrftWeb/Components/Pages/Error.razor | 36 +++ .../DeepDrftWeb/Components/_Imports.razor | 13 + DeepDrftWeb/DeepDrftWeb/DeepDrftWeb.csproj | 15 + DeepDrftWeb/DeepDrftWeb/Program.cs | 40 +++ .../DeepDrftWeb/appsettings.Development.json | 8 + DeepDrftWeb/DeepDrftWeb/appsettings.json | 9 + DeepDrftWeb/DeepDrftWeb/wwwroot/favicon.ico | Bin 0 -> 15086 bytes 22 files changed, 816 insertions(+) create mode 100644 .gitignore create mode 100644 DeepDrftHome.sln create mode 100644 DeepDrftWeb/DeepDrftWeb.Client/DeepDrftWeb.Client.csproj create mode 100644 DeepDrftWeb/DeepDrftWeb.Client/Layout/MainLayout.razor create mode 100644 DeepDrftWeb/DeepDrftWeb.Client/Layout/NavMenu.razor create mode 100644 DeepDrftWeb/DeepDrftWeb.Client/Pages/Counter.razor create mode 100644 DeepDrftWeb/DeepDrftWeb.Client/Pages/Home.razor create mode 100644 DeepDrftWeb/DeepDrftWeb.Client/Pages/Weather.razor create mode 100644 DeepDrftWeb/DeepDrftWeb.Client/Program.cs create mode 100644 DeepDrftWeb/DeepDrftWeb.Client/Routes.razor create mode 100644 DeepDrftWeb/DeepDrftWeb.Client/_Imports.razor create mode 100644 DeepDrftWeb/DeepDrftWeb.Client/wwwroot/appsettings.Development.json create mode 100644 DeepDrftWeb/DeepDrftWeb.Client/wwwroot/appsettings.json create mode 100644 DeepDrftWeb/DeepDrftWeb.sln create mode 100644 DeepDrftWeb/DeepDrftWeb/Components/App.razor create mode 100644 DeepDrftWeb/DeepDrftWeb/Components/Pages/Error.razor create mode 100644 DeepDrftWeb/DeepDrftWeb/Components/_Imports.razor create mode 100644 DeepDrftWeb/DeepDrftWeb/DeepDrftWeb.csproj create mode 100644 DeepDrftWeb/DeepDrftWeb/Program.cs create mode 100644 DeepDrftWeb/DeepDrftWeb/appsettings.Development.json create mode 100644 DeepDrftWeb/DeepDrftWeb/appsettings.json create mode 100644 DeepDrftWeb/DeepDrftWeb/wwwroot/favicon.ico diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3d8a696 --- /dev/null +++ b/.gitignore @@ -0,0 +1,295 @@ +bin/ +obj/ +/packages/ +riderModule.iml +/_ReSharper.Caches/ + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ +**/Properties/launchSettings.json + +# VS Code +.vscode/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Typescript v1 declaration files +typings/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs \ No newline at end of file diff --git a/DeepDrftHome.sln b/DeepDrftHome.sln new file mode 100644 index 0000000..d5d4a6a --- /dev/null +++ b/DeepDrftHome.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeepDrftWeb", "DeepDrftWeb\DeepDrftWeb\DeepDrftWeb.csproj", "{7E629215-7EF7-465D-B7F2-2CED53C4BFEC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeepDrftWeb.Client", "DeepDrftWeb\DeepDrftWeb.Client\DeepDrftWeb.Client.csproj", "{E76D21B4-308B-487B-B8D6-59D6AE49F1F7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7E629215-7EF7-465D-B7F2-2CED53C4BFEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E629215-7EF7-465D-B7F2-2CED53C4BFEC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E629215-7EF7-465D-B7F2-2CED53C4BFEC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E629215-7EF7-465D-B7F2-2CED53C4BFEC}.Release|Any CPU.Build.0 = Release|Any CPU + {E76D21B4-308B-487B-B8D6-59D6AE49F1F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E76D21B4-308B-487B-B8D6-59D6AE49F1F7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E76D21B4-308B-487B-B8D6-59D6AE49F1F7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E76D21B4-308B-487B-B8D6-59D6AE49F1F7}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/DeepDrftWeb/DeepDrftWeb.Client/DeepDrftWeb.Client.csproj b/DeepDrftWeb/DeepDrftWeb.Client/DeepDrftWeb.Client.csproj new file mode 100644 index 0000000..a997134 --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb.Client/DeepDrftWeb.Client.csproj @@ -0,0 +1,16 @@ + + + + net9.0 + enable + enable + true + Default + + + + + + + + diff --git a/DeepDrftWeb/DeepDrftWeb.Client/Layout/MainLayout.razor b/DeepDrftWeb/DeepDrftWeb.Client/Layout/MainLayout.razor new file mode 100644 index 0000000..119dfac --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb.Client/Layout/MainLayout.razor @@ -0,0 +1,103 @@ +@inherits LayoutComponentBase + + + + + + + + + Application + + + + + + + + + @Body + + + + +
+ An unhandled error has occurred. + Reload + 🗙 +
+ +@code { + private bool _drawerOpen = true; + private bool _isDarkMode = true; + private MudTheme? _theme = null; + + protected override void OnInitialized() + { + base.OnInitialized(); + + _theme = new() + { + PaletteLight = _lightPalette, + PaletteDark = _darkPalette, + LayoutProperties = new LayoutProperties() + }; + } + + private void DrawerToggle() + { + _drawerOpen = !_drawerOpen; + } + + private void DarkModeToggle() + { + _isDarkMode = !_isDarkMode; + } + + private readonly PaletteLight _lightPalette = new() + { + Black = "#110e2d", + AppbarText = "#424242", + AppbarBackground = "rgba(255,255,255,0.8)", + DrawerBackground = "#ffffff", + GrayLight = "#e8e8e8", + GrayLighter = "#f9f9f9", + }; + + private readonly PaletteDark _darkPalette = new() + { + Primary = "#7e6fff", + Surface = "#1e1e2d", + Background = "#1a1a27", + BackgroundGray = "#151521", + AppbarText = "#92929f", + AppbarBackground = "rgba(26,26,39,0.8)", + DrawerBackground = "#1a1a27", + ActionDefault = "#74718e", + ActionDisabled = "#9999994d", + ActionDisabledBackground = "#605f6d4d", + TextPrimary = "#b2b0bf", + TextSecondary = "#92929f", + TextDisabled = "#ffffff33", + DrawerIcon = "#92929f", + DrawerText = "#92929f", + GrayLight = "#2a2833", + GrayLighter = "#1e1e2d", + Info = "#4a86ff", + Success = "#3dcb6c", + Warning = "#ffb545", + Error = "#ff3f5f", + LinesDefault = "#33323e", + TableLines = "#33323e", + Divider = "#292838", + OverlayLight = "#1e1e2d80", + }; + + public string DarkLightModeButtonIcon => _isDarkMode switch + { + true => Icons.Material.Rounded.AutoMode, + false => Icons.Material.Outlined.DarkMode, + }; +} + + diff --git a/DeepDrftWeb/DeepDrftWeb.Client/Layout/NavMenu.razor b/DeepDrftWeb/DeepDrftWeb.Client/Layout/NavMenu.razor new file mode 100644 index 0000000..3f08809 --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb.Client/Layout/NavMenu.razor @@ -0,0 +1,10 @@ + + + Home + Counter + + Weather + + + + diff --git a/DeepDrftWeb/DeepDrftWeb.Client/Pages/Counter.razor b/DeepDrftWeb/DeepDrftWeb.Client/Pages/Counter.razor new file mode 100644 index 0000000..83d09a7 --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb.Client/Pages/Counter.razor @@ -0,0 +1,19 @@ +@page "/counter" + + +Counter + +Counter + +Current count: @currentCount + +Click me + +@code { + private int currentCount = 0; + + private void IncrementCount() + { + currentCount++; + } +} diff --git a/DeepDrftWeb/DeepDrftWeb.Client/Pages/Home.razor b/DeepDrftWeb/DeepDrftWeb.Client/Pages/Home.razor new file mode 100644 index 0000000..6aaa2a4 --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb.Client/Pages/Home.razor @@ -0,0 +1,59 @@ +@page "/" + +Home + +Hello, world! +Welcome to your new app, powered by MudBlazor and the .NET 9 Template! + + + You can find documentation and examples on our website here: + + www.mudblazor.com + + + +
+Interactivity in this Template +
+ + When you opt for the "Global" Interactivity Location,
+ the render modes are defined in App.razor and consequently apply to all child components.
+ In this case, providers are globally set in the MainLayout.
+
+ On the other hand, if you choose the "Per page/component" Interactivity Location,
+ it is necessary to include the
+
+ <MudPopoverProvider />
+ <MudDialogProvider />
+ <MudSnackbarProvider />
+
+ components on every interactive page.
+
+ If a render mode is not specified for a page, it defaults to Server-Side Rendering (SSR),
+ similar to this page. While MudBlazor allows pages to be rendered in SSR,
+ please note that interactive features, such as buttons and dropdown menus, will not be functional. +
+ +
+What's New in Blazor with the Release of .NET 9 +
+ +Prerendering + + If you're exploring the features of .NET 9 Blazor,
you might be pleasantly surprised to learn that each page is prerendered on the server,
regardless of the selected render mode.

+ This means that you'll need to inject all necessary services on the server,
even when opting for the wasm (WebAssembly) render mode.

+ This prerendering functionality is crucial to ensuring that WebAssembly mode feels fast and responsive,
especially when it comes to initial page load times.

+ For more information on how to detect prerendering and leverage the RenderContext, you can refer to the following link: + + More details + +
+ +
+InteractiveAuto + + A discussion on how to achieve this can be found here: + + More details + + diff --git a/DeepDrftWeb/DeepDrftWeb.Client/Pages/Weather.razor b/DeepDrftWeb/DeepDrftWeb.Client/Pages/Weather.razor new file mode 100644 index 0000000..3ffd7d8 --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb.Client/Pages/Weather.razor @@ -0,0 +1,60 @@ +@page "/weather" + + + +Weather + +Weather forecast +This component demonstrates fetching data from the server. + +@if (forecasts == null) +{ + +} +else +{ + + + Date + Temp. (C) + Temp. (F) + Summary + + + @context.Date + @context.TemperatureC + @context.TemperatureF + @context.Summary + + + + + +} + +@code { + private WeatherForecast[]? forecasts; + + protected override async Task OnInitializedAsync() + { + // Simulate asynchronous loading to demonstrate a loading indicator + await Task.Delay(500); + + var startDate = DateOnly.FromDateTime(DateTime.Now); + var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" }; + forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = startDate.AddDays(index), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = summaries[Random.Shared.Next(summaries.Length)] + }).ToArray(); + } + + private class WeatherForecast + { + public DateOnly Date { get; set; } + public int TemperatureC { get; set; } + public string? Summary { get; set; } + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + } +} diff --git a/DeepDrftWeb/DeepDrftWeb.Client/Program.cs b/DeepDrftWeb/DeepDrftWeb.Client/Program.cs new file mode 100644 index 0000000..57602e1 --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb.Client/Program.cs @@ -0,0 +1,8 @@ +using Microsoft.AspNetCore.Components.WebAssembly.Hosting; +using MudBlazor.Services; + +var builder = WebAssemblyHostBuilder.CreateDefault(args); + +builder.Services.AddMudServices(); + +await builder.Build().RunAsync(); diff --git a/DeepDrftWeb/DeepDrftWeb.Client/Routes.razor b/DeepDrftWeb/DeepDrftWeb.Client/Routes.razor new file mode 100644 index 0000000..f756e19 --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb.Client/Routes.razor @@ -0,0 +1,6 @@ + + + + + + diff --git a/DeepDrftWeb/DeepDrftWeb.Client/_Imports.razor b/DeepDrftWeb/DeepDrftWeb.Client/_Imports.razor new file mode 100644 index 0000000..3aa70bc --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb.Client/_Imports.razor @@ -0,0 +1,10 @@ +@using System.Net.Http +@using System.Net.Http.Json +@using Microsoft.AspNetCore.Components.Forms +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using static Microsoft.AspNetCore.Components.Web.RenderMode +@using Microsoft.AspNetCore.Components.Web.Virtualization +@using Microsoft.JSInterop +@using MudBlazor +@using MudBlazor.Services diff --git a/DeepDrftWeb/DeepDrftWeb.Client/wwwroot/appsettings.Development.json b/DeepDrftWeb/DeepDrftWeb.Client/wwwroot/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb.Client/wwwroot/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/DeepDrftWeb/DeepDrftWeb.Client/wwwroot/appsettings.json b/DeepDrftWeb/DeepDrftWeb.Client/wwwroot/appsettings.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb.Client/wwwroot/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/DeepDrftWeb/DeepDrftWeb.sln b/DeepDrftWeb/DeepDrftWeb.sln new file mode 100644 index 0000000..b7a11bc --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb.sln @@ -0,0 +1,50 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.0.0 +MinimumVisualStudioVersion = 16.0.0.0 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeepDrftWeb", "DeepDrftWeb\DeepDrftWeb.csproj", "{76E9ECCD-3DAE-4C67-AAC3-101A21E22184}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeepDrftWeb.Client", "DeepDrftWeb.Client\DeepDrftWeb.Client.csproj", "{DA187C08-E74D-4F28-8FF2-CD74C5473F9C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DA187C08-E74D-4F28-8FF2-CD74C5473F9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DA187C08-E74D-4F28-8FF2-CD74C5473F9C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DA187C08-E74D-4F28-8FF2-CD74C5473F9C}.Debug|x64.ActiveCfg = Debug|Any CPU + {DA187C08-E74D-4F28-8FF2-CD74C5473F9C}.Debug|x64.Build.0 = Debug|Any CPU + {DA187C08-E74D-4F28-8FF2-CD74C5473F9C}.Debug|x86.ActiveCfg = Debug|Any CPU + {DA187C08-E74D-4F28-8FF2-CD74C5473F9C}.Debug|x86.Build.0 = Debug|Any CPU + {DA187C08-E74D-4F28-8FF2-CD74C5473F9C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DA187C08-E74D-4F28-8FF2-CD74C5473F9C}.Release|Any CPU.Build.0 = Release|Any CPU + {DA187C08-E74D-4F28-8FF2-CD74C5473F9C}.Release|x64.ActiveCfg = Release|Any CPU + {DA187C08-E74D-4F28-8FF2-CD74C5473F9C}.Release|x64.Build.0 = Release|Any CPU + {DA187C08-E74D-4F28-8FF2-CD74C5473F9C}.Release|x86.ActiveCfg = Release|Any CPU + {DA187C08-E74D-4F28-8FF2-CD74C5473F9C}.Release|x86.Build.0 = Release|Any CPU + {76E9ECCD-3DAE-4C67-AAC3-101A21E22184}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {76E9ECCD-3DAE-4C67-AAC3-101A21E22184}.Debug|Any CPU.Build.0 = Debug|Any CPU + {76E9ECCD-3DAE-4C67-AAC3-101A21E22184}.Debug|x64.ActiveCfg = Debug|Any CPU + {76E9ECCD-3DAE-4C67-AAC3-101A21E22184}.Debug|x64.Build.0 = Debug|Any CPU + {76E9ECCD-3DAE-4C67-AAC3-101A21E22184}.Debug|x86.ActiveCfg = Debug|Any CPU + {76E9ECCD-3DAE-4C67-AAC3-101A21E22184}.Debug|x86.Build.0 = Debug|Any CPU + {76E9ECCD-3DAE-4C67-AAC3-101A21E22184}.Release|Any CPU.ActiveCfg = Release|Any CPU + {76E9ECCD-3DAE-4C67-AAC3-101A21E22184}.Release|Any CPU.Build.0 = Release|Any CPU + {76E9ECCD-3DAE-4C67-AAC3-101A21E22184}.Release|x64.ActiveCfg = Release|Any CPU + {76E9ECCD-3DAE-4C67-AAC3-101A21E22184}.Release|x64.Build.0 = Release|Any CPU + {76E9ECCD-3DAE-4C67-AAC3-101A21E22184}.Release|x86.ActiveCfg = Release|Any CPU + {76E9ECCD-3DAE-4C67-AAC3-101A21E22184}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E25814BD-2D52-4BA2-B9BD-0B80E2221977} + EndGlobalSection +EndGlobal diff --git a/DeepDrftWeb/DeepDrftWeb/Components/App.razor b/DeepDrftWeb/DeepDrftWeb/Components/App.razor new file mode 100644 index 0000000..e5611cb --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb/Components/App.razor @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/DeepDrftWeb/DeepDrftWeb/Components/Pages/Error.razor b/DeepDrftWeb/DeepDrftWeb/Components/Pages/Error.razor new file mode 100644 index 0000000..576cc2d --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb/Components/Pages/Error.razor @@ -0,0 +1,36 @@ +@page "/Error" +@using System.Diagnostics + +Error + +

Error.

+

An error occurred while processing your request.

+ +@if (ShowRequestId) +{ +

+ Request ID: @RequestId +

+} + +

Development Mode

+

+ Swapping to Development environment will display more detailed information about the error that occurred. +

+

+ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +

+ +@code{ + [CascadingParameter] + private HttpContext? HttpContext { get; set; } + + private string? RequestId { get; set; } + private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + + protected override void OnInitialized() => + RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; +} diff --git a/DeepDrftWeb/DeepDrftWeb/Components/_Imports.razor b/DeepDrftWeb/DeepDrftWeb/Components/_Imports.razor new file mode 100644 index 0000000..ac766ef --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb/Components/_Imports.razor @@ -0,0 +1,13 @@ +@using System.Net.Http +@using System.Net.Http.Json +@using Microsoft.AspNetCore.Components.Forms +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using static Microsoft.AspNetCore.Components.Web.RenderMode +@using Microsoft.AspNetCore.Components.Web.Virtualization +@using Microsoft.JSInterop +@using MudBlazor +@using MudBlazor.Services +@using DeepDrftWeb +@using DeepDrftWeb.Client +@using DeepDrftWeb.Components diff --git a/DeepDrftWeb/DeepDrftWeb/DeepDrftWeb.csproj b/DeepDrftWeb/DeepDrftWeb/DeepDrftWeb.csproj new file mode 100644 index 0000000..406f3ea --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb/DeepDrftWeb.csproj @@ -0,0 +1,15 @@ + + + + net9.0 + enable + enable + + + + + + + + + \ No newline at end of file diff --git a/DeepDrftWeb/DeepDrftWeb/Program.cs b/DeepDrftWeb/DeepDrftWeb/Program.cs new file mode 100644 index 0000000..45d1eae --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb/Program.cs @@ -0,0 +1,40 @@ +using MudBlazor.Services; +using DeepDrftWeb.Client.Pages; +using DeepDrftWeb.Components; + +var builder = WebApplication.CreateBuilder(args); + +// Add MudBlazor services +builder.Services.AddMudServices(); + +// Add services to the container. +builder.Services.AddRazorComponents() + .AddInteractiveServerComponents() + .AddInteractiveWebAssemblyComponents(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (app.Environment.IsDevelopment()) +{ + app.UseWebAssemblyDebugging(); +} +else +{ + app.UseExceptionHandler("/Error", createScopeForErrors: true); + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); +} + +app.UseHttpsRedirection(); + + +app.UseAntiforgery(); + +app.MapStaticAssets(); +app.MapRazorComponents() + .AddInteractiveServerRenderMode() + .AddInteractiveWebAssemblyRenderMode() + .AddAdditionalAssemblies(typeof(DeepDrftWeb.Client._Imports).Assembly); + +app.Run(); diff --git a/DeepDrftWeb/DeepDrftWeb/appsettings.Development.json b/DeepDrftWeb/DeepDrftWeb/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/DeepDrftWeb/DeepDrftWeb/appsettings.json b/DeepDrftWeb/DeepDrftWeb/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/DeepDrftWeb/DeepDrftWeb/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/DeepDrftWeb/DeepDrftWeb/wwwroot/favicon.ico b/DeepDrftWeb/DeepDrftWeb/wwwroot/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..12392236657563eb8cc764f235e66d568b3a0fbb GIT binary patch literal 15086 zcmd5@3vgXU89or@;sb&xh>sx^P*g@JAPS{Yd_tiueWi_Q(uStVO_SUgeWuMhXESw* zFTgS?1+faFJmjS?j^l{KW$MUNQRF4GG;Mi{HEn^W?Ir8??>T$U?zwwz&J9WFoo@fL zyZ>{a|NgtNtV66CYy5Z%aGZ6^r!DJCmSv3_=jV^Itmjd76d=`iyvMTE0^zg30g2Uu zMCIalk_Qgt|D3VIc-Fau=bfv0&e@3c9MWc_Cwb1k2g%_DMkXCpKVB%j4?3hAp%_Srwg;P_+2y@BU?Pv%*BDe&H|fIGkot3MH^3zhSx?rD75 zr91frjXX%R7CjY56EpVr@J#QCl7_}E{D^Lm!enjQR-q7jt3+IJx zuIf(TGg~)l1bznc;fu-f>BFpjW)zp#*Vh2=*>YUHJz?kkGMp&?oO_kZpEqSE#J0P% zgZhOrc)0oxvfhZudq&3yb4K0r?zJI?=+6ZDJ1+>Re%|QK9>(ij!P__hvr7>m0uDvUuIehDNu5kpji^qxqY%+;3t~DV*EYI+m@{f`DkNOx2dtq(|=~`W=&R> zP0;Dtd0KtWxk;@1i&uU~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