Compare commits

..

4 Commits

Author SHA1 Message Date
25f3934408
updating deps, shifting pages and components into client library, using radzen layout
All checks were successful
ci / Build & Unit Test (8.0.x) (push) Successful in 2m24s
ci / Build Containers (push) Successful in 16m5s
2024-09-30 17:16:59 +01:00
5ff8d3409b
reducing memory usage in job runner 2024-09-29 10:15:11 +01:00
c6cc09b422
adding about page 2024-09-29 10:14:43 +01:00
e13239077a
fixing regex 2024-09-29 10:12:36 +01:00
29 changed files with 307 additions and 397 deletions

View File

@ -12,7 +12,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.25.0" />
<PackageReference Include="MongoDB.Driver" Version="2.29.0" />
</ItemGroup>
</Project>

View File

@ -10,11 +10,17 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0"/>
<PackageReference Include="NUnit" Version="3.13.3"/>
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1"/>
<PackageReference Include="NUnit.Analyzers" Version="3.6.1"/>
<PackageReference Include="coverlet.collector" Version="6.0.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>

View File

@ -1,5 +1,5 @@
@using Overflow.SouthernWater
@rendermode RenderMode.InteractiveAuto
@rendermode InteractiveRenderMode
<RadzenStack>
<RadzenStack Gap="0">

View File

@ -1,5 +1,5 @@
@using Overflow.SouthernWater
@rendermode RenderMode.InteractiveAuto
@rendermode InteractiveRenderMode
@inject DialogService DialogService
@if (Job == null)

View File

@ -1,6 +1,6 @@
@using System.Globalization
@using Overflow.SouthernWater
@rendermode RenderMode.InteractiveAuto
@rendermode InteractiveRenderMode
@if (Job == null)
{

View File

@ -1,16 +1,37 @@
@inherits LayoutComponentBase
<div class="page">
<div class="sidebar">
<RadzenLayout>
<RadzenHeader>
<NavMenu/>
</div>
</RadzenHeader>
<RadzenBody>
<div class="page">
<main>
<div class="top-row px-4">
<a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a>
</div>
<article class="content px-4">
@Body
</article>
</main>
</div>
</RadzenBody>
<RadzenFooter>
<div style="text-align: center">
<a href="https://sarsoo.xyz/about/" style="display: inline-block">
<img src="/andy.png"
alt="AP"
width="100px"
style="display: block;
margin-left: auto;
margin-right: auto;
filter: contrast(70%);">
</a>
</div>
</RadzenFooter>
</RadzenLayout>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<RadzenComponents @rendermode="InteractiveRenderMode"/>

View File

@ -1,40 +1,25 @@
<div class="top-row ps-3 navbar navbar-dark">
<div class="container-fluid">
<a class="navbar-brand" href="">Overflow.Web.Client</a>
<button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</div>
@rendermode InteractiveRenderMode
<div class="@NavMenuCssClass nav-scrollable" @onclick="ToggleNavMenu">
<nav class="flex-column">
<div class="nav-item px-3">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<span class="bi bi-house-door-fill-nav-menu" aria-hidden="true"></span> Home
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="counter">
<span class="bi bi-plus-square-fill-nav-menu" aria-hidden="true"></span> Counter
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="weather">
<span class="bi bi-list-nested-nav-menu" aria-hidden="true"></span> Weather
</NavLink>
</div>
</nav>
</div>
<RadzenMenu Click="OnParentClicked" Style="height:100%;">
<RadzenMenuItem Text="Home" Icon="home" Path="/">
</RadzenMenuItem>
<RadzenMenuItem Text="Southern Water" Icon="water_drop">
<RadzenMenuItem Text="About" Path="/sw-about" Icon="apartment"></RadzenMenuItem>
<RadzenMenuItem Text="Spills Data" Path="/spills" Icon="table_view"></RadzenMenuItem>
<RadzenMenuItem Text="Spill Events" Path="/spills-cal" Icon="event"></RadzenMenuItem>
</RadzenMenuItem>
<RadzenAppearanceToggle />
</RadzenMenu>
@code {
private bool collapseNavMenu = true;
private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
private void ToggleNavMenu()
void OnParentClicked(MenuItemEventArgs args)
{
collapseNavMenu = !collapseNavMenu;
}
}
void OnChildClicked(MenuItemEventArgs args)
{
}
}

