This commit is contained in:
RDeck 2025-05-30 03:58:16 -04:00
parent 90ec402c8f
commit 7e385edd94
15 changed files with 174 additions and 214 deletions

Binary file not shown.

View File

@ -3,28 +3,12 @@
"WorkspaceRootPath": "C:\\Repos\\SummerBestWebForm2\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|c:\\repos\\summerbestwebform2\\components\\pages\\test.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}",
"RelativeMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|solutionrelative:components\\pages\\test.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}"
},
{
"AbsoluteMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|c:\\repos\\summerbestwebform2\\components\\pages\\home.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}",
"RelativeMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|solutionrelative:components\\pages\\home.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}"
"AbsoluteMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|c:\\repos\\summerbestwebform2\\components\\pages\\error.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}",
"RelativeMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|solutionrelative:components\\pages\\error.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}"
},
{
"AbsoluteMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|c:\\repos\\summerbestwebform2\\components\\pages\\weather.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}",
"RelativeMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|solutionrelative:components\\pages\\weather.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}"
},
{
"AbsoluteMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|c:\\repos\\summerbestwebform2\\components\\app.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}",
"RelativeMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|solutionrelative:components\\app.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}"
},
{
"AbsoluteMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|c:\\repos\\summerbestwebform2\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|solutionrelative:program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|c:\\repos\\summerbestwebform2\\components\\pages\\home.razor.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|solutionrelative:components\\pages\\home.razor.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
@ -34,7 +18,7 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 16,
"SelectedChildIndex": 12,
"Children": [
{
"$type": "Bookmark",
@ -80,82 +64,30 @@
"$type": "Bookmark",
"Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}"
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "App.razor",
"DocumentMoniker": "C:\\Repos\\SummerBestWebForm2\\Components\\App.razor",
"RelativeDocumentMoniker": "Components\\App.razor",
"ToolTip": "C:\\Repos\\SummerBestWebForm2\\Components\\App.razor",
"RelativeToolTip": "Components\\App.razor",
"ViewState": "AgIAAC0AAAAAAAAAAAAAAAAAAAAHAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|",
"WhenOpened": "2025-05-29T18:24:38.258Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 5,
"Title": "Home.razor.cs",
"DocumentMoniker": "C:\\Repos\\SummerBestWebForm2\\Components\\Pages\\Home.razor.cs",
"RelativeDocumentMoniker": "Components\\Pages\\Home.razor.cs",
"ToolTip": "C:\\Repos\\SummerBestWebForm2\\Components\\Pages\\Home.razor.cs",
"RelativeToolTip": "Components\\Pages\\Home.razor.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-05-29T18:24:42.784Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "Home.razor",
"DocumentMoniker": "C:\\Repos\\SummerBestWebForm2\\Components\\Pages\\Home.razor",
"RelativeDocumentMoniker": "Components\\Pages\\Home.razor",
"ToolTip": "C:\\Repos\\SummerBestWebForm2\\Components\\Pages\\Home.razor",
"RelativeToolTip": "Components\\Pages\\Home.razor",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|",
"WhenOpened": "2025-05-29T18:25:48.345Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "Program.cs",
"DocumentMoniker": "C:\\Repos\\SummerBestWebForm2\\Program.cs",
"RelativeDocumentMoniker": "Program.cs",
"ToolTip": "C:\\Repos\\SummerBestWebForm2\\Program.cs",
"RelativeToolTip": "Program.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAEAAAAiAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-05-29T18:26:18.113Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "Weather.razor",
"DocumentMoniker": "C:\\Repos\\SummerBestWebForm2\\Components\\Pages\\Weather.razor",
"RelativeDocumentMoniker": "Components\\Pages\\Weather.razor",
"ToolTip": "C:\\Repos\\SummerBestWebForm2\\Components\\Pages\\Weather.razor",
"RelativeToolTip": "Components\\Pages\\Weather.razor",
"ViewState": "AgIAAAAAAAAAAAAAAAAAABQAAAAgAAAAAAAAAA==",
"ViewState": "AgIAAAwAAAAAAAAAAAAAADwAAAAkAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|",
"WhenOpened": "2025-05-29T18:28:11.235Z",
"WhenOpened": "2025-05-30T07:56:59.41Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Test.razor",
"DocumentMoniker": "C:\\Repos\\SummerBestWebForm2\\Components\\Pages\\Test.razor",
"RelativeDocumentMoniker": "Components\\Pages\\Test.razor",
"ToolTip": "C:\\Repos\\SummerBestWebForm2\\Components\\Pages\\Test.razor",
"RelativeToolTip": "Components\\Pages\\Test.razor",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Title": "Error.razor",
"DocumentMoniker": "C:\\Repos\\SummerBestWebForm2\\Components\\Pages\\Error.razor",
"RelativeDocumentMoniker": "Components\\Pages\\Error.razor",
"ToolTip": "C:\\Repos\\SummerBestWebForm2\\Components\\Pages\\Error.razor",
"RelativeToolTip": "Components\\Pages\\Error.razor",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAB8AAABBAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|",
"WhenOpened": "2025-05-29T18:28:44.014Z",
"WhenOpened": "2025-05-30T07:57:59.014Z",
"EditorCaption": ""
}
]

View File

@ -3,24 +3,12 @@
"WorkspaceRootPath": "C:\\Repos\\SummerBestWebForm2\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|c:\\repos\\summerbestwebform2\\components\\pages\\home.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}",
"RelativeMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|solutionrelative:components\\pages\\home.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}"
"AbsoluteMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|c:\\repos\\summerbestwebform2\\components\\ipaddressgrabber.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}",
"RelativeMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|solutionrelative:components\\ipaddressgrabber.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}"
},
{
"AbsoluteMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|c:\\repos\\summerbestwebform2\\components\\pages\\weather.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}",
"RelativeMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|solutionrelative:components\\pages\\weather.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}"
},
{
"AbsoluteMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|c:\\repos\\summerbestwebform2\\components\\app.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}",
"RelativeMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|solutionrelative:components\\app.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}"
},
{
"AbsoluteMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|c:\\repos\\summerbestwebform2\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|solutionrelative:program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|c:\\repos\\summerbestwebform2\\components\\pages\\home.razor.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{10E16044-8880-42A4-866B-B0461C450A71}|SummerBestWebForm2.csproj|solutionrelative:components\\pages\\home.razor.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
@ -30,7 +18,7 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 13,
"SelectedChildIndex": 12,
"Children": [
{
"$type": "Bookmark",
@ -76,58 +64,6 @@
"$type": "Bookmark",
"Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}"
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "App.razor",
"DocumentMoniker": "C:\\Repos\\SummerBestWebForm2\\Components\\App.razor",
"RelativeDocumentMoniker": "Components\\App.razor",
"ToolTip": "C:\\Repos\\SummerBestWebForm2\\Components\\App.razor",
"RelativeToolTip": "Components\\App.razor",
"ViewState": "AgIAAC0AAAAAAAAAAAAAAAAAAAAHAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|",
"WhenOpened": "2025-05-29T18:24:38.258Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "Home.razor.cs",
"DocumentMoniker": "C:\\Repos\\SummerBestWebForm2\\Components\\Pages\\Home.razor.cs",
"RelativeDocumentMoniker": "Components\\Pages\\Home.razor.cs",
"ToolTip": "C:\\Repos\\SummerBestWebForm2\\Components\\Pages\\Home.razor.cs",
"RelativeToolTip": "Components\\Pages\\Home.razor.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-05-29T18:24:42.784Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Home.razor",
"DocumentMoniker": "C:\\Repos\\SummerBestWebForm2\\Components\\Pages\\Home.razor",
"RelativeDocumentMoniker": "Components\\Pages\\Home.razor",
"ToolTip": "C:\\Repos\\SummerBestWebForm2\\Components\\Pages\\Home.razor",
"RelativeToolTip": "Components\\Pages\\Home.razor",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|",
"WhenOpened": "2025-05-29T18:25:48.345Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "Program.cs",
"DocumentMoniker": "C:\\Repos\\SummerBestWebForm2\\Program.cs",
"RelativeDocumentMoniker": "Program.cs",
"ToolTip": "C:\\Repos\\SummerBestWebForm2\\Program.cs",
"RelativeToolTip": "Program.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAEAAAAiAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-05-29T18:26:18.113Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
@ -136,9 +72,22 @@
"RelativeDocumentMoniker": "Components\\Pages\\Weather.razor",
"ToolTip": "C:\\Repos\\SummerBestWebForm2\\Components\\Pages\\Weather.razor",
"RelativeToolTip": "Components\\Pages\\Weather.razor",
"ViewState": "AgIAAAAAAAAAAAAAAAAAABQAAAAgAAAAAAAAAA==",
"ViewState": "AgIAAAwAAAAAAAAAAAAAADwAAAAkAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|",
"WhenOpened": "2025-05-29T18:28:11.235Z",
"WhenOpened": "2025-05-30T07:56:59.41Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "IPAddressGrabber.razor",
"DocumentMoniker": "C:\\Repos\\SummerBestWebForm2\\Components\\IPAddressGrabber.razor",
"RelativeDocumentMoniker": "Components\\IPAddressGrabber.razor",
"ToolTip": "C:\\Repos\\SummerBestWebForm2\\Components\\IPAddressGrabber.razor",
"RelativeToolTip": "Components\\IPAddressGrabber.razor",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|",
"WhenOpened": "2025-05-30T07:58:10.038Z",
"EditorCaption": ""
}
]

View File

@ -0,0 +1,8 @@
namespace SummerBestWebForm2.ClassObj;
public class IPAddressService
{
public const string TokenName = "IPAddress";
public string RemoteIpAddress { get; set; } = "Not Set";
}

View File

@ -1,4 +1,5 @@
<!DOCTYPE html>
@implements IDisposable
<!DOCTYPE html>
<html lang="en">
<head>
@ -29,14 +30,16 @@
min-height: 100vh;
}
</style>
<HeadOutlet @rendermode="@(new InteractiveServerRenderMode(false))" />
@* <HeadOutlet @rendermode="@(new InteractiveServerRenderMode(false))" /> *@
<HeadOutlet @rendermode="InteractiveServer" />
<link rel="stylesheet" href="https://blazor.cdn.telerik.com/blazor/6.2.0/kendo-theme-bootstrap/swatches/bootstrap-urban.css" />
<script src="https://blazor.cdn.telerik.com/blazor/6.2.0/telerik-blazor.min.js" defer></script>
</head>
<body>
<!-- Turn off pre-rendering -->
<Routes @rendermode="@(new InteractiveServerRenderMode(false))" />
@* <Routes @rendermode="@(new InteractiveServerRenderMode(false))" /> *@
<Routes @rendermode="InteractiveServer" />
<script src="_framework/blazor.web.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/js/bootstrap.bundle.min.js" integrity="sha512-7Pi/otdlbbCR+LnW+F7PwFcSDJOuUJB3OxtEHbg4vSMvzvJjde4Po1v4BR9Gdc9aXNUNFVUY+SK51wWT8WF0Gg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/js/all.min.js" integrity="sha512-u3fPA7V8qQmhBPNT5quvaXVa1mnnLSXUep5PS1qo5NRzHwG19aHmNJnj1Q8hpA/nBWZtZD4r4AX6YOt5ynLN2g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
@ -89,5 +92,32 @@
@code {
[CascadingParameter]
public CascadingAppState appState { get; set; }
#region "IPADDR"
[CascadingParameter] HttpContext? HttpContext { get; set; }
[Inject] public PersistentComponentState ApplicationState { get; set; } = default!;
private PersistingComponentStateSubscription? _persistingSubscription;
private bool _subsequentRender;
private string RemoteIpAddress = "Not Set";
protected override void OnInitialized()
{
this.RemoteIpAddress = this.HttpContext?.Connection.RemoteIpAddress?.ToString() ?? "Not Set";
_persistingSubscription = ApplicationState.RegisterOnPersisting(this.PersistData);
}
public Task PersistData()
{
this.ApplicationState.PersistAsJson<string>(ClassObj.IPAddressService.TokenName, this.RemoteIpAddress);
return Task.CompletedTask;
}
void IDisposable.Dispose()
{
_persistingSubscription?.Dispose();
}
#endregion
private string errMsg = string.Empty;
}

