inizio gestione avanzamento progress bar
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
<div class="row bg-dark text-light px-2 small">
|
||||
<div class="col-6 text-left">
|
||||
<div class="col-4 text-left">
|
||||
<b>MP-TAB2 @(DateTime.Today.Year)</b> | <span class="small">v.@version</span>
|
||||
</div>
|
||||
<div class="col-6 text-end">
|
||||
<div class="col-4 d-flex flex-column justify-content-center">
|
||||
<div class="progress" role="progressbar" aria-label="Basic example" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
|
||||
<div class="progress-bar" style="width: @dtScadProg"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4 text-end d-flex align-items-center justify-content-end">
|
||||
<span class="small">@($"{DateTime.Now:HH:mm:ss}")</span> | <a class="text-light text-decoration-none" href="https://www.egalware.com/" target="_blank"><img class="img-fluid" width="16" src="images/LogoEgw.png" /> Egalware </a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -18,14 +18,17 @@ namespace MP_TAB_SERV.Components
|
||||
}
|
||||
}
|
||||
|
||||
protected string dtScadProg { get; set; } = "";
|
||||
|
||||
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
var diffOfTime = DateTime.Now - MsgServ.dtLastAction;
|
||||
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
var diffOfTime = DateTime.Now.Subtract(MsgServ.dtLastAction);
|
||||
dtScadProg = $"{((int)diffOfTime.TotalMinutes * 100) / dtScadLogin}%";
|
||||
await InvokeAsync(() => StateHasChanged());
|
||||
});
|
||||
});
|
||||
pUpd.Wait();
|
||||
}
|
||||
|
||||
@@ -42,6 +45,8 @@ namespace MP_TAB_SERV.Components
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected int dtScadLogin { get; set; } = 0;
|
||||
|
||||
[Inject]
|
||||
protected MessageService MsgServ { get; set; } = null!;
|
||||
|
||||
@@ -60,6 +65,7 @@ namespace MP_TAB_SERV.Components
|
||||
await Task.Delay(1);
|
||||
var rawVers = typeof(Program).Assembly.GetName().Version;
|
||||
version = rawVers != null ? rawVers : new Version("0.0.0.0");
|
||||
dtScadLogin = SMServ.GetConfInt("TAB_dtTimerScadLogin");
|
||||
StartTimer();
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace MP_TAB_SERV.Components
|
||||
|
||||
protected string CurrOprTknRedis { get; set; } = null!;
|
||||
|
||||
protected DateTime expDT { get; set; } = DateTime.Now;
|
||||
protected int expLoginType { get; set; } = 0;
|
||||
|
||||
protected bool HideMenu
|
||||
{
|
||||
@@ -66,7 +66,15 @@ namespace MP_TAB_SERV.Components
|
||||
|
||||
protected async Task RefreshLogIn(string decodValue)
|
||||
{
|
||||
bool done = await MsgServ.DoLogIn(decodValue, false);
|
||||
bool done = false;
|
||||
if (expLoginType == 0)
|
||||
{
|
||||
done = await MsgServ.DoLogIn(decodValue, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
done = await MsgServ.DoLogIn(decodValue, true);
|
||||
}
|
||||
if (done)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(LastOpenedPage) && !string.IsNullOrEmpty(CurrMacc))
|
||||
@@ -124,8 +132,7 @@ namespace MP_TAB_SERV.Components
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await Task.Delay(1);
|
||||
int expDays = SMServ.GetConfInt("cookieDayExpire");
|
||||
expDT = DateTime.Now.AddDays(expDays);
|
||||
expLoginType = SMServ.GetConfInt("TAB_TypeScadLogin");
|
||||
var CurrDevGuid = await MsgServ.GetCurrDevGuidLSAsync();
|
||||
|
||||
//if (string.IsNullOrEmpty(CurrDevGuid.ToString()))
|
||||
|
||||
@@ -107,6 +107,11 @@ namespace MP_TAB_SERV.Shared
|
||||
{
|
||||
NavMan.NavigateTo("logout");
|
||||
}
|
||||
else
|
||||
{
|
||||
MsgServ.dtLastAction = DateTime.Now;
|
||||
MsgServ.dtLastSave = DateTime.Now;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (tsDeltaAct.Minutes >= dtScadLogin)
|
||||
|
||||
Reference in New Issue
Block a user