From 12eaa5814ef20b0910e8d64a753378b6f6797989 Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Fri, 22 May 2026 00:52:16 +1000 Subject: Initial commit --- Server/Components/App.razor | 24 ++++++++++++++++++++++++ Server/Components/Pages/Error.razor | 36 ++++++++++++++++++++++++++++++++++++ Server/Components/_Imports.razor | 11 +++++++++++ 3 files changed, 71 insertions(+) create mode 100644 Server/Components/App.razor create mode 100644 Server/Components/Pages/Error.razor create mode 100644 Server/Components/_Imports.razor (limited to 'Server/Components') diff --git a/Server/Components/App.razor b/Server/Components/App.razor new file mode 100644 index 0000000..614372e --- /dev/null +++ b/Server/Components/App.razor @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Server/Components/Pages/Error.razor b/Server/Components/Pages/Error.razor new file mode 100644 index 0000000..576cc2d --- /dev/null +++ b/Server/Components/Pages/Error.razor @@ -0,0 +1,36 @@ +@page "/Error" +@using System.Diagnostics + +Error + +

Error.

+

An error occurred while processing your request.

+ +@if (ShowRequestId) +{ +

+ Request ID: @RequestId +

+} + +

Development Mode

+

+ 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. +

+ +@code{ + [CascadingParameter] + private HttpContext? HttpContext { get; set; } + + private string? RequestId { get; set; } + private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + + protected override void OnInitialized() => + RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; +} diff --git a/Server/Components/_Imports.razor b/Server/Components/_Imports.razor new file mode 100644 index 0000000..2986fa6 --- /dev/null +++ b/Server/Components/_Imports.razor @@ -0,0 +1,11 @@ +@using System.Net.Http +@using System.Net.Http.Json +@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.JSInterop +@using HyperBooru.Server +@using HyperBooru.Client +@using HyperBooru.Server.Components -- cgit v1.3