View File

@ -0,0 +1,28 @@
@using ClassObj
<h3>IPAddressGrabber</h3>
@code {
[Inject] public IPAddressService IPAddressService { get; set; } = default!;
[Inject] public PersistentComponentState ApplicationState { get; set; } = default!;
private bool _subsequentRender;
private const string TokenName = "IPAddress";
private string RemoteIpAddress = "Not Set";
// Short circuit all the lifecycle stuff - we don't need it
public override Task SetParametersAsync(ParameterView parameters)
{
if (_subsequentRender)
return Task.CompletedTask;
// if not prerender, try and get the persisted value
if (this.ApplicationState.TryTakeFromJson<string>(IPAddressService.TokenName, out var address))
{
this.RemoteIpAddress = address ?? "Not Set";
this.IPAddressService.RemoteIpAddress = this.RemoteIpAddress;
}
_subsequentRender = true;
return Task.CompletedTask;
}
}

View File

@ -8,29 +8,29 @@
@if (ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@RequestId</code>
</p>
<p>
<strong>Request ID:</strong> <code>@RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
@code{
[CascadingParameter]
private HttpContext? HttpContext { get; set; }
@code {
[CascadingParameter]
private HttpContext? HttpContext { get; set; }
private string? RequestId { get; set; }
private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
private string? RequestId { get; set; }
private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
protected override void OnInitialized() =>
RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
protected override void OnInitialized() =>
RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
}

View File

@ -1,5 +1,6 @@
@rendermode InteractiveServer
@inject PersistentComponentState ApplicationState
@inject ClassObj.IPAddressService IpAddressService
@page "/"
<PageTitle>Welcome</PageTitle>
@ -520,5 +521,6 @@ else
DateCreated: @appState.DateCreated
DateExpires: @appState.DateExpires
IPAddress: @appState.myIpAddress
IPAddress2: @(IpAddressService.RemoteIpAddress.ToString())
</pre>
}

View File

@ -8,13 +8,17 @@ using System.Net.Http;
using System.Text.Json;
using Microsoft.Extensions.Options;
using SummerBestWebForm2.AppState;
using SummerBestWebForm2.ClassObj;
namespace SummerBestWebForm2.Components.Pages;
public partial class Home
{
[CascadingParameter]
public CascadingAppState appState { get; set; }
public CascadingAppState appState { get; set; } = default!;
//[Inject] IPAddressService IpAddressService { get; set; } = default!;
async Task OnFinishHandler()
//private void SaveIt()
@ -159,7 +163,7 @@ public partial class Home
public bool? IsDesignChoiceValid { get; set; } = false;
[CascadingParameter]
public DialogFactory Dialogs { get; set; }
public DialogFactory Dialogs { get; set; } = default!;
public bool ShowWizard { get; set; } = true;

View File

@ -8,56 +8,56 @@
@if (forecasts == null)
{
<p><em>Loading...</em></p>
<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>
<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;
private WeatherForecast[]? forecasts;
protected override async Task OnInitializedAsync()
{
// Simulate asynchronous loading to demonstrate a loading indicator
await Task.Delay(500);
protected override async Task OnInitializedAsync()
{
// Simulate asynchronous loading to demonstrate a loading indicator
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();
}
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);
}
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);
}
}

