Initial files
This commit is contained in:
commit
691e049103
65 changed files with 4312 additions and 0 deletions
7
Start/Client/Pages/Authentication.razor
Normal file
7
Start/Client/Pages/Authentication.razor
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
@page "/authentication/{action}"
|
||||
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
|
||||
<RemoteAuthenticatorView Action="@Action" />
|
||||
|
||||
@code{
|
||||
[Parameter] public string? Action { get; set; }
|
||||
}
|
||||
16
Start/Client/Pages/Counter.razor
Normal file
16
Start/Client/Pages/Counter.razor
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
@page "/counter"
|
||||
|
||||
<h1>Counter</h1>
|
||||
|
||||
<p>Current count: @currentCount</p>
|
||||
|
||||
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
|
||||
|
||||
@code {
|
||||
private int currentCount = 0;
|
||||
|
||||
private void IncrementCount()
|
||||
{
|
||||
currentCount++;
|
||||
}
|
||||
}
|
||||
56
Start/Client/Pages/FetchData.razor
Normal file
56
Start/Client/Pages/FetchData.razor
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
@page "/fetchdata"
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
|
||||
@using Start.Shared
|
||||
@attribute [Authorize]
|
||||
@inject HttpClient Http
|
||||
|
||||
<h1>Weather forecast</h1>
|
||||
|
||||
<p>This component demonstrates fetching data from the server.</p>
|
||||
|
||||
@if (forecasts == null)
|
||||
{
|
||||
<p><em>Loading...</em></p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Temp. (C)</th>
|
||||
<th>Temp. (F)</th>
|
||||
<th>Summary</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var forecast in forecasts)
|
||||
{
|
||||
<tr>
|
||||
<td>@forecast.Date.ToShortDateString()</td>
|
||||
<td>@forecast.TemperatureC</td>
|
||||
<td>@forecast.TemperatureF</td>
|
||||
<td>@forecast.Summary</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
|
||||
@code {
|
||||
private WeatherForecast[]? forecasts;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("WeatherForecast");
|
||||
}
|
||||
catch (AccessTokenNotAvailableException exception)
|
||||
{
|
||||
exception.Redirect();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
8
Start/Client/Pages/Index.razor
Normal file
8
Start/Client/Pages/Index.razor
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
@page "/"
|
||||
|
||||
<h1>Hello, world!</h1>
|
||||
|
||||
Welcome to your new app.
|
||||
|
||||
<SurveyPrompt Title="How is Blazor working for you?" />
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue