* Changed views to have them in the same layout

* Added Authorization
This commit is contained in:
2025-02-28 13:33:01 +01:00
parent aedb5810c2
commit b8fbb789ad
35 changed files with 1605 additions and 1306 deletions

View File

@@ -1,4 +1,5 @@
@using Microsoft.AspNetCore.Components.Authorization
@using OrdersManagement.Components.Layout
<!DOCTYPE html>
<html lang="en">
@@ -18,7 +19,22 @@
</head>
<body>
<Routes @rendermode="@InteractiveServer" />
<Routes @rendermode="@InteractiveServer" />
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
<NotAuthorized>
<h3>Brak autoryzacji</h3>
<p><a href="/login">Zaloguj się</a></p>
</NotAuthorized>
</AuthorizeRouteView>
</Found>
<NotFound>
<p>Strona nie znaleziona.</p>
</NotFound>
</Router>
</CascadingAuthenticationState>
<script src="_framework/blazor.web.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.0.1/chart.umd.js" integrity="sha512-gQhCDsnnnUfaRzD8k1L5llCCV6O9HN09zClIzzeJ8OJ9MpGmIlCxm+pdCkqTwqJ4JcjbojFr79rl2F1mzcoLMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>