Compare commits

...

7 Commits

Author SHA1 Message Date
Samuele Locatelli 888c7398f7 Merge branch 'release/RC1' 2021-08-26 18:38:29 +02:00
Samuele Locatelli 4926cb4715 Merge branch 'feature/DisplayFix' into develop 2021-08-26 18:37:56 +02:00
Samuele Locatelli e2c7615826 Completato revers grafici + revisione detail 2021-08-26 18:37:46 +02:00
Samuele Locatelli dc8ce10b51 Update x ricerca utenti 2021-08-26 18:02:01 +02:00
Samuele Locatelli ffb4c9872d Aggiunta paginazione utenti 2021-08-26 17:48:59 +02:00
Samuele Locatelli a415d175d9 Update gestione QR da JScript x trasportatori 2021-08-26 17:33:42 +02:00
Samuele Locatelli 60b069cd28 Merge tag 'PageAuthManRC' into develop
Fix versione page auth
2021-08-26 13:05:25 +02:00
13 changed files with 904 additions and 637 deletions
+5
View File
@@ -469,6 +469,7 @@ namespace GWMS.Data.Controllers
.Where(x => x.FluxType == "Level" && x.PlantId == PlantId)
.OrderByDescending(x => x.DtEvent)
.Take(maxRecords)
.OrderBy(x => x.DtEvent)
.ToList();
var rawMainPressData = dbCtxMult
@@ -476,6 +477,7 @@ namespace GWMS.Data.Controllers
.Where(x => x.FluxType == "MainPress" && x.PlantId == PlantId)
.OrderByDescending(x => x.DtEvent)
.Take(maxRecords)
.OrderBy(x => x.DtEvent)
.ToList();
var rawBHPressData = dbCtxMult
@@ -483,6 +485,7 @@ namespace GWMS.Data.Controllers
.Where(x => x.FluxType == "PressBH" && x.PlantId == PlantId)
.OrderByDescending(x => x.DtEvent)
.Take(maxRecords)
.OrderBy(x => x.DtEvent)
.ToList();
var rawBLPressData = dbCtxMult
@@ -490,6 +493,7 @@ namespace GWMS.Data.Controllers
.Where(x => x.FluxType == "PressBL" && x.PlantId == PlantId)
.OrderByDescending(x => x.DtEvent)
.Take(maxRecords)
.OrderBy(x => x.DtEvent)
.ToList();
var rawOrderData = dbCtxMult
@@ -497,6 +501,7 @@ namespace GWMS.Data.Controllers
.Where(x => x.PlantId == PlantId && x.ExecutionQty == 0)
.OrderByDescending(x => x.DtOrder)
.Take(maxRecords)
.OrderBy(x => x.DtOrder)
.ToList();
LevelTS = rawLevelData
+68 -45
View File
@@ -4,63 +4,67 @@
@using Microsoft.AspNetCore.Components.Authorization
@using GWMS.UI.Data
@using Microsoft.Extensions.Configuration
@using Microsoft.JSInterop
@inject MessageService AppMService
@inject GWMSDataService DataService
@inject IConfiguration Configuration
@inject IJSRuntime JSRuntime
<div class="card">
@*<div class="card-header bg-info text-light">
<b>Modifica</b>
</div>*@
<div class="card-body small p-1">
<EditForm Model="@_currItem">
<DataAnnotationsValidator />
<div class="row">
<div class="col-12 col-lg-2">
<img src="@getImgUrl(_currItem.OrderCode)" class="img-fluid" />
</div>
<div class="col-12 col-lg-8 align-items-center">
<div class="row small">
<div class="col-12">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text" style="width: 3em;">
<span class="fas fa-truck" aria-hidden="true"></span>
</span>
@if (_currItem != null)
{
<EditForm Model="@_currItem">
<DataAnnotationsValidator />
<div class="row">
<div class="col-12 col-lg-2 text-center">
<div id="qrCodeImg"></div>
@_currItem.OrderCode
@*<img src="@getImgUrl(_currItem.OrderCode)" class="img-fluid" />*@
</div>
@*<div class="col-12 col-lg-8 align-items-center">
<div class="row small">
<div class="col-12">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text" style="width: 3em;">
<span class="fas fa-truck" aria-hidden="true"></span>
</span>
</div>
<DateEdit @bind-Date="_currItem.DtETA" InputMode="DateInputMode.DateTime" class="form-control" title="ETA (previsione consegna)" />
</div>
</div>
<div class="col-12">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text" style="width: 3em;">
<span class="fas fa-comment-alt" aria-hidden="true"></span>
</span>
</div>
<InputText id="OrderDesc" @bind-Value="_currItem.OrderDesc" class="form-control" title="Note Ordine (opzionali)" />
<div class="input-group-append">
<span class="input-group-text">
Note
</span>
</div>
</div>
</div>
<DateEdit @bind-Date="_currItem.DtETA" InputMode="DateInputMode.DateTime" class="form-control" title="ETA (previsione consegna)" />
</div>
</div>
<div class="col-12">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
<span class="input-group-text" style="width: 3em;">
<span class="fas fa-comment-alt" aria-hidden="true"></span>
</span>
</div>
<InputText id="OrderDesc" @bind-Value="_currItem.OrderDesc" class="form-control" title="Note Ordine (opzionali)" />
<div class="input-group-append">
<span class="input-group-text">
Note
</span>
</div>
</div>*@
<div class="col-12 col-lg-2">
<div class="row">
@*<div class="col">
<button type="button" class="btn btn-sm btn-success btn-block" value="Save" @onclick="saveUpdate">Save <i class="far fa-save"></i></button>
</div>*@
<div class="col">
<button type="button" class="btn btn-sm btn-warning btn-block" value="Cancel" @onclick="cancelUpdate">Cancel <i class="fas fa-ban"></i></button>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-2">
<div class="row">
<div class="col-6">
<button type="button" class="btn btn-sm btn-success btn-block" value="Save" @onclick="saveUpdate">Save <i class="far fa-save"></i></button>
</div>
<div class="col-6">
<button type="button" class="btn btn-sm btn-warning btn-block" value="Cancel" @onclick="cancelUpdate">Cancel <i class="fas fa-ban"></i></button>
</div>
</div>
</div>
</div>
</EditForm>
</EditForm>
}
</div>
</div>
@@ -76,7 +80,7 @@
{
get
{
return _currItem = null;
return _currItem;
}
set
{
@@ -84,6 +88,11 @@
}
}
public async void refreshQr()
{
await JSRuntime.InvokeVoidAsync("refreshQr", rawCode);
}
[Parameter]
public EventCallback<int> DataReset { get; set; }
[Parameter]
@@ -122,9 +131,23 @@
await DataReset.InvokeAsync(0);
}
protected string rawCode
{
get
{
string answ = "";
if (_currItem != null)
{
answ = _currItem.OrderCode;
}
return answ;
}
}
protected override async Task OnInitializedAsync()
{
await ReloadAllData();
await JSRuntime.InvokeVoidAsync("displayQr", "qrCodeImg", rawCode);
}
protected async Task ReloadAllData()
+15 -12
View File
@@ -49,25 +49,28 @@
<li class="list-group-item active d-flex justify-content-between align-items-center">SERBATOIO Principale</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<div class="row">
<div class="col-12 px-0">
<LineChart @ref="LevelVal" TItem="double" OptionsObject="lineChartOptions" />
@*<div class="col-4 small">
@currItem.LevelAct.ToString("N0")
</div>*@
<div class="col-12 text-center small">
<span><i class="fas fa-database"></i> Livello: </span> <span style="font-size:1.2em;"><b>@currItem.LevelRatio</b> <sub>%</sub></span> <span>(@currItem.LevelAct.ToString("N0")/@currItem.LevelMax.ToString("N0"))</span>
</div>
<div class="col-6 small">
@currItem.LevelAct.ToString("N0")
</div>
<div class="col-6 text-right small">
@currItem.LevelMax.ToString("N0")
</div>
<div class="col-12">
@*<div class="col-4 text-right small">
@currItem.LevelMax.ToString("N0")
</div>*@
<div class="col-12 small">
<Progress>
<ProgressBar Value="@currItem.LevelRatio" Striped="false" Animated="false" />
</Progress>
</div>
<div class="col-12 px-0 mt-2">
<LineChart @ref="LevelVal" TItem="double" OptionsObject="lineChartOptions" />
</div>
</div>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
<span><i class="fas fa-database"></i> Livello</span> <span style="font-size:1.2em;"><b>@currItem.LevelRatio</b> <sub>%</sub></span>
</li>
@*<li class="list-group-item d-flex justify-content-between align-items-center">
<span><i class="fas fa-database"></i> Livello</span> <span style="font-size:1.2em;"><b>@currItem.LevelRatio</b> <sub>%</sub></span>
</li>*@
<li class="list-group-item d-flex justify-content-between align-items-center">
<span><i class="fas fa-compress-arrows-alt"></i> Pressione</span> <span style="font-size:1.2em;"><b>@currItem.PressAct["Main"].ToString("N1")</b> <span class="small"> <sub>bar</sub></span></span>
</li>
+32 -21
View File
@@ -24,23 +24,25 @@ namespace GWMS.UI.Components
{
XAxes = new object[]
{
new {
Display = true,
//type = "timeseries",
//type = "time",
//Time = new {
// unit="day"
//}
}
},
new {
display = true,
//type = "timeseries",
//type = "time",
//Time = new {
// unit="day"
//}
}
},
YAxes = new object[]
{
new {
Display = true,
ticks= new {
suggestedMin = 0,
suggestedMax = 10000
}
display = true,
position = "right",
//text = "Kg",
ticks = new {
suggestedMin = 0,
suggestedMax = 10000
}
}
}
},
@@ -54,8 +56,14 @@ namespace GWMS.UI.Components
Mode = "nearest",
Intersect = false
},
Animation = false,
AspectRatio = 2
Animation = true,
Responsive = true,
AspectRatio = 2,
type = "line",
Legend = new
{
display = false
}
};
/// <summary>
@@ -119,7 +127,7 @@ namespace GWMS.UI.Components
var dataReload = Task.Run(async () =>
{
// aggiunta delay o non riesce a disegnare
Thread.Sleep(50);
Thread.Sleep(150);
await HandleRedraw();
});
}
@@ -134,12 +142,15 @@ namespace GWMS.UI.Components
{
int answ = 1;
int numCount = _currItem.LevelTS.Count;
// passo a 2h se > 5 gg
if (numCount > 120)
// passo a 2h se > 3 gg
if (numCount > 72)
answ = 2;
// passo a 3h se > 10 gg
else if (numCount > 240)
// passo a 3h se > 5 gg
else if (numCount > 120)
answ = 3;
// passo a 4h se > 10 gg
else if (numCount > 240)
answ = 4;
redFact = answ;
}
+1 -1
View File
@@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<Version>1.0.2108.2613</Version>
<Version>1.0.2108.2618</Version>
<UserSecretsId>95c9f021-52d1-4390-a670-5810b7b777b0</UserSecretsId>
</PropertyGroup>
+15 -4
View File
@@ -16,9 +16,6 @@
<div class="col-6 px-1">
<button class="btn btn-sm btn-block btn-secondary" @onclick="() => ToggleFiltPeriod()"><i class="far fa-calendar-alt"></i> <i class="@icnFiltTime"></i></button>
</div>
@*<div class="col-4 px-1">
<button class="btn btn-sm btn-block btn-secondary" @onclick="() => ToggleFiltTransp()"><i class="fas fa-truck-moving"></i> <i class="@icnFiltTran"></i></button>
</div>*@
<div class="col-6 px-1">
<button class="btn btn-sm btn-block btn-secondary" @onclick="() => ToggleFiltDest()"><i class="fas fa-gas-pump"></i> <i class="@icnFiltDest"></i></button>
</div>
@@ -107,6 +104,7 @@
{
<div class="row">
<div class="col-12">
@*<div id="qrCodeImg"></div>*@
<table class="table table-sm table-striped">
<thead>
<tr>
@@ -119,7 +117,20 @@
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(@record.OrderId)">
<td class="text-nowrap"><button class="btn btn-sm btn-info" @onclick="() => Edit(record)"><span class="oi oi-magnifying-glass"></span></button></td>
<td class="text-nowrap">
@if (currRecord == null)
{
<button class="btn btn-sm btn-info" @onclick="() => Edit(record)">
<i class="oi oi-magnifying-glass"></i>
</button>
}
else
{
<button class="btn btn-sm btn-secondary disabled">
<i class="oi oi-magnifying-glass"></i>
</button>
}
</td>
<td>
<div><b>@record.Plant.PlantCode</b> | @record.Plant.PlantDesc</div>
<div class="small"><span class="fas fa-comment-alt" aria-hidden="true"></span> @record.OrderDesc</div>
+3 -1
View File
@@ -1,6 +1,7 @@
@page "/UserAdmin"
@using GWMS.UI.Pages
@using GWMS.UI.Components
@if (ShowPopup)
{
@@ -168,6 +169,7 @@
</tbody>
</table>
</div>
<div class="card-footer">
<div class="card-footer p-1">
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
</div>
</div>
+105 -1
View File
@@ -27,6 +27,11 @@ namespace GWMS.UI.Pages
/// </summary>
private IdentityUser objUser = new IdentityUser();
/// <summary>
/// Collezione utenti
/// </summary>
private List<IdentityUser> RawList = new List<IdentityUser>();
/// <summary>
/// Elenco ROLES da mostrare in dropdown durante editing (1 solo? usare DB?!?)
/// </summary>
@@ -55,6 +60,10 @@ namespace GWMS.UI.Pages
#region Private Properties
private int _currPage { get; set; } = 1;
private int _numRecord { get; set; } = 10;
[CascadingParameter]
private Task<AuthenticationState> authenticationStateTask { get; set; }
@@ -78,6 +87,39 @@ namespace GWMS.UI.Pages
/// </summary>
private string CurrentUserRole { get; set; } = "User";
private int currPage
{
get => _currPage;
set
{
if (_currPage != value)
{
_currPage = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
private bool isLoading { get; set; } = false;
[Inject]
private MessageService MessageService { get; set; }
private int numRecord
{
get => _numRecord;
set
{
if (_numRecord != value)
{
_numRecord = value;
var pUpd = Task.Run(async () => await ReloadData());
pUpd.Wait();
}
}
}
#endregion Private Properties
#region Protected Properties
@@ -97,8 +139,33 @@ namespace GWMS.UI.Pages
[Inject]
protected IJSRuntime JSRuntime { get; set; }
protected int totalCount
{
get
{
int answ = 0;
if (RawList != null)
{
answ = RawList.Count;
}
return answ;
}
}
#endregion Protected Properties
#region Public Properties
public string searchVal
{
get
{
return MessageService.SearchVal;
}
}
#endregion Public Properties
#region Private Methods
private void AddNewUser()
@@ -220,6 +287,13 @@ namespace GWMS.UI.Pages
ShowPopup = true;
}
private async Task ReloadData()
{
isLoading = true;
await GetUsers();
isLoading = false;
}
private async Task SaveUser()
{
try
@@ -353,11 +427,22 @@ namespace GWMS.UI.Pages
#region Protected Methods
protected void ForceReload(int newNum)
{
numRecord = newNum;
}
protected void ForceReloadPage(int newNum)
{
currPage = newNum;
}
protected override async Task OnInitializedAsync()
{
AppMService.ShowSearch = true;
AppMService.PageName = "Gestione Utenti";
AppMService.PageIcon = "fas fa-users pr-2";
AppMService.EA_SearchUpdated += OnSeachUpdated;
// lettura dati
await GetUsers();
await CheckSuperAdmin();
@@ -374,6 +459,7 @@ namespace GWMS.UI.Pages
public void Dispose()
{
AppMService.EA_SearchUpdated -= OnSeachUpdated;
}
/// <summary>
@@ -386,7 +472,16 @@ namespace GWMS.UI.Pages
// Collection to hold users
UsersList = new List<UserData>();
// get users from _UserManager
var user = _UserManager.Users.Select(x => new IdentityUser
var allData = _UserManager.Users.ToList();
if (!string.IsNullOrEmpty(searchVal))
{
RawList = allData.Where(x => x.NormalizedEmail.Contains(searchVal.ToUpper()) || x.NormalizedUserName.Contains(searchVal.ToUpper())).ToList();
}
else
{
RawList = allData;
}
var user = RawList.Skip(numRecord * (currPage - 1)).Take(numRecord).Select(x => new IdentityUser
{
Id = x.Id,
UserName = x.UserName,
@@ -411,6 +506,15 @@ namespace GWMS.UI.Pages
}
}
public async void OnSeachUpdated()
{
await GetUsers();
await InvokeAsync(() =>
{
StateHasChanged();
});
}
public string ShowClaims(List<System.Security.Claims.Claim> ClaimList)
{
string answ = string.Join(",", ClaimList);
+22
View File
@@ -55,5 +55,27 @@
<script src="font-awesome/js/all.min.js"></script>
<script src="_framework/blazor.server.js"></script>
<script type="text/javascript" src="~/lib/qrcode.js"></script>
<script type="text/javascript">
// gestione qrcode... da https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-enable-qrcodes?view=aspnetcore-5.0
//var qrcode = new QRCode("qrCodeImg");
function displayQr(elementName, rawData) {
try {
if (elementName != "" && rawData != "") {
//qrcode = new QRCode(document.getElementById(elementName));
new QRCode(document.getElementById(elementName),
{
text: rawData,
width: 400,
height: 400
});
//qrcode.makeCode(rawData);
}
}
catch
{ }
}
</script>
</body>
</html>
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>GWMS - Gas Warehouse Management System</i>
<h4>Versione: 1.0.2108.2613</h4>
<h4>Versione: 1.0.2108.2618</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.0.2108.2613
1.0.2108.2618
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.0.2108.2613</version>
<version>1.0.2108.2618</version>
<url>http://nexus.steamware.net/repository/SWS/GWMS/stable/0/GWMS.UI.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/GWMS/stable/0/ChangeLog.html</changelog>
<mandatory>false</mandatory>