parent
f223bd6a79
commit
343572d22d
@ -1,12 +1,12 @@
|
|||||||
<Router AppAssembly="@typeof(App).Assembly">
|
<Router AppAssembly="@typeof(Program).Assembly">
|
||||||
<Found Context="routeData">
|
<Found Context="routeData">
|
||||||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
|
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
|
||||||
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
|
|
||||||
</Found>
|
</Found>
|
||||||
<NotFound>
|
<NotFound>
|
||||||
<PageTitle>Not found</PageTitle>
|
<CascadingAuthenticationState>
|
||||||
<LayoutView Layout="@typeof(MainLayout)">
|
<LayoutView Layout="@typeof(MainLayout)">
|
||||||
<p role="alert">Sorry, there's nothing at this address.</p>
|
<p>Sorry, there's nothing at this address.</p>
|
||||||
</LayoutView>
|
</LayoutView>
|
||||||
|
</CascadingAuthenticationState>
|
||||||
</NotFound>
|
</NotFound>
|
||||||
</Router>
|
</Router>
|
@ -0,0 +1,28 @@
|
|||||||
|
@page "/login"
|
||||||
|
@layout AuthLayout
|
||||||
|
|
||||||
|
<h1 class="h2 font-weight-normal login-title">
|
||||||
|
Login
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<EditForm class="form-signin" OnValidSubmit="OnSubmit" Model="loginRequest">
|
||||||
|
<DataAnnotationsValidator />
|
||||||
|
|
||||||
|
<div class="form-group mb-4 text-center">
|
||||||
|
<label for="inputUsername">Username</label>
|
||||||
|
<InputText id="inputUsername" class="form-control max-width-input mx-auto" @bind-Value="loginRequest.UserName" autofocus />
|
||||||
|
<ValidationMessage For="@(() => loginRequest.UserName)" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group mb-4 text-center">
|
||||||
|
<label for="inputPassword">Password</label>
|
||||||
|
<InputText type="password" id="inputPassword" class="form-control max-width-input mx-auto" @bind-Value="loginRequest.Password" />
|
||||||
|
<ValidationMessage For="@(() => loginRequest.Password)" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="text-center">
|
||||||
|
<button class="btn btn-lg btn-success max-width-input" type="submit">SignIn</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="mt-3 text-danger">@errorMessage</p>
|
||||||
|
</EditForm>
|
@ -1,16 +1,38 @@
|
|||||||
@page "/"
|
@page "/"
|
||||||
@using System.Globalization
|
@using System.Globalization
|
||||||
|
|
||||||
<PageTitle>Global View</PageTitle>
|
<AuthorizeView>
|
||||||
|
<Authorized>
|
||||||
|
<h1>Hello @context.User.Identity.Name !!</h1>
|
||||||
|
|
||||||
<h1>Global View</h1>
|
<p>Welcome to Blazor Learner.</p>
|
||||||
|
|
||||||
This is the global statistics of our website.
|
<ul>
|
||||||
<div style="align-content:flex-start">
|
@foreach (var claim in context.User.Claims)
|
||||||
|
{
|
||||||
|
<li>@claim.Type: @claim.Value</li>
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<PageTitle>Global View</PageTitle>
|
||||||
|
|
||||||
|
<h1>Global View</h1>
|
||||||
|
|
||||||
|
This is the global statistics of our website.
|
||||||
|
<div style="align-content:flex-start">
|
||||||
<div style=" display:block; margin:50px;">
|
<div style=" display:block; margin:50px;">
|
||||||
<p>Number of views of the website</p>
|
<p>Number of views of the website</p>
|
||||||
<MudChart ChartType="ChartType.Line" ChartSeries="@Series" @bind-SelectedIndex="IndexChart" XAxisLabels="@XAxisLabels" Width="100%" Height="350px" ChartOptions="@Options" />
|
<MudChart ChartType="ChartType.Line" ChartSeries="@Series" @bind-SelectedIndex="IndexChart" XAxisLabels="@XAxisLabels" Width="100%" Height="350px" ChartOptions="@Options" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</Authorized>
|
||||||
|
<Authorizing>
|
||||||
|
<h1>Loading ...</h1>
|
||||||
|
</Authorizing>
|
||||||
|
<NotAuthorized>
|
||||||
|
<h1>Authentication Failure!</h1>
|
||||||
|
<p>You're not signed in.</p>
|
||||||
|
</NotAuthorized>
|
||||||
|
</AuthorizeView>
|
@ -0,0 +1,6 @@
|
|||||||
|
@inherits LayoutComponentBase
|
||||||
|
<div class="main">
|
||||||
|
<div class="content px-4">
|
||||||
|
@Body
|
||||||
|
</div>
|
||||||
|
</div>
|
Loading…
Reference in new issue