arthur_errorview #22

Merged
arthur.valin merged 2 commits from arthur_errorview into master 2 years ago

@ -8,8 +8,14 @@
</Found> </Found>
<NotFound> <NotFound>
<CascadingAuthenticationState> <CascadingAuthenticationState>
<LayoutView Layout="@typeof(CraftLayout)"> <LayoutView Layout="@typeof(ErrorLayout)">
<p>Sorry, there's nothing at this address.</p> @{ErrorHandler(5);}
<div style="width: 100%;">
<br /><br />
<strong>Oups, la page que à laquelle vous essayez d'accéder n'existe pas !</strong>
<p>Retour à la page d'accueil dans 5s</p>
<br /><br />
</div>
</LayoutView> </LayoutView>
</CascadingAuthenticationState> </CascadingAuthenticationState>
</NotFound> </NotFound>

@ -0,0 +1,26 @@
using CraftSharp.Shared;
using Microsoft.AspNetCore.Components;
namespace CraftSharp
{
public partial class App
{
[Inject]
public NavigationManager NavigationManager { get; set; }
[Inject]
public ILogger<ErrorLayout> Logger { get; set; }
public async Task ErrorHandler(int countdown) {
Logger.Log(LogLevel.Error, $"Navigating to unknown page : {NavigationManager.Uri}");
while(countdown > 0)
{
await Task.Delay(1000);
countdown--;
StateHasChanged();
}
NavigationManager.NavigateTo("index");
}
}
}

@ -8,13 +8,9 @@
pointer-events: none; pointer-events: none;
} }
.spacer{
height: 300px;
}
.main_div { .main_div {
background: url("../Images/blur_background.jpg") center center/cover no-repeat fixed; background: url("../Images/blur_background.jpg") center center/cover no-repeat fixed;
color: white; color: white;
min-height: 100vh;
position: relative; position: relative;
} }

@ -0,0 +1,21 @@
@inherits LayoutComponentBase
<PageTitle>CraftSharp</PageTitle>
<div class="main_div">
<HeaderLayout />
<article class="content px-4">
@Body
</article>
<div class="bedrock_footer">
<img class="bedrock_footer_img" src="/Images/bedrock_footer.png" />
<div class="px-4 culture">
<CultureSelector />
</div>
</div>
</div>

@ -0,0 +1,20 @@
.bedrock_footer {
width: 100%;
position: relative;
}
.bedrock_footer_img {
width: 100%;
pointer-events: none;
}
.main_div {
background: url("../Images/error_background.jpg") center center/cover no-repeat fixed;
color: white;
position: relative;
}
.culture {
position: absolute;
bottom: 0;
}

@ -1,16 +0,0 @@
<div class="alert alert-secondary mt-4">
<span class="oi oi-pencil me-2" aria-hidden="true"></span>
<strong>@Title</strong>
<span class="text-nowrap">
Please take our
<a target="_blank" class="font-weight-bold link-dark" href="https://go.microsoft.com/fwlink/?linkid=2149017">brief survey</a>
</span>
and tell us what you think.
</div>
@code {
// Demonstrates how a parent component can supply parameters
[Parameter]
public string? Title { get; set; }
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 KiB

Loading…
Cancel
Save