View File

@ -9,9 +9,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" PrivateAssets="all"/>
<PackageReference Include="Radzen.Blazor" Version="4.32.6" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.8" PrivateAssets="all" />
<PackageReference Include="Radzen.Blazor" Version="5.2.5" />
</ItemGroup>
<ItemGroup>

View File

@ -1,19 +0,0 @@
@page "/counter"
<PageTitle>Counter</PageTitle>
<h1>Counter</h1>
<p role="status">Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
}

View File

@ -1,7 +1,59 @@
@page "/"
<PageTitle>Home</PageTitle>
<PageTitle>Overflow</PageTitle>
<h1>Hello, world!</h1>
<div class="rz-p-12">
<RadzenText TextStyle="TextStyle.DisplayH1">Overflow</RadzenText>
</div>
Welcome to your new app.
<div>
<RadzenRow class="rz-text-align-center" Gap="1rem">
<RadzenColumn class="rz-p-3">
<RadzenCard>
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Start" Gap="1rem" Class="rz-p-4">
<RadzenIcon Icon="shower"/>
<RadzenStack Gap="0">
<RadzenText TextStyle="TextStyle.Subtitle1">Woops</RadzenText>
</RadzenStack>
</RadzenStack>
<p>During times of overwhelming rainfall in the UK, storm overflows release unprocessed sewage into waterways and oceans to avoid sewage systems backing up and eventually flooding.</p>
<p>There have been controversies for many of the private water companies of the UK that suggest these storm overflows are overused - contaminating British waterways and oceans.</p>
</RadzenCard>
</RadzenColumn>
<RadzenColumn class="rz-p-3">
<RadzenCard>
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Start" Gap="1rem" Class="rz-p-4">
<RadzenIcon Icon="monitor"/>
<RadzenStack Gap="0">
<RadzenText TextStyle="TextStyle.Subtitle1">Having a look</RadzenText>
</RadzenStack>
</RadzenStack>
<p>I have found that the websites that the water companies use to report overflow usage can be poor at best. Overflow aims to cache this data and present it in an easier to consume fashion</p>
</RadzenCard>
</RadzenColumn>
<RadzenColumn class="rz-p-3">
<RadzenCard>
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Start" Gap="1rem" Class="rz-p-4">
<RadzenIcon Icon="water_drop"/>
<RadzenStack Gap="0">
<RadzenText TextStyle="TextStyle.Subtitle1">Context</RadzenText>
</RadzenStack>
</RadzenStack>
<p>Like a lot of UK public infrastructure, the water utility companies were privatised in the 1980s.</p>
<p>The UK is one of very few countries to have a fully privatised water system and was the first to do so.</p>
</RadzenCard>
</RadzenColumn>
<RadzenColumn class="rz-p-3">
<RadzenCard>
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Start" Gap="1rem" Class="rz-p-4">
<RadzenIcon Icon="currency_pound"/>
<RadzenStack Gap="0">
<RadzenText TextStyle="TextStyle.Subtitle1">Investment/Plundering</RadzenText>
</RadzenStack>
</RadzenStack>
While <RadzenLink Path="https://www.ofwat.gov.uk/investment-in-the-water-industry/#qu1" Text="OFWAT suggests" target="_blank"/> that investment in UK water systems has only increased since privatisation,
<RadzenLink Path="https://www.bbc.co.uk/news/articles/cw4478wnjdpo" Text="Research from the University of Greenwich" target="_blank"/> has found that investors have managed to withdraw £85.2bn between 1989 and 2023.
</RadzenCard>
</RadzenColumn>
</RadzenRow>
</div>

View File

