From 3f1531a934bd396bf83b3933c438e0b28d284590 Mon Sep 17 00:00:00 2001 From: Gordon Pedersen Date: Tue, 11 Jun 2024 10:36:48 +1000 Subject: [PATCH] Now, now garden and profile pages --- Components/ExternalPageComponent.razor | 33 ++++++++++++++++ Components/Layout/NavMenu.razor | 12 ++++++ Components/Pages/Ephemeral.razor | 2 +- Components/Pages/Now.razor | 34 ++++++++++++++++ Components/Pages/Person.razor | 52 +++++++++++++++++++++++++ Components/Pages/Pics.razor | 2 +- Components/Pages/StatuslogLatest.razor | 18 +-------- Models/AddressResponseData.cs | 7 ---- Models/NowData.cs | 17 ++++++++ Models/NowResponseData.cs | 13 +++++++ Models/State.cs | 33 ++++++++++++++++ Models/TimeData.cs | 14 +++++++ RestService.cs | 21 +++++++++- wwwroot/css/style.css | 44 +++++++++++++++++++-- wwwroot/index.html | 1 + wwwroot/vendor/iframe-resizer/child.js | 24 ++++++++++++ wwwroot/vendor/iframe-resizer/parent.js | 24 ++++++++++++ 17 files changed, 320 insertions(+), 31 deletions(-) create mode 100644 Components/ExternalPageComponent.razor create mode 100644 Components/Pages/Now.razor create mode 100644 Models/NowData.cs create mode 100644 Models/NowResponseData.cs create mode 100644 Models/TimeData.cs create mode 100644 wwwroot/vendor/iframe-resizer/child.js create mode 100644 wwwroot/vendor/iframe-resizer/parent.js diff --git a/Components/ExternalPageComponent.razor b/Components/ExternalPageComponent.razor new file mode 100644 index 0000000..65b3f1b --- /dev/null +++ b/Components/ExternalPageComponent.razor @@ -0,0 +1,33 @@ +@inject IJSRuntime JS +@if(Html != null) { + +} + + + + +@code { + [Parameter] + public string Url { get; set; } + [Parameter] + public string id { get; set; } + public MarkupString? Html { get; set; } + + protected override async Task OnAfterRenderAsync(bool firstRender) { + if(firstRender){ + await Reload(); + } + } + + public async Task Reload() { + if (Html == null){ + RestService api = new RestService(); + Html = await api.GetHtml(Url); + string? HtmlString = Html?.ToString(); + HtmlString = HtmlString?.Replace("", ""); + HtmlString = HtmlString?.Replace("", ""); + Html = (MarkupString)HtmlString; + } + await InvokeAsync(StateHasChanged); + } +} diff --git a/Components/Layout/NavMenu.razor b/Components/Layout/NavMenu.razor index 8e705e9..1fc9cd4 100644 --- a/Components/Layout/NavMenu.razor +++ b/Components/Layout/NavMenu.razor @@ -55,6 +55,10 @@
Eph.emer.al
+ + +
Now.garden
+