Overflow/Overflow.Web/Components/Pages/SpillsCalendarPage.razor
Andy Pack 9331519649
Some checks are pending
ci / build (8.0.x) (push) Waiting to run
ci / build-Docker (push) Blocked by required conditions
adding calendar and try catch
2024-06-10 19:09:26 +01:00

35 lines
999 B
Plaintext

@page "/spills-cal"
@using MongoDB.Driver
@using Overflow.SouthernWater
@rendermode RenderMode.InteractiveServer
<PageTitle>Southern Water Spills</PageTitle>
<h1>Spills</h1>
<p>This shows the data that you can see on the Southern Water Beachbuoy system</p>
<RadzenCard class="my-4">
<RadzenStack Orientation="Orientation.Vertical" AlignItems="AlignItems.Start" Wrap="FlexWrap.Wrap">
@if (job is not null)
{
<RadzenText TextStyle="TextStyle.Body1">Last updated at <b>@job.EndTime</b></RadzenText>
}
</RadzenStack>
</RadzenCard>
<SpillsCalendar Job="@job" />
@code {
private SouthernWaterApiJob? job;
[Inject] private IMongoDatabase database { get; set; }
// private bool showIds;
protected override async Task OnInitializedAsync()
{
job = database.GetCollection<SouthernWaterApiJob>(Static.CollectionName)
.AsQueryable()
.OrderByDescending(j => j.EndTime)
.FirstOrDefault();
}
}