@ -0,0 +1,117 @@
@page "/sw-about"
<PageTitle>Southern Water</PageTitle>
<div class="rz-p-12">
<RadzenText TextStyle="TextStyle.DisplayH1">Southern Water</RadzenText>
</div>
<div Class="rz-p-0 rz-p-md-12">
<RadzenTimeline Orientation="Orientation.Vertical" LinePosition="LinePosition.Center" Reverse="false" Class="rz-m-4">
<Items>
<RadzenTimelineItem PointStyle="PointStyle.Primary">
<LabelContent>
<RadzenText TextStyle="TextStyle.Subtitle2" Class="rz-m-0 rz-color-primary">JUL 1989</RadzenText>
</LabelContent>
<ChildContent>
Southern Water Ltd. is formed from Southern Water Authority
</ChildContent>
</RadzenTimelineItem>
<RadzenTimelineItem>
<LabelContent>
<RadzenText TextStyle="TextStyle.Subtitle2" Class="rz-m-0 rz-color-primary">JUN 1996</RadzenText>
</LabelContent>
<ChildContent>
Southern Water overtaken by Scottish Power in a hostile takeover. Majority of in-house scientific laboratory services and assets sold off
</ChildContent>
</RadzenTimelineItem>
<RadzenTimelineItem>
<LabelContent>
<RadzenText TextStyle="TextStyle.Subtitle2" Class="rz-m-0 rz-color-primary">MAR 2002</RadzenText>
</LabelContent>
<ChildContent>
Scottish Power sells Southern Water to First Aqua Limited
</ChildContent>
</RadzenTimelineItem>
<RadzenTimelineItem>
<LabelContent>
<RadzenText TextStyle="TextStyle.Subtitle2" Class="rz-m-0 rz-color-primary">OCT 2007</RadzenText>
</LabelContent>
<ChildContent>
Greensands Investments Limited buys Southern Water
</ChildContent>
</RadzenTimelineItem>
<RadzenTimelineItem>
<LabelContent>
<RadzenText TextStyle="TextStyle.Subtitle2" Class="rz-m-0 rz-color-primary">MAY 2007</RadzenText>
</LabelContent>
<ChildContent>
<RadzenLink Path="https://www.kentonline.co.uk/kent/news/southern-water-fined-after-herne-a66532/" Text="£10,000 fine after sewage spills into stream in Beltinge, Kent - polluting 550 yards of Bishopstone Glen" target="_blank"></RadzenLink>
</ChildContent>
</RadzenTimelineItem>
<RadzenTimelineItem>
<LabelContent>
<RadzenText TextStyle="TextStyle.Subtitle2" Class="rz-m-0 rz-color-primary">NOV 2007</RadzenText>
</LabelContent>
<ChildContent>
<RadzenLink Path="https://www.theguardian.com/business/2007/nov/15/southernwater" Text="OFWAT fine of £20.3m for 'deliberate misreporting' and failing to meet guaranteed standards of service to customers" target="_blank"></RadzenLink>
</ChildContent>
</RadzenTimelineItem>
<RadzenTimelineItem>
<LabelContent>
<RadzenText TextStyle="TextStyle.Subtitle2" Class="rz-m-0 rz-color-primary">JUN 2010</RadzenText>
</LabelContent>
<ChildContent>
<RadzenLink Path="https://www.waterbriefing.org/index.php/home/company-news/item/1206-southern-water-fined-for-polluting-river-with-raw-sewage)" Text="£3,000 fine for polluting 2km of Sussex stream with raw sewage, killing up to 100 brown trout and devastating the fish population for the second time in five years" target="_blank"></RadzenLink>
</ChildContent>
</RadzenTimelineItem>
<RadzenTimelineItem>
<LabelContent>
<RadzenText TextStyle="TextStyle.Subtitle2" Class="rz-m-0 rz-color-primary">SEP 2011</RadzenText>
</LabelContent>
<ChildContent>
<RadzenLink Path="https://www.bbc.co.uk/news/uk-england-hampshire-15122040" Text="£25,000 fine when Southampton water is flooded by sewage" target="_blank"></RadzenLink>
</ChildContent>
</RadzenTimelineItem>
<RadzenTimelineItem>
<LabelContent>
<RadzenText TextStyle="TextStyle.Subtitle2" Class="rz-m-0 rz-color-primary">MAR 2012</RadzenText>
</LabelContent>
<ChildContent>
<RadzenLink Path="https://www.kentonline.co.uk/kent/news/southern-water-fined-after-herne-a66532/" Text="£50,000 fine after 60 houses in Beltinge, Kent are flooded with Sewage" target="_blank"></RadzenLink>
</ChildContent>
</RadzenTimelineItem>
<RadzenTimelineItem>
<LabelContent>
<RadzenText TextStyle="TextStyle.Subtitle2" Class="rz-m-0 rz-color-primary">2020/2021</RadzenText>
</LabelContent>
<ChildContent>
<RadzenLink Path="https://www.portsmouth.co.uk/business/southern-water-bosses-handed-bonuses-totalling-ps840000-3313892" Text="CEO & CFO get £840,000 of bonuses" target="_blank"></RadzenLink>
</ChildContent>
</RadzenTimelineItem>
<RadzenTimelineItem>
<LabelContent>
<RadzenText TextStyle="TextStyle.Subtitle2" Class="rz-m-0 rz-color-primary">AUG 2021</RadzenText>
</LabelContent>
<ChildContent>
The Macquarie Group buys a majority stake
</ChildContent>
</RadzenTimelineItem>
<RadzenTimelineItem>
<LabelContent>
<RadzenText TextStyle="TextStyle.Subtitle2" Class="rz-m-0 rz-color-primary">2022/2023</RadzenText>
</LabelContent>
<ChildContent>
<RadzenLink Path="https://www.dailyecho.co.uk/news/23910692.reaction-southern-water-bosses-paid-600-000/" Text="Execs get £587,000 in total renumeration" target="_blank"></RadzenLink>
</ChildContent>
</RadzenTimelineItem>
</Items>
</RadzenTimeline>
</div>
<div>
<RadzenLink Path="https://en.wikipedia.org/wiki/Southern_Water" Text="Source [Wikipedia]" target="_blank"></RadzenLink>
</div>
@code {
}

