MudBlazor und DB-Verbindung

This commit is contained in:
2026-05-29 11:35:02 +02:00
parent 6d3beae249
commit fda8187792
3 changed files with 41 additions and 13 deletions
+6
View File
@@ -5,6 +5,12 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="/" /> <base href="/" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Urbanist:wght@400;500;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<ResourcePreloader /> <ResourcePreloader />
<link rel="stylesheet" href="@Assets["lib/bootstrap/dist/css/bootstrap.min.css"]" /> <link rel="stylesheet" href="@Assets["lib/bootstrap/dist/css/bootstrap.min.css"]" />
<link rel="stylesheet" href="@Assets["app.css"]" /> <link rel="stylesheet" href="@Assets["app.css"]" />
+23 -13
View File
@@ -1,20 +1,30 @@
@inherits LayoutComponentBase @inherits LayoutComponentBase
@using MudBlazor
<div class="page"> <MudThemeProvider Theme="@_myCustomTheme" IsDarkMode="true" />
<div class="sidebar"> <MudDialogProvider />
<NavMenu /> <MudSnackbarProvider />
</div>
<main> <MudLayout>
<div class="top-row px-4"> <MudMainContent>
<a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a> @Body
</div> </MudMainContent>
</MudLayout>
<article class="content px-4"> @code {
@Body private MudTheme _myCustomTheme = new MudTheme()
</article> {
</main> Typography = new Typography()
</div> {
// Hier liegt der Fix: DefaultTypography statt Default
Default = new DefaultTypography() { FontFamily = new[] { "Urbanist", "sans-serif" } }
},
LayoutProperties = new LayoutProperties()
{
DefaultBorderRadius = "0px"
}
};
}
<div id="blazor-error-ui" data-nosnippet> <div id="blazor-error-ui" data-nosnippet>
An unhandled error has occurred. An unhandled error has occurred.
+12
View File
@@ -1,10 +1,22 @@
using ZahlenAnalyse.Web.Components; using ZahlenAnalyse.Web.Components;
using MudBlazor.Services;
using Raven.Client.Documents;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
// Add services to the container. // Add services to the container.
builder.Services.AddRazorComponents() builder.Services.AddRazorComponents()
.AddInteractiveServerComponents(); .AddInteractiveServerComponents();
builder.Services.AddMudServices();
var store = new DocumentStore
{
Urls = new[] { "http://localhost:8080" },
Database = "ZahlenAnalyse"
};
store.Initialize();
builder.Services.AddSingleton<IDocumentStore>(store);
var app = builder.Build(); var app = builder.Build();