[frontend] Finish blazor bootstrap (fix build warnings)
This commit is contained in:
parent
d98d222901
commit
774e92837d
6 changed files with 37 additions and 34 deletions
|
@ -2,35 +2,37 @@
|
||||||
@{
|
@{
|
||||||
Layout = null;
|
Layout = null;
|
||||||
}
|
}
|
||||||
|
@* ReSharper disable Html.PathError *@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||||
<title>Iceshrimp.Frontend</title>
|
<title>Iceshrimp.Frontend</title>
|
||||||
<base href="/" />
|
<base href="/"/>
|
||||||
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
|
<link rel="stylesheet" href="~/css/bootstrap/bootstrap.min.css"/>
|
||||||
<link rel="stylesheet" href="css/app.css" />
|
<link rel="stylesheet" href="~/css/app.css"/>
|
||||||
<link rel="icon" type="image/png" href="favicon.png" />
|
<link rel="icon" type="image/png" href="~/favicon.png"/>
|
||||||
<link href="Iceshrimp.Frontend.styles.css" rel="stylesheet" />
|
<link href="~/Iceshrimp.Frontend.styles.css" rel="stylesheet"/>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<svg class="loading-progress">
|
<svg class="loading-progress">
|
||||||
<circle r="40%" cx="50%" cy="50%" />
|
<circle r="40%" cx="50%" cy="50%"/>
|
||||||
<circle r="40%" cx="50%" cy="50%" />
|
<circle r="40%" cx="50%" cy="50%"/>
|
||||||
</svg>
|
</svg>
|
||||||
<div class="loading-progress-text"></div>
|
<div class="loading-progress-text"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="blazor-error-ui">
|
<div id="blazor-error-ui">
|
||||||
An unhandled error has occurred.
|
An unhandled error has occurred.
|
||||||
<a href="" class="reload">Reload</a>
|
<a href="" class="reload">Reload</a>
|
||||||
<a class="dismiss">🗙</a>
|
<a class="dismiss">🗙</a>
|
||||||
</div>
|
</div>
|
||||||
<script src="_framework/blazor.webassembly.js"></script>
|
<script src="~/_framework/blazor.webassembly.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@* ReSharper restore Html.PathError *@
|
|
@ -1,9 +1,9 @@
|
||||||
<!DOCTYPE html>
|
@* ReSharper disable Html.PathError *@
|
||||||
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<title>@(ViewData["title"] ?? "Iceshrimp.NET")</title>
|
<title>@(ViewData["title"] ?? "Iceshrimp.NET")</title>
|
||||||
@* ReSharper disable once Html.PathError *@
|
|
||||||
<link rel="stylesheet" href="~/Iceshrimp.Backend.styles.css"/>
|
<link rel="stylesheet" href="~/Iceshrimp.Backend.styles.css"/>
|
||||||
<link rel="stylesheet" href="~/css/default.css"/>
|
<link rel="stylesheet" href="~/css/default.css"/>
|
||||||
@await RenderSectionAsync("head", false)
|
@await RenderSectionAsync("head", false)
|
||||||
|
@ -12,3 +12,4 @@
|
||||||
@RenderBody()
|
@RenderBody()
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@* ReSharper restore Html.PathError *@
|
|
@ -28,13 +28,13 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private bool collapseNavMenu = true;
|
private bool _collapseNavMenu = true;
|
||||||
|
|
||||||
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
|
private string? NavMenuCssClass => _collapseNavMenu ? "collapse" : null;
|
||||||
|
|
||||||
private void ToggleNavMenu()
|
private void ToggleNavMenu()
|
||||||
{
|
{
|
||||||
collapseNavMenu = !collapseNavMenu;
|
_collapseNavMenu = !_collapseNavMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -4,16 +4,16 @@
|
||||||
|
|
||||||
<h1>Counter</h1>
|
<h1>Counter</h1>
|
||||||
|
|
||||||
<p role="status">Current count: @currentCount</p>
|
<p role="status">Current count: @_currentCount</p>
|
||||||
|
|
||||||
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
|
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private int currentCount = 0;
|
private int _currentCount;
|
||||||
|
|
||||||
private void IncrementCount()
|
private void IncrementCount()
|
||||||
{
|
{
|
||||||
currentCount++;
|
_currentCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
<p>This component demonstrates fetching data from the server.</p>
|
<p>This component demonstrates fetching data from the server.</p>
|
||||||
|
|
||||||
@if (forecasts == null)
|
@if (_forecasts == null)
|
||||||
{
|
{
|
||||||
<p>
|
<p>
|
||||||
<em>Loading...</em>
|
<em>Loading...</em>
|
||||||
|
@ -25,7 +25,7 @@ else
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach (var forecast in forecasts)
|
@foreach (var forecast in _forecasts)
|
||||||
{
|
{
|
||||||
<tr>
|
<tr>
|
||||||
<td>@forecast.Date.ToShortDateString()</td>
|
<td>@forecast.Date.ToShortDateString()</td>
|
||||||
|
@ -39,11 +39,11 @@ else
|
||||||
}
|
}
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private WeatherForecast[]? forecasts;
|
private WeatherForecast[]? _forecasts;
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json");
|
_forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WeatherForecast
|
public class WeatherForecast
|
||||||
|
|
|
@ -6,6 +6,6 @@ var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||||
builder.RootComponents.Add<App>("#app");
|
builder.RootComponents.Add<App>("#app");
|
||||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||||
|
|
||||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
builder.Services.AddScoped(_ => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
||||||
|
|
||||||
await builder.Build().RunAsync();
|
await builder.Build().RunAsync();
|
Loading…
Add table
Reference in a new issue