View File

@ -1,7 +1,7 @@
@page "/spills"
@using MongoDB.Driver
@using Overflow.SouthernWater
@rendermode RenderMode.InteractiveServer
@rendermode InteractiveRenderMode
<PageTitle>Southern Water Spills</PageTitle>

View File

@ -1,7 +1,7 @@
@page "/spills-cal"
@using MongoDB.Driver
@using Overflow.SouthernWater
@rendermode RenderMode.InteractiveServer
@rendermode InteractiveRenderMode
<PageTitle>Southern Water Spills</PageTitle>

View File

@ -1,60 +0,0 @@
@page "/weather"
@inject HttpClient Http
<PageTitle>Weather</PageTitle>
<h1>Weather</h1>
<p>This component demonstrates fetching data from the server.</p>
@if (forecasts == null)
{
<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>
}
@code {
private WeatherForecast[]? forecasts;
protected override async Task OnInitializedAsync()
{
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json");
}
public 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

@ -0,0 +1,8 @@
using Microsoft.AspNetCore.Components;
namespace Overflow.Web.Client;
public static class RenderModeSettings
{
public static IComponentRenderMode? InteractiveRenderMode { get; set; }
}

View File

@ -3,10 +3,13 @@
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.AspNetCore.Components.WebAssembly.Http
@using Microsoft.JSInterop
@using Overflow.Web.Client
@using Overflow.Web
@using Overflow.Web.Client.Pages
@using Overflow.Web.Client.Components
@using Overflow.Web.Client.Layout
@using Radzen
@using Radzen.Blazor
@using static RenderModeSettings

View File

@ -5,11 +5,12 @@
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<base href="/"/>
<link rel="stylesheet" href="_content/Radzen.Blazor/css/material-base.css">
<link rel="stylesheet" href="bootstrap/bootstrap.min.css"/>
<link rel="stylesheet" href="app.css"/>
<link rel="stylesheet" href="Overflow.Web.styles.css"/>
<link rel="stylesheet" href="Overflow.Web.Client.styles.css"/>
<link rel="icon" type="image/png" href="favicon.png"/>
<RadzenTheme Theme="material-dark" @rendermode="InteractiveRenderMode" />
<HeadOutlet/>
</head>
@ -19,22 +20,4 @@
<script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>
</body>
<footer class="footer text-muted" style="margin-top: 50px">
<div class="container">
&copy; 2024 - Overflow
</div>
<div style="text-align: center">
<a href="https://sarsoo.xyz/about/" style="display: inline-block">
<img src="/andy.png"
alt="AP"
width="120px"
style="display: block;
margin-left: auto;
margin-right: auto;
filter: contrast(70%);
padding: 8px">
</a>
</div>
</footer>
</html>

View File

@ -1,19 +0,0 @@
@inherits LayoutComponentBase
<NavMenu/>
<div class="page">
<main>
<article class="content px-4">
@Body
</article>
</main>
</div>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<RadzenComponents @rendermode="InteractiveServer"/>

View File

@ -1,96 +0,0 @@
.page {
position: relative;
display: flex;
flex-direction: column;
}
main {
flex: 1;
}
.sidebar {
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}
.top-row {
background-color: #f7f7f7;
border-bottom: 1px solid #d6d5d5;
justify-content: flex-end;
height: 3.5rem;
display: flex;
align-items: center;
}
.top-row ::deep a, .top-row ::deep .btn-link {
white-space: nowrap;
margin-left: 1.5rem;
text-decoration: none;
}
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
text-decoration: underline;
}
.top-row ::deep a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}
@media (max-width: 640.98px) {
.top-row {
justify-content: space-between;
}
.top-row ::deep a, .top-row ::deep .btn-link {
margin-left: 0;
}
}
@media (min-width: 641px) {
.page {
flex-direction: row;
}
.sidebar {
width: 250px;
height: 100vh;
position: sticky;
top: 0;
}
.top-row {
position: sticky;
top: 0;
z-index: 1;
}
.top-row.auth ::deep a:first-child {
flex: 1;
text-align: right;
width: 0;
}
.top-row, article {
padding-left: 2rem !important;
padding-right: 1.5rem !important;
}
}
#blazor-error-ui {
background: lightyellow;
bottom: 0;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
display: none;
left: 0;
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
position: fixed;
width: 100%;
z-index: 1000;
}
#blazor-error-ui .dismiss {
cursor: pointer;
position: absolute;
right: 0.75rem;
top: 0.5rem;
}

