Compare commits

...

2 commits

Author SHA1 Message Date
434c84ce5c Add user agent so non-api requests work again 2024-06-24 11:41:03 +10:00
c7400ca42f Splash fixes 2024-06-24 11:40:24 +10:00
3 changed files with 25 additions and 4 deletions

View file

@ -3,7 +3,13 @@
<Router AppAssembly="@typeof(MauiProgram).Assembly">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)">
<Authorizing>Logging in...</Authorizing>
<Authorizing>
<div class="no-border responsive max no-padding center-align middle-align">
<div class="padding">
<img src="/img/prami-neighbourhood.svg" class="extra" />
</div>
</div>
</Authorizing>
<NotAuthorized><RedirectToLogin /></NotAuthorized>
</AuthorizeRouteView>
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
@ -11,8 +17,13 @@
<NotFound>
<CascadingAuthenticationState>
<LayoutView Layout="@typeof(Layout.MainLayout)">
<img data-emoji="🦒" />
<p>Sorry, there's nothing here.</p>
<div class="no-border responsive max no-padding center-align middle-align">
<div class="padding">
<img src="/img/prami-neighbourhood.svg" class="extra" />
<p>Sorry, you seem to have landed nowhere.</p>
<small>@navigationManager.Uri</small>
</div>
</div>
</LayoutView>
</CascadingAuthenticationState>
</NotFound>

View file

@ -3,7 +3,9 @@ using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Forms;
using Neighbourhood.omg.lol.Models;
using System.Diagnostics;
using System.Net;
using System.Net.Http.Json;
using System.Reflection;
using System.Text;
using System.Text.Json;
using System.Text.RegularExpressions;
@ -17,6 +19,8 @@ namespace Neighbourhood.omg.lol {
public RestService(string? token = null) {
_client = new HttpClient();
_client.BaseAddress = new Uri(BaseUrl);
AssemblyName name = Assembly.GetExecutingAssembly().GetName();
_client.DefaultRequestHeaders.UserAgent.Add(new System.Net.Http.Headers.ProductInfoHeaderValue(name.Name ?? "Neighbourhood.omg.lol", name.Version?.ToString()));
_serializerOptions = new JsonSerializerOptions {
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower,
WriteIndented = true

View file

@ -26,7 +26,13 @@
<div class="status-bar-safe-area"></div>
<div id="app">Loading...</div>
<div id="app">
<main class="no-border responsive max no-padding center-align middle-align">
<div class="padding">
<img src="/img/prami-neighbourhood.svg" class="extra" />
</div>
</main>
</div>
<div id="blazor-error-ui">
An unhandled error has occurred.