View File

@ -1,4 +1,5 @@
<!-- Wrap the router in a cascading app state -->
<IPAddressGrabber />
<CascadingAppState>
<Router AppAssembly="typeof(Program).Assembly">
<Found Context="routeData">

View File

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.ResponseCompression;
using SummerBestWebForm2.ClassObj;
using SummerBestWebForm2.Components;
using System.IO.Compression;
@ -32,6 +33,7 @@ namespace SummerBestWebForm2
builder.Services.AddHttpContextAccessor();
builder.Services.AddScoped<HttpContextAccessor>();
builder.Services.AddScoped<IPAddressService>(); // IPADDR
var app = builder.Build();

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("SummerBestWebForm2")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8490ef01857e10ece7d6fd766ad123c5a53a024f")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+90ec402c8f209ea928327a0151975a536bd86dd1")]
[assembly: System.Reflection.AssemblyProductAttribute("SummerBestWebForm2")]
[assembly: System.Reflection.AssemblyTitleAttribute("SummerBestWebForm2")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
2de27890b60d31f362d1cf2d47078e797ede6fcf6283df998427d26b7d368448
693802ef0a848d3bf856626462ce9d619e0d8f7d05d5669a9af2d1e415ade510

View File

@ -28,6 +28,10 @@ build_metadata.AdditionalFiles.CssScope =
build_metadata.AdditionalFiles.TargetPath = Q29tcG9uZW50c1xBcHAucmF6b3I=
build_metadata.AdditionalFiles.CssScope =
[C:/Repos/SummerBestWebForm2/Components/IPAddressGrabber.razor]
build_metadata.AdditionalFiles.TargetPath = Q29tcG9uZW50c1xJUEFkZHJlc3NHcmFiYmVyLnJhem9y
build_metadata.AdditionalFiles.CssScope =
[C:/Repos/SummerBestWebForm2/Components/Pages/Counter.razor]
build_metadata.AdditionalFiles.TargetPath = Q29tcG9uZW50c1xQYWdlc1xDb3VudGVyLnJhem9y
build_metadata.AdditionalFiles.CssScope =