View File

@ -1,23 +0,0 @@
@rendermode InteractiveServer
<RadzenMenu Click="OnParentClicked">
<RadzenMenuItem Text="Home" Icon="home" Path="/">
</RadzenMenuItem>
<RadzenMenuItem Text="Southern Water" Icon="water_drop">
<RadzenMenuItem Text="Spills Data" Path="/spills" Icon="table_view"></RadzenMenuItem>
<RadzenMenuItem Text="Spill Events" Path="/spills-cal" Icon="event"></RadzenMenuItem>
</RadzenMenuItem>
</RadzenMenu>
@code {
void OnParentClicked(MenuItemEventArgs args)
{
}
void OnChildClicked(MenuItemEventArgs args)
{
}
}

View File

@ -1,59 +0,0 @@
@page "/"
<PageTitle>Overflow</PageTitle>
<div class="rz-p-12">
<RadzenText TextStyle="TextStyle.DisplayH1">Overflow</RadzenText>
</div>
<div>
<RadzenRow class="rz-text-align-center" Gap="1rem">
<RadzenColumn class="rz-p-3">
<RadzenCard>
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Start" Gap="1rem" Class="rz-p-4">
<RadzenIcon Icon="shower"/>
<RadzenStack Gap="0">
<RadzenText TextStyle="TextStyle.Subtitle1">Woops</RadzenText>
</RadzenStack>
</RadzenStack>
<p>During times of overwhelming rainfall in the UK, storm overflows release unprocessed sewage into waterways and oceans to avoid sewage systems backing up and eventually flooding.</p>
<p>There have been controversies for many of the private water companies of the UK that suggest these storm overflows are overused - contaminating British waterways and oceans.</p>
</RadzenCard>
</RadzenColumn>
<RadzenColumn class="rz-p-3">
<RadzenCard>
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Start" Gap="1rem" Class="rz-p-4">
<RadzenIcon Icon="monitor"/>
<RadzenStack Gap="0">
<RadzenText TextStyle="TextStyle.Subtitle1">Having a look</RadzenText>
</RadzenStack>
</RadzenStack>
<p>I have found that the websites that the water companies use to report overflow usage can be poor at best. Overflow aims to cache this data and present it in an easier to consume fashion</p>
</RadzenCard>
</RadzenColumn>
<RadzenColumn class="rz-p-3">
<RadzenCard>
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Start" Gap="1rem" Class="rz-p-4">
<RadzenIcon Icon="water_drop"/>
<RadzenStack Gap="0">
<RadzenText TextStyle="TextStyle.Subtitle1">Context</RadzenText>
</RadzenStack>
</RadzenStack>
<p>Like a lot of UK public infrastructure, the water utility companies were privatised in the 1980s.</p>
<p>The UK is one of very few countries to have a fully privatised water system and was the first to do so.</p>
</RadzenCard>
</RadzenColumn>
<RadzenColumn class="rz-p-3">
<RadzenCard>
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Start" Gap="1rem" Class="rz-p-4">
<RadzenIcon Icon="currency_pound"/>
<RadzenStack Gap="0">
<RadzenText TextStyle="TextStyle.Subtitle1">Investment/Plundering</RadzenText>
</RadzenStack>
</RadzenStack>
While <RadzenLink Path="https://www.ofwat.gov.uk/investment-in-the-water-industry/#qu1" Text="OFWAT suggests" target="_blank"/> that investment in UK water systems has only increased since privatisation,
<RadzenLink Path="https://www.bbc.co.uk/news/articles/cw4478wnjdpo" Text="Research from the University of Greenwich" target="_blank"/> has found that investors have managed to withdraw £85.2bn between 1989 and 2023.
</RadzenCard>
</RadzenColumn>
</RadzenRow>
</div>

