Aggiunto dialog promemoria
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
<div class="container container-modal">
|
||||
<div class="c-modal">
|
||||
<div class="exception-header mb-2">
|
||||
<i class="ri-emotion-unhappy-line"></i>
|
||||
<span>Ops</span>
|
||||
</div>
|
||||
<div class="text">
|
||||
@if (Exception != null)
|
||||
{
|
||||
<code>@Message</code>
|
||||
}
|
||||
</div>
|
||||
<div class="button-container">
|
||||
<div @onclick="OnRetryClick" class="card-button">
|
||||
<span>Riprova</span>
|
||||
</div>
|
||||
|
||||
<div @onclick="OnContinueClick" class="card-button">
|
||||
<span>Continua</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter] public Exception? Exception { get; set; }
|
||||
[Parameter] public EventCallback OnRetry { get; set; }
|
||||
[Parameter] public ErrorBoundary? ErrorBoundary { get; set; }
|
||||
|
||||
private string Message { get; set; } = "";
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
if (Exception == null) return;
|
||||
|
||||
if (Exception.Message.Contains("Failed to connect to"))
|
||||
{
|
||||
var ipPort = Exception.Message.Split("to /")[1];
|
||||
|
||||
Message = $"Impossibile collegarsi al server ({ipPort})";
|
||||
}
|
||||
else
|
||||
{
|
||||
Message = Exception.Message;
|
||||
}
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private async Task OnRetryClick()
|
||||
{
|
||||
await OnRetry.InvokeAsync();
|
||||
}
|
||||
|
||||
private async Task OnContinueClick()
|
||||
{
|
||||
NavigationManager.NavigateTo("/");
|
||||
await OnRetry.InvokeAsync();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
.container-modal {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.c-modal {
|
||||
border-radius: 16px;
|
||||
box-shadow: var(--exception-box-shadow);
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.button-container {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
margin: 1.5rem 0 0 0;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: medium;
|
||||
font-weight: 500;
|
||||
display: flex;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.card-button {
|
||||
text-align: center;
|
||||
background-color: transparent;
|
||||
padding: .3rem 1rem;
|
||||
font-weight: 700;
|
||||
color: var(--bs-primary-text-emphasis);
|
||||
}
|
||||
|
||||
.exception-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.exception-header > i {
|
||||
font-size: 3rem;
|
||||
line-height: normal;
|
||||
color: var(--bs-danger);
|
||||
}
|
||||
|
||||
.exception-header > span {
|
||||
font-size: x-large;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
code {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
color: var(--bs-gray-dark);
|
||||
}
|
||||
Reference in New Issue
Block a user