Fix ui
This commit is contained in:
26
salesbook.Shared/Components/Layout/ConnectionState.razor
Normal file
26
salesbook.Shared/Components/Layout/ConnectionState.razor
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<div class="Connection @(ShowWarning ? "Show" : "Hide") @(IsNetworkAvailable? ServicesIsDown ? "ServicesIsDown" : "SystemOk" : "NetworkKo")">
|
||||||
|
@if (IsNetworkAvailable)
|
||||||
|
{
|
||||||
|
if(ServicesIsDown)
|
||||||
|
{
|
||||||
|
<i class="ri-cloud-off-fill"></i>
|
||||||
|
<span>Servizi offline</span>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<i class="ri-cloud-fill"></i>
|
||||||
|
<span>Online</span>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<i class="ri-wifi-off-line"></i>
|
||||||
|
<span>Nessuna connessione</span>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@code{
|
||||||
|
[Parameter] public bool IsNetworkAvailable { get; set; }
|
||||||
|
[Parameter] public bool ServicesIsDown { get; set; }
|
||||||
|
[Parameter] public bool ShowWarning { get; set; }
|
||||||
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
@using System.Globalization
|
@using System.Globalization
|
||||||
@using salesbook.Shared.Core.Interface
|
|
||||||
@using salesbook.Shared.Core.Interface.IntegryApi
|
@using salesbook.Shared.Core.Interface.IntegryApi
|
||||||
@using salesbook.Shared.Core.Interface.System.Network
|
@using salesbook.Shared.Core.Interface.System.Network
|
||||||
@using salesbook.Shared.Core.Messages.Back
|
@using salesbook.Shared.Core.Messages.Back
|
||||||
@@ -14,29 +13,10 @@
|
|||||||
<MudDialogProvider/>
|
<MudDialogProvider/>
|
||||||
<MudSnackbarProvider/>
|
<MudSnackbarProvider/>
|
||||||
|
|
||||||
|
<ConnectionState IsNetworkAvailable="IsNetworkAvailable" ServicesIsDown="ServicesIsDown" ShowWarning="ShowWarning" />
|
||||||
|
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<NavMenu/>
|
<NavMenu/>
|
||||||
|
|
||||||
<div class="Connection @(ShowWarning ? "Show" : "Hide") @(IsNetworkAvailable? ServicesIsDown ? "ServicesIsDown" : "SystemOk" : "NetworkKo")">
|
|
||||||
@if (IsNetworkAvailable)
|
|
||||||
{
|
|
||||||
if(ServicesIsDown)
|
|
||||||
{
|
|
||||||
<i class="ri-cloud-off-fill"></i>
|
|
||||||
<span>Servizi offline</span>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<i class="ri-cloud-fill"></i>
|
|
||||||
<span>Online</span>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<i class="ri-wifi-off-line"></i>
|
|
||||||
<span>Nessuna connessione</span>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<article>
|
<article>
|
||||||
@@ -51,13 +31,12 @@
|
|||||||
private string _mainContentClass = "";
|
private string _mainContentClass = "";
|
||||||
|
|
||||||
//Connection state
|
//Connection state
|
||||||
private bool FirstCheck { get; set; } = true;
|
|
||||||
private bool _isNetworkAvailable;
|
private bool _isNetworkAvailable;
|
||||||
private bool _servicesIsDown;
|
private bool _servicesIsDown;
|
||||||
private bool _showWarning;
|
private bool _showWarning;
|
||||||
|
|
||||||
private DateTime _lastApiCheck = DateTime.MinValue;
|
private DateTime _lastApiCheck = DateTime.MinValue;
|
||||||
private const int DelaySeconds = 180;
|
private const int DelaySeconds = 90;
|
||||||
|
|
||||||
private CancellationTokenSource? _cts;
|
private CancellationTokenSource? _cts;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
@using System.Globalization
|
@using System.Globalization
|
||||||
@using System.Text.RegularExpressions
|
|
||||||
@using CommunityToolkit.Mvvm.Messaging
|
@using CommunityToolkit.Mvvm.Messaging
|
||||||
@using salesbook.Shared.Components.Layout
|
@using salesbook.Shared.Components.Layout
|
||||||
@using salesbook.Shared.Components.Layout.Overlay
|
@using salesbook.Shared.Components.Layout.Overlay
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
html { overflow: hidden; }
|
html { overflow: hidden; }
|
||||||
|
|
||||||
.page, article, main { height: 100% !important; }
|
.page, article, main { height: 100% !important; overflow: hidden; }
|
||||||
|
|
||||||
#app { height: 100vh; }
|
#app { height: 100vh; }
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ article {
|
|||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.page > .Connection.Hide ~ main {
|
.Connection.Hide ~ .page {
|
||||||
transition: all 0.5s ease;
|
transition: all 0.5s ease;
|
||||||
transform: translateY(-35px);
|
transform: translateY(-35px);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user