This commit is contained in:
2025-09-16 10:46:56 +02:00
parent 83264731f3
commit e9a0ffdb7a
4 changed files with 31 additions and 27 deletions

View File

@@ -1,5 +1,4 @@
@using System.Globalization
@using salesbook.Shared.Core.Interface
@using salesbook.Shared.Core.Interface.IntegryApi
@using salesbook.Shared.Core.Interface.System.Network
@using salesbook.Shared.Core.Messages.Back
@@ -14,29 +13,10 @@
<MudDialogProvider/>
<MudSnackbarProvider/>
<ConnectionState IsNetworkAvailable="IsNetworkAvailable" ServicesIsDown="ServicesIsDown" ShowWarning="ShowWarning" />
<div class="page">
<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>
<article>
@@ -51,13 +31,12 @@
private string _mainContentClass = "";
//Connection state
private bool FirstCheck { get; set; } = true;
private bool _isNetworkAvailable;
private bool _servicesIsDown;
private bool _showWarning;
private DateTime _lastApiCheck = DateTime.MinValue;
private const int DelaySeconds = 180;
private const int DelaySeconds = 90;
private CancellationTokenSource? _cts;