View File

@ -1,6 +1,7 @@
<Router AppAssembly="@typeof(Program).Assembly">
<Router AppAssembly="@typeof(Program).Assembly"
AdditionalAssemblies="new[] {typeof(Overflow.Web.Client.Components.SpillsCalendar).Assembly}">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)"/>
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Overflow.Web.Client.Layout.MainLayout)"/>
<FocusOnNavigate RouteData="@routeData" Selector="h1"/>
</Found>
</Router>

View File

@ -12,3 +12,4 @@
@using Overflow.Web.Client.Components
@using Radzen
@using Radzen.Blazor
@using static Overflow.Web.Client.RenderModeSettings

View File

@ -7,16 +7,16 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.6" />
<PackageReference Include="MongoDB.Driver" Version="2.25.0" />
<PackageReference Include="NLog" Version="5.3.2" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.11" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.3.11" />
<PackageReference Include="Quartz" Version="3.9.0" />
<PackageReference Include="Quartz.AspNetCore" Version="3.9.0" />
<PackageReference Include="Quartz.Extensions.DependencyInjection" Version="3.9.0" />
<PackageReference Include="Quartz.Extensions.Hosting" Version="3.9.0" />
<PackageReference Include="Radzen.Blazor" Version="4.32.6" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.8" />
<PackageReference Include="MongoDB.Driver" Version="2.29.0" />
<PackageReference Include="NLog" Version="5.3.4" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.14" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.3.14" />
<PackageReference Include="Quartz" Version="3.13.0" />
<PackageReference Include="Quartz.AspNetCore" Version="3.13.0" />
<PackageReference Include="Quartz.Extensions.DependencyInjection" Version="3.13.0" />
<PackageReference Include="Quartz.Extensions.Hosting" Version="3.13.0" />
<PackageReference Include="Radzen.Blazor" Version="5.2.5" />
</ItemGroup>
<ItemGroup>
@ -37,4 +37,8 @@
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="Components\Layout\" />
</ItemGroup>
</Project>

View File

