diff --git a/.vs/SummerBestWebForm2/v17/.suo b/.vs/SummerBestWebForm2/v17/.suo index 90cb9c7..c8fdb99 100644 Binary files a/.vs/SummerBestWebForm2/v17/.suo and b/.vs/SummerBestWebForm2/v17/.suo differ diff --git a/.vs/SummerBestWebForm2/v17/DocumentLayout.backup.json b/.vs/SummerBestWebForm2/v17/DocumentLayout.backup.json index 42d0450..400ee1c 100644 --- a/.vs/SummerBestWebForm2/v17/DocumentLayout.backup.json +++ b/.vs/SummerBestWebForm2/v17/DocumentLayout.backup.json @@ -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": "" } ] diff --git a/.vs/SummerBestWebForm2/v17/DocumentLayout.json b/.vs/SummerBestWebForm2/v17/DocumentLayout.json index 192414d..1089f0c 100644 --- a/.vs/SummerBestWebForm2/v17/DocumentLayout.json +++ b/.vs/SummerBestWebForm2/v17/DocumentLayout.json @@ -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": "" } ] diff --git a/ClassObj/IPAddressService.cs b/ClassObj/IPAddressService.cs new file mode 100644 index 0000000..75d1b7f --- /dev/null +++ b/ClassObj/IPAddressService.cs @@ -0,0 +1,8 @@ +namespace SummerBestWebForm2.ClassObj; + +public class IPAddressService +{ + public const string TokenName = "IPAddress"; + + public string RemoteIpAddress { get; set; } = "Not Set"; +} diff --git a/Components/App.razor b/Components/App.razor index 97f2bbb..67a8a85 100644 --- a/Components/App.razor +++ b/Components/App.razor @@ -1,4 +1,5 @@ - +@implements IDisposable + @@ -29,14 +30,16 @@ min-height: 100vh; } - + @* *@ + - + @* *@ + @@ -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(ClassObj.IPAddressService.TokenName, this.RemoteIpAddress); + return Task.CompletedTask; + } + + void IDisposable.Dispose() + { + _persistingSubscription?.Dispose(); + } +#endregion + private string errMsg = string.Empty; } diff --git a/Components/IPAddressGrabber.razor b/Components/IPAddressGrabber.razor new file mode 100644 index 0000000..aea203c --- /dev/null +++ b/Components/IPAddressGrabber.razor @@ -0,0 +1,28 @@ +@using ClassObj +

IPAddressGrabber

+ +@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(IPAddressService.TokenName, out var address)) + { + this.RemoteIpAddress = address ?? "Not Set"; + this.IPAddressService.RemoteIpAddress = this.RemoteIpAddress; + } + + _subsequentRender = true; + return Task.CompletedTask; + } +} diff --git a/Components/Pages/Error.razor b/Components/Pages/Error.razor index 576cc2d..7d98bd9 100644 --- a/Components/Pages/Error.razor +++ b/Components/Pages/Error.razor @@ -8,29 +8,29 @@ @if (ShowRequestId) { -

- Request ID: @RequestId -

+

+ Request ID: @RequestId +

}

Development Mode

- Swapping to Development environment will display more detailed information about the error that occurred. + Swapping to Development environment will display more detailed information about the error that occurred.

- The Development environment shouldn't be enabled for deployed applications. - It can result in displaying sensitive information from exceptions to end users. - For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development - and restarting the app. + The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app.

-@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; } diff --git a/Components/Pages/Home.razor b/Components/Pages/Home.razor index 0c60611..d33c490 100644 --- a/Components/Pages/Home.razor +++ b/Components/Pages/Home.razor @@ -1,5 +1,6 @@ @rendermode InteractiveServer @inject PersistentComponentState ApplicationState +@inject ClassObj.IPAddressService IpAddressService @page "/" Welcome @@ -520,5 +521,6 @@ else DateCreated: @appState.DateCreated DateExpires: @appState.DateExpires IPAddress: @appState.myIpAddress + IPAddress2: @(IpAddressService.RemoteIpAddress.ToString()) } diff --git a/Components/Pages/Home.razor.cs b/Components/Pages/Home.razor.cs index c3a2c2a..1e888d6 100644 --- a/Components/Pages/Home.razor.cs +++ b/Components/Pages/Home.razor.cs @@ -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; diff --git a/Components/Pages/Weather.razor b/Components/Pages/Weather.razor index 8eca4cc..cef893e 100644 --- a/Components/Pages/Weather.razor +++ b/Components/Pages/Weather.razor @@ -8,56 +8,56 @@ @if (forecasts == null) { -

Loading...

+

Loading...

} else { - - - - - - - - - - - @foreach (var forecast in forecasts) - { - - - - - - - } - -
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
+ + + + + + + + + + + @foreach (var forecast in forecasts) + { + + + + + + + } + +
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
} @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); + } } diff --git a/Components/Routes.razor b/Components/Routes.razor index 51f8750..09ab959 100644 --- a/Components/Routes.razor +++ b/Components/Routes.razor @@ -1,4 +1,5 @@  + diff --git a/Program.cs b/Program.cs index 283bcf2..0495bd4 100644 --- a/Program.cs +++ b/Program.cs @@ -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(); + builder.Services.AddScoped(); // IPADDR var app = builder.Build(); diff --git a/obj/Debug/net8.0/SummerBestWebForm2.AssemblyInfo.cs b/obj/Debug/net8.0/SummerBestWebForm2.AssemblyInfo.cs index 582779c..e3416e0 100644 --- a/obj/Debug/net8.0/SummerBestWebForm2.AssemblyInfo.cs +++ b/obj/Debug/net8.0/SummerBestWebForm2.AssemblyInfo.cs @@ -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")] diff --git a/obj/Debug/net8.0/SummerBestWebForm2.AssemblyInfoInputs.cache b/obj/Debug/net8.0/SummerBestWebForm2.AssemblyInfoInputs.cache index 81717f5..cfc1754 100644 --- a/obj/Debug/net8.0/SummerBestWebForm2.AssemblyInfoInputs.cache +++ b/obj/Debug/net8.0/SummerBestWebForm2.AssemblyInfoInputs.cache @@ -1 +1 @@ -2de27890b60d31f362d1cf2d47078e797ede6fcf6283df998427d26b7d368448 +693802ef0a848d3bf856626462ce9d619e0d8f7d05d5669a9af2d1e415ade510 diff --git a/obj/Debug/net8.0/SummerBestWebForm2.GeneratedMSBuildEditorConfig.editorconfig b/obj/Debug/net8.0/SummerBestWebForm2.GeneratedMSBuildEditorConfig.editorconfig index a7b2a48..03d47e7 100644 --- a/obj/Debug/net8.0/SummerBestWebForm2.GeneratedMSBuildEditorConfig.editorconfig +++ b/obj/Debug/net8.0/SummerBestWebForm2.GeneratedMSBuildEditorConfig.editorconfig @@ -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 =