aggiunta counter allarmi + fix grafico
This commit is contained in:
@@ -7,12 +7,34 @@
|
||||
|
||||
@if (@ListRecords != null)
|
||||
{
|
||||
<div class="card-header px-0 py-1">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="px-2">
|
||||
<b>Current alarms</b>
|
||||
@if (ListRecords.Count == 0)
|
||||
{
|
||||
<span class="badge m-2 bg-success text-light"><b>@ListRecords.Count</b></span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="badge m-2 bg-danger text-warning "><b>@ListRecords.Count</b></span>
|
||||
}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="d-grid p-0">
|
||||
<NavLink class="btn btn-info btn-block text-light fw-bold" href="AlarmsAnalysis">
|
||||
<i class="bi bi-bar-chart pe-2" aria-hidden="true"></i> Alarm Analysis
|
||||
</NavLink>
|
||||
</div>
|
||||
</div>
|
||||
if (@ListRecords.Count == 0)
|
||||
{
|
||||
<div class="alert alert-success text-center display-4 mb-0">All OK</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
<ul class="list-group">
|
||||
@foreach (var item in ListRecords)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using MP.MONO.Core.DTO;
|
||||
using MP.MONO.Data;
|
||||
using MP.MONO.UI.Data;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace MP.MONO.UI.Components
|
||||
@@ -49,6 +50,20 @@ namespace MP.MONO.UI.Components
|
||||
|
||||
private List<DisplayDataDTO>? ListRecords { get; set; } = new List<DisplayDataDTO>();
|
||||
|
||||
private selectGlobalToggle currFilter { get; set; } = new selectGlobalToggle();
|
||||
|
||||
private int numAlarm
|
||||
{
|
||||
get => currFilter.numAlarms;
|
||||
set
|
||||
{
|
||||
if (ListRecords != null)
|
||||
{
|
||||
currFilter.numAlarms = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
@@ -81,6 +96,7 @@ namespace MP.MONO.UI.Components
|
||||
{
|
||||
StateHasChanged();
|
||||
});
|
||||
numAlarm = ListRecords.Count;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
/// Bool: indica se sia richeista analisi per frequenza (vs durata)
|
||||
/// </summary>
|
||||
public bool setFreqDur { get; set; } = true;
|
||||
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
@@ -60,6 +61,7 @@
|
||||
if (dtMin != item.dtMin)
|
||||
return false;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,11 @@ namespace MP.MONO.UI.Data
|
||||
public string rightStringCSS { get; set; } = "";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// numero allarmi
|
||||
/// </summary>
|
||||
public int numAlarms { get; set; } = 0;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
@@ -63,6 +68,9 @@ namespace MP.MONO.UI.Data
|
||||
if (rightStringCSS != item.rightStringCSS)
|
||||
return false;
|
||||
|
||||
if (numAlarms != item.numAlarms)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Platforms>AnyCPU;x86;x64</Platforms>
|
||||
<Version>1.2.2210.2416</Version>
|
||||
<Version>1.2.2210.2418</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -10,38 +10,65 @@
|
||||
<div class="card mb-5">
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-6 col-lg-3">
|
||||
<h5 class="pt-1"><i class="bi bi-exclamation-triangle pe-2" aria-hidden="true"></i> <b>ALARMS</b></h5>
|
||||
</div>
|
||||
<div class="col-12 col-md-6 col-lg-9 float-end">
|
||||
<div class="d-flex flex-row-reverse">
|
||||
<div class="p-0">
|
||||
<button class="btn btn-primary" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasRight" aria-controls="offcanvasRight">Toggle right offcanvas</button>
|
||||
<div class="col-12 col-md-6 col-lg-3 d-flex justify-content-between w-100">
|
||||
<div class="col-4">
|
||||
<h5 class="pt-1"><i class="bi bi-exclamation-triangle pe-2" aria-hidden="true"></i> <b>ALARMS</b></h5>
|
||||
</div>
|
||||
<div class="px-2 col-4">
|
||||
<div class="input-group d-flex flex-row-reverse">
|
||||
<div class="input-group-text">
|
||||
<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="() => CheckAuth()">
|
||||
<label class="form-check-label" for="mySwitch">SETUP MODE</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 d-flex flex-row-reverse">
|
||||
<div class="p-0">
|
||||
<a class="py-1 text-dark" data-bs-toggle="offcanvas" data-bs-target="#offcanvasRight" aria-controls="offcanvasRight"><i class="fa-solid fa-bars"></i></a>
|
||||
<div class="offcanvas offcanvas-end" tabindex="-1" id="offcanvasRight" aria-labelledby="offcanvasRightLabel">
|
||||
<div class="offcanvas-header">
|
||||
<h5 id="offcanvasRightLabel">Offcanvas right</h5>
|
||||
<h3 class="offcanvas-title" id="paramsFilterExampleLabel"><b>FILTERS</b></h3>
|
||||
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="offcanvas-body">
|
||||
<div>
|
||||
Filter by:
|
||||
</div>
|
||||
|
||||
@if (!maxRecordStatus)
|
||||
{
|
||||
<div class="input-group input-group-sm py-1 pt-0">
|
||||
<div class="small mt-2">
|
||||
<label class="px-2" for="maxRecord" title="Max number of record to retrieve">Max record number</label>
|
||||
</div>
|
||||
<div class="input-group py-1 pt-0 px-2">
|
||||
<span class="input-group-text ">Num Records:</span>
|
||||
<input class="form-control form-control-sm" id="maxRecord" @bind-value="@MaxRecord" title="Max number of record to retrieve" disabled />
|
||||
</div>
|
||||
<div class="input-group input-group-sm py-1 pt-0">
|
||||
|
||||
<div class="small mt-2">
|
||||
<label class="px-2" for="DtRefEnd" title="Show alarms from selected date back">Date:</label>
|
||||
</div>
|
||||
<div class="input-group py-1 pt-0 px-2">
|
||||
<label class="input-group-text" title="Analisys: dataset end">Date From:</label>
|
||||
<input @bind="@dtRif" id="DtRefEnd" class="form-control" type="datetime-local" title="Show alarms from selected date back" disabled>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="input-group input-group-sm py-1 pt-0">
|
||||
<div class="small mt-2">
|
||||
<label class="px-2" for="maxRecord" title="Max number of record to retrieve">Max record number</label>
|
||||
</div>
|
||||
<div class="input-group input-group-sm py-1 pt-0 px-2">
|
||||
<span class="input-group-text">Num Records:</span>
|
||||
<input class="form-control form-control-sm" id="maxRecord" @bind-value="@MaxRecord" title="Max number of record to retrieve" enabled />
|
||||
</div>
|
||||
<div class="input-group input-group-sm py-1 pt-0">
|
||||
<div class="small mt-2">
|
||||
<label class="px-2" for="DtRefEnd" title="Show alarms from selected date back">Date:</label>
|
||||
</div>
|
||||
<div class="input-group input-group-sm py-1 pt-0 px-2">
|
||||
<label class="input-group-text" title="Analisys: dataset end">Date From:</label>
|
||||
<input @bind="@dtRif" id="DtRefEnd" class="form-control" type="datetime-local" title="Show alarms from selected date back" enabled>
|
||||
</div>
|
||||
@@ -56,26 +83,7 @@
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-3 pe-0">
|
||||
<div class="card">
|
||||
<div class="card-header p-1">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="px-2">
|
||||
<b>Current alarms</b>
|
||||
</div>
|
||||
<div class="px-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="() => CheckAuth()">
|
||||
<label class="form-check-label" for="mySwitch">Setup</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-grid">
|
||||
<NavLink class="btn btn-info btn-block text-light fw-bold" href="AlarmsAnalysis">
|
||||
<i class="bi bi-bar-chart pe-2" aria-hidden="true"></i> Alarm Analysis
|
||||
</NavLink>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-body p-1 mb-0">
|
||||
<AlarmsOverview messageReceived="() => reloadFromMessage()"></AlarmsOverview>
|
||||
</div>
|
||||
|
||||
@@ -12,6 +12,8 @@ namespace MP.MONO.UI.Pages
|
||||
public string lastUpdate { get; set; } = $"{DateTime.Now:yyyy/MM/dd HH:mm:ss}";
|
||||
public bool liveUpdate { get; set; } = true;
|
||||
|
||||
|
||||
|
||||
public bool setLogRec
|
||||
{
|
||||
get => currFilter.isActive;
|
||||
@@ -196,6 +198,8 @@ namespace MP.MONO.UI.Pages
|
||||
StateHasChanged();
|
||||
});
|
||||
|
||||
|
||||
|
||||
await Task.Delay(1);
|
||||
isLoading = false;
|
||||
aTimer.Start();
|
||||
@@ -252,6 +256,11 @@ namespace MP.MONO.UI.Pages
|
||||
private int _numRecord { get; set; } = 10;
|
||||
private selectGlobalToggle currFilter { get; set; } = new selectGlobalToggle();
|
||||
|
||||
private int numAlarm
|
||||
{
|
||||
get => currFilter.numAlarms;
|
||||
}
|
||||
|
||||
private int currPage
|
||||
{
|
||||
get => _currPage;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>MAPO-MONO</i>
|
||||
<h4>Version: 1.2.2210.2416</h4>
|
||||
<h4>Version: 1.2.2210.2418</h4>
|
||||
<br /> Release Note:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.2.2210.2416
|
||||
1.2.2210.2418
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.2.2210.2416</version>
|
||||
<version>1.2.2210.2418</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>
|
||||
|
||||
Reference in New Issue
Block a user