Major architectural upgrade from static HTML site to modern Blazor Web App: - Migrated to .NET 9.0 Blazor Web App framework - Converted home page with 4 gateway cards (Help Desk, App Store, Cloud, SDK) - Added new SDK card linking to comprehensive SDK documentation - Converted SDK documentation page to Blazor component - Updated template download links to nuget.silverlabs.uk repository - Implemented multi-stage Docker build with .NET SDK 9.0 - Created Blazor-optimized nginx configuration - Preserved all original styling and animations - Added .gitignore for Blazor build artifacts Technical changes: - New BlazorApp/ project structure with Components architecture - MainLayout simplified (no default navigation) - CSS ported to wwwroot (styles.css + sdk-styles.css) - Multi-stage Dockerfile: Build with dotnet SDK, serve with nginx - GitLab CI/CD pipeline compatible (auto-detects new Dockerfile) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
65 lines
1.9 KiB
Plaintext
65 lines
1.9 KiB
Plaintext
@page "/weather"
|
|
@attribute [StreamRendering]
|
|
|
|
<PageTitle>Weather</PageTitle>
|
|
|
|
<h1>Weather</h1>
|
|
|
|
<p>This component demonstrates showing data.</p>
|
|
|
|
@if (forecasts == null)
|
|
{
|
|
<p><em>Loading...</em></p>
|
|
}
|
|
else
|
|
{
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Date</th>
|
|
<th aria-label="Temperature in Celsius">Temp. (C)</th>
|
|
<th aria-label="Temperature in Farenheit">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()
|
|
{
|
|
// Simulate asynchronous loading to demonstrate streaming rendering
|
|
await Task.Delay(500);
|
|
|
|
var startDate = DateOnly.FromDateTime(DateTime.Now);
|
|
var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" };
|
|
forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast
|
|
{
|
|
Date = startDate.AddDays(index),
|
|
TemperatureC = Random.Shared.Next(-20, 55),
|
|
Summary = summaries[Random.Shared.Next(summaries.Length)]
|
|
}).ToArray();
|
|
}
|
|
|
|
private class WeatherForecast
|
|
{
|
|
public DateOnly Date { get; set; }
|
|
public int TemperatureC { get; set; }
|
|
public string? Summary { get; set; }
|
|
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
|
|
}
|
|
}
|