| @@ -1,18 +0,0 @@ | |||
| @page "/counter" | |||
| <PageTitle>Counter</PageTitle> | |||
| <h1>Counter</h1> | |||
| <p role="status">Current count: @currentCount</p> | |||
| <button class="btn btn-primary" @onclick="IncrementCount">Click me</button> | |||
| @code { | |||
| private int currentCount = 0; | |||
| private void IncrementCount() | |||
| { | |||
| currentCount++; | |||
| } | |||
| } | |||
| @@ -1,57 +0,0 @@ | |||
| @page "/fetchdata" | |||
| @inject HttpClient Http | |||
| <PageTitle>Weather forecast</PageTitle> | |||
| <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() | |||
| { | |||
| forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json"); | |||
| } | |||
| public class WeatherForecast | |||
| { | |||
| public DateTime Date { get; set; } | |||
| public int TemperatureC { get; set; } | |||
| public string? Summary { get; set; } | |||
| public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); | |||
| } | |||
| } | |||
| @@ -1,9 +1,18 @@ | |||
| @page "/" | |||
| @inject NavigationManager NavigationManager | |||
| <PageTitle>Index</PageTitle> | |||
| <h1>Hello, world!</h1> | |||
| <h1>Pozdrav Diligent!</h1> | |||
| Welcome to your new app. | |||
| Dobrodošli u našu NemAn aplikaciju. | |||
| <SurveyPrompt Title="How is Blazor working for you?" /> | |||
| <button class="btn-outline-success" @onclick="SpotifyRedirect">Spotify</button> | |||
| @code{ | |||
| private void SpotifyRedirect() | |||
| { | |||
| NavigationManager.NavigateTo( | |||
| "https://accounts.spotify.com/en/authorize?client_id=83e1d09876b049c4bb1953185a4b3bfb&redirect_uri=https://localhost:7229/callback&response_type=code&scope=user-read-currently-playing%20user-read-email%20user-library-modify%20user-top-read%0A%0A%0A&show_dialog=true"); | |||
| } | |||
| } | |||
| @@ -0,0 +1,10 @@ | |||
| @page "/profile" | |||
| <PageTitle>Profile</PageTitle> | |||
| <h1>Profile</h1> | |||
| @code { | |||
| } | |||
| @@ -0,0 +1,9 @@ | |||
| @page "/stats" | |||
| <PageTitle>Stats</PageTitle> | |||
| @code { | |||
| } | |||
| @@ -7,7 +7,7 @@ | |||
| <main> | |||
| <div class="top-row px-4"> | |||
| <a href="https://docs.microsoft.com/aspnet/" target="_blank">About</a> | |||
| <a href="https://docs.microsoft.com/aspnet/" target="_blank">Logout</a> | |||
| </div> | |||
| <article class="content px-4"> | |||
| @@ -15,13 +15,13 @@ | |||
| </NavLink> | |||
| </div> | |||
| <div class="nav-item px-3"> | |||
| <NavLink class="nav-link" href="counter"> | |||
| <span class="oi oi-plus" aria-hidden="true"></span> Counter | |||
| <NavLink class="nav-link" href="profile"> | |||
| <span class="oi oi-plus" aria-hidden="true"></span> Profile | |||
| </NavLink> | |||
| </div> | |||
| <div class="nav-item px-3"> | |||
| <NavLink class="nav-link" href="fetchdata"> | |||
| <span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data | |||
| <NavLink class="nav-link" href="stats"> | |||
| <span class="oi oi-plus" aria-hidden="true"></span> Stats | |||
| </NavLink> | |||
| </div> | |||
| </nav> | |||
| @@ -1,16 +0,0 @@ | |||
| <div class="alert alert-secondary mt-4"> | |||
| <span class="oi oi-pencil me-2" aria-hidden="true"></span> | |||
| <strong>@Title</strong> | |||
| <span class="text-nowrap"> | |||
| Please take our | |||
| <a target="_blank" class="font-weight-bold link-dark" href="https://go.microsoft.com/fwlink/?linkid=2148851">brief survey</a> | |||
| </span> | |||
| and tell us what you think. | |||
| </div> | |||
| @code { | |||
| // Demonstrates how a parent component can supply parameters | |||
| [Parameter] | |||
| public string? Title { get; set; } | |||
| } | |||