Fix display progressbar

This commit is contained in:
Samuele Locatelli
2023-12-15 11:09:34 +01:00
parent 96a8f577a4
commit 515e06f853
6 changed files with 20 additions and 15 deletions
+1 -3
View File
@@ -3,9 +3,7 @@
<b>MP-TAB2 @(DateTime.Today.Year)</b> | <span class="small">v.@version</span>
</div>
<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>
<ProgBar currVal="@CurrExpVal" maxVal="@MaxExpVal" singleLine="true" baseUM="m" yelLim="@yLimit" redLim="@rLimit"></ProgBar>
</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>
+13 -6
View File
@@ -18,17 +18,21 @@ namespace MP_TAB_SERV.Components
}
}
protected string dtScadProg { get; set; } = "";
public double CurrExpVal { get; set; } = 50;
public double MaxExpVal { get; set; } = 100;
public double yLimit { get; set; } = 30;
public double rLimit { get; set; } = 10;
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
{
var pUpd = Task.Run(async () =>
{
var diffOfTime = DateTime.Now.Subtract(MsgServ.dtLastAction);
dtScadProg = $"{((int)diffOfTime.TotalMinutes * 100) / dtScadLogin}%";
await InvokeAsync(() => StateHasChanged());
});
{
var diffOfTime = DateTime.Now.Subtract(MsgServ.dtLastAction);
CurrExpVal = MaxExpVal - diffOfTime.TotalMinutes;
await InvokeAsync(() => StateHasChanged());
});
pUpd.Wait();
}
@@ -66,6 +70,9 @@ namespace MP_TAB_SERV.Components
var rawVers = typeof(Program).Assembly.GetName().Version;
version = rawVers != null ? rawVers : new Version("0.0.0.0");
dtScadLogin = SMServ.GetConfInt("TAB_dtTimerScadLogin");
MaxExpVal = dtScadLogin;
yLimit = MaxExpVal * 0.3;
rLimit = MaxExpVal * 0.1;
StartTimer();
}
+3 -3
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>6.16.2312.1510</Version>
<Version>6.16.2312.1511</Version>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP_TAB_SERV</RootNamespace>
</PropertyGroup>
@@ -17,8 +17,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="EgwCoreLib.Razor" Version="1.4.2311.1612" />
<PackageReference Include="EgwCoreLib.Utils" Version="1.4.2311.1612" />
<PackageReference Include="EgwCoreLib.Razor" Version="1.4.2312.1510" />
<PackageReference Include="EgwCoreLib.Utils" Version="1.4.2312.1510" />
<PackageReference Include="StackExchange.Redis" Version="2.2.4" />
</ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2312.1510</h4>
<h4>Versione: 6.16.2312.1511</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2312.1510
6.16.2312.1511
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2312.1510</version>
<version>6.16.2312.1511</version>
<url>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/MP-TAB-SERV.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>