MudBlazor und DB-Verbindung
This commit is contained in:
@@ -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"]" />
|
||||||
|
|||||||
@@ -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>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<article class="content px-4">
|
|
||||||
@Body
|
@Body
|
||||||
</article>
|
</MudMainContent>
|
||||||
</main>
|
</MudLayout>
|
||||||
</div>
|
|
||||||
|
@code {
|
||||||
|
private MudTheme _myCustomTheme = new MudTheme()
|
||||||
|
{
|
||||||
|
Typography = new Typography()
|
||||||
|
{
|
||||||
|
// 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
@@ -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();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user