Fix pagina allarmi:

- richiesta pwd priam di fare setup
- fix comportamento
- fix salvataggio setup con filtro display
This commit is contained in:
Samuele Locatelli
2022-06-20 16:27:41 +02:00
parent eeb48a40a9
commit f96ba8388b
23 changed files with 141 additions and 36 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU;x86;x64</Platforms>
<Version>1.12206.2015</Version>
<Version>1.12206.2016</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>MAPO-MONO</i>
<h4>Version: 1.12206.2015</h4>
<h4>Version: 1.12206.2016</h4>
<br /> Release Note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.12206.2015
1.12206.2016
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.12206.2015</version>
<version>1.12206.2016</version>
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/MP.Mon.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+1 -1
View File
@@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU;x86;x64</Platforms>
<Version>1.12206.2015</Version>
<Version>1.12206.2016</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>MAPO-MONO</i>
<h4>Version: 1.12206.2015</h4>
<h4>Version: 1.12206.2016</h4>
<br /> Release Note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.12206.2015
1.12206.2016
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.12206.2015</version>
<version>1.12206.2016</version>
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/MP.Mon.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+1 -1
View File
@@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU;x86;x64</Platforms>
<Version>1.12206.2015</Version>
<Version>1.12206.2016</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>MAPO-MONO</i>
<h4>Version: 1.12206.2015</h4>
<h4>Version: 1.12206.2016</h4>
<br /> Release Note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.12206.2015
1.12206.2016
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.12206.2015</version>
<version>1.12206.2016</version>
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/MP.Mon.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
@@ -15,7 +15,7 @@
<div class="p-2">
<div class="d-flex ">
<div class="px-2">
<div class="input-group input-group-sm">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text">search</span>
</div>
@@ -43,9 +43,12 @@
<ul class="list-group">
@foreach (var item in ListRecords)
{
<li class="list-group-item list-group-item-action @cssSilenced(item.Muted)" @onclick="() => toggleMute(item)">
<div>@item.FullValue</div>
</li>
if (okShow(item.FullValue))
{
<li class="list-group-item list-group-item-action @cssSilenced(item.Muted)" @onclick="() => toggleMute(item)">
<div>@item.FullValue</div>
</li>
}
}
</ul>
</div>
@@ -8,6 +8,7 @@ namespace MP.MONO.UI.Components
#region Protected Fields
protected List<AlarmListModel>? ListRecords = null;
protected List<AlarmListModel>? DisplayRecords = null;
#endregion Protected Fields
@@ -28,21 +29,26 @@ namespace MP.MONO.UI.Components
{
ListRecords = null;
await Task.Delay(1);
var allData = await MMDataService.getAlarmRawSetup();
// filtro...
if (string.IsNullOrEmpty(SearchVal))
{
ListRecords = allData;
}
else
{
ListRecords = allData
.Where(x => x.FullValue.ToLower().Contains(SearchVal.ToLower()))
.ToList();
}
ListRecords = await MMDataService.getAlarmRawSetup();
await Task.Delay(1);
}
/// <summary>
/// Verifica se sia da mostrare (filtro SearchVal attivo e rispettato)
/// </summary>
/// <param name="fullVal"></param>
/// <returns></returns>
protected bool okShow(string fullVal)
{
bool answ = string.IsNullOrEmpty(SearchVal);
// se c'è filtro
if (!answ)
{
answ = fullVal.ToLower().Contains(SearchVal.ToLower());
}
return answ;
}
protected async Task resetAlarmSetup()
{
+14
View File
@@ -0,0 +1,14 @@
@inject IConfiguration Configuration;
<div class="card">
<div class="card-header">User Auth</div>
<div class="card-body">
<p>Please enter authorization code</p>
<div class="input-group">
<span class="input-group-text">Auth Code</span>
<input type="password" class="form-control" @bind-value="@authCode">
</div>
</div>
</div>
@@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using System.Net.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.Web.Virtualization;
using Microsoft.JSInterop;
using MP.MONO.UI;
using MP.MONO.UI.Shared;
using MP.MONO.UI.Components;
namespace MP.MONO.UI.Components
{
public partial class UserAuthCheck
{
private string _authCode { get; set; } = "";
private string passCode { get; set; } = "";
protected override void OnInitialized()
{
passCode = Configuration.GetValue<string>("OptPar:AuthCode");
}
private string authCode
{
get
{
return _authCode;
}
set
{
_authCode = value;
checkCode();
}
}
private void checkCode()
{
// se il codice corrisponde a quello da config...
if (!string.IsNullOrEmpty(authCode))
{
if (authCode.Equals(passCode))
{
checkOk.InvokeAsync(true);
}
}
}
[Parameter]
public EventCallback<bool> checkOk { get; set; }
}
}
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Platforms>AnyCPU;x86;x64</Platforms>
<Version>1.12206.2015</Version>
<Version>1.12206.2016</Version>
</PropertyGroup>
<ItemGroup>
+6 -2
View File
@@ -43,7 +43,7 @@
</div>
<div class="p-2">
<div class="form-check form-check-sm form-switch" title="Setup Alarms (mute/unmute)">
<input class="form-check-input" type="checkbox" id="mySwitch" name="setupAlarms" value="@doSetup" unchecked @onclick="() => SetupAlarms()">
<input class="form-check-input" type="checkbox" id="mySwitch" name="setupAlarms" value="@doSetup" unchecked @onclick="() => CheckAuth()">
<label class="form-check-label" for="mySwitch">Setup</label>
</div>
</div>
@@ -55,7 +55,11 @@
</div>
</div>
<div class="col-9">
@if (doSetup)
@if (reqPassw)
{
<UserAuthCheck checkOk="() => ShowSetup()"></UserAuthCheck>
}
else if (doSetup)
{
<AlarmsSetup></AlarmsSetup>
}
+20 -1
View File
@@ -7,6 +7,7 @@ namespace MP.MONO.UI.Pages
#region Protected Fields
protected bool doSetup = false;
protected bool reqPassw = false;
#endregion Protected Fields
@@ -86,10 +87,28 @@ namespace MP.MONO.UI.Pages
});
}
protected async Task SetupAlarms()
protected async Task ShowSetup()
{
await Task.Delay(1);
doSetup = !doSetup;
reqPassw = false;
await Task.Delay(1);
}
protected async Task CheckAuth()
{
await Task.Delay(1);
// se non sono già in edit mostro auth...
if (reqPassw || doSetup)
{
reqPassw = false;
}
else
{
reqPassw = !reqPassw;
}
doSetup = false;
await Task.Delay(1);
}
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>MAPO-MONO</i>
<h4>Version: 1.12206.2015</h4>
<h4>Version: 1.12206.2016</h4>
<br /> Release Note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.12206.2015
1.12206.2016
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.12206.2015</version>
<version>1.12206.2016</version>
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/MP.Mon.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+2 -1
View File
@@ -32,6 +32,7 @@
}
},
"OptPar": {
"MaintPendingRefreshVetoMin": 5
"MaintPendingRefreshVetoMin": 5,
"AuthCode": "MultiaxD5"
}
}