@ -1,12 +1,16 @@
using Overflow.Web.Components;
using Microsoft.AspNetCore.Components.Web;
using Overflow;
using MongoDB.Driver;
using NLog.Extensions.Logging;
using Overflow.SouthernWater;
using Overflow.Web.Client;
using Quartz;
using Quartz.AspNetCore;
using Radzen;
using App = Overflow.Web.Components.App;
RenderModeSettings.InteractiveRenderMode = RenderMode.InteractiveAuto;
var builder = WebApplication.CreateBuilder(args);
@ -19,16 +23,16 @@ builder.Logging.ClearProviders();
builder.Logging.AddNLog(builder.Configuration);
var driver = new MongoClient(builder.Configuration.GetConnectionString("Default"));
builder.Services.AddSingleton(driver);
builder.Services.AddScoped<IMongoDatabase>(s => s.GetRequiredService<MongoClient>().GetDatabase(Static.DatabaseName));
builder.Services.AddSingleton(driver)
.AddScoped<IMongoDatabase>(s => s.GetRequiredService<MongoClient>().GetDatabase(Static.DatabaseName));
builder.Services.AddControllers();
// base configuration from appsettings.json
builder.Services.Configure<QuartzOptions>(builder.Configuration.GetSection("Quartz"));
builder.Services.Configure<QuartzOptions>(builder.Configuration.GetSection("Quartz"))
// if you are using persistent job store, you might want to alter some options
builder.Services.Configure<QuartzOptions>(options =>
.Configure<QuartzOptions>(options =>
{
options.Scheduling.IgnoreDuplicates = true; // default: false
options.Scheduling.OverWriteExistingData = true; // default: true
@ -85,14 +89,14 @@ builder.Services.AddQuartzServer(options =>
options.WaitForJobsToComplete = false;
});
builder.Services.AddHttpClient();
builder.Services.AddSingleton<SouthernWaterApi>();
builder.Services.AddScoped<SouthernWaterApiJobRunner, SouthernWaterApiJobRunnerPersisting>();
builder.Services.AddTransient<SouthernWaterJob>();
builder.Services.AddHttpClient()
.AddSingleton<SouthernWaterApi>()
.AddScoped<SouthernWaterApiJobRunner, SouthernWaterApiJobRunnerPersisting>()
.AddTransient<SouthernWaterJob>();
builder.Services.AddSingleton<SpillCache>();
builder.Services.AddSingleton<SouthernWaterSpillCache>();
builder.Services.AddHostedService<LoadCacheOnStart>();
builder.Services.AddSingleton<SpillCache>()
.AddSingleton<SouthernWaterSpillCache>()
.AddHostedService<LoadCacheOnStart>();
builder.Services.AddRadzenComponents();
@ -108,11 +112,12 @@ if (!app.Environment.IsDevelopment())
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseAntiforgery();
app.UseStaticFiles()
.UseAntiforgery();
app.MapControllers();
app.MapRazorComponents<App>()
.AddAdditionalAssemblies(typeof(Overflow.Web.Client.Components.SpillsCalendar).Assembly)
.AddInteractiveServerRenderMode()
.AddInteractiveWebAssemblyRenderMode();

View File

@ -8,12 +8,12 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageReference Include="MongoDB.Driver" Version="2.25.0" />
<PackageReference Include="Quartz" Version="3.9.0" />
<PackageReference Include="MongoDB.Driver" Version="2.29.0" />
<PackageReference Include="Quartz" Version="3.13.0" />
</ItemGroup>
<ItemGroup>

View File

@ -22,7 +22,7 @@ public partial class SouthernWaterApi
_logger = logger;
}
[GeneratedRegex(@".*const APIURL = '(?<APIURL>.*)'.*\n.*const APIGWKEY = '(?<APIKEY>.*)'.*", RegexOptions.IgnoreCase)]
[GeneratedRegex(@".APIURL=""(?<APIURL>.*)"".*APIGWKEY=""(?<APIKEY>.*?)"".*", RegexOptions.IgnoreCase)]
private static partial Regex ApiUrlAndKey();
public async Task LoadApiUrl()
@ -67,11 +67,13 @@ public partial class SouthernWaterApi
if (apiUrlFound)
{
baseUrl = apiUrl.Value;
_logger.LogInformation("API url found [{APIUrl}]", apiUrl);
}
if (apiKeyFound)
{
this.apiKey = apiKey.Value;
_logger.LogInformation("API key found [{APIKey}]", apiKey);
}
}
catch (HttpRequestException e)

View File

@ -8,7 +8,7 @@ public class SouthernWaterApiJobRunner(SouthernWaterApi client, ILogger<Southern
{
protected readonly ILogger<SouthernWaterApiJobRunner> _logger = logger;
public async Task<SouthernWaterApiJob> LoadSpills(int? pageLimit = null)
public async Task LoadSpills(int? pageLimit = null)
{
var interval = Static.Interval;
var job = new SouthernWaterApiJob
@ -39,7 +39,7 @@ public class SouthernWaterApiJobRunner(SouthernWaterApi client, ILogger<Southern
page.items.ForEach(s => s.JobId = job._id);
job.TotalItems = page.totalItems;
job.Spills.AddRange(page.items);
// job.Spills.AddRange(page.items);
try
{
await PageLoaded(job, page);
@ -62,8 +62,6 @@ public class SouthernWaterApiJobRunner(SouthernWaterApi client, ILogger<Southern
{
_logger.LogError(e, "Exception while running job finished callback");
}
return job;
}
protected virtual Task JobCreated(SouthernWaterApiJob job)