ListAppType
+ {
+ get => Core.Enum.AppType;
+ }
+
private int numRecord
{
get
{
- return AppMService.PageSize;
+ return AppMServ.PageSize;
}
set
{
- AppMService.PageSize = value;
+ AppMServ.PageSize = value;
}
}
@@ -228,7 +236,7 @@ namespace LiMan.UI.Components
private void AppMessages_EA_UserNameUpd()
{
- userName = AppMService.UserName;
+ userName = AppMServ.UserName;
}
private async Task fullReload()
diff --git a/LiMan.UI/Components/ListReleases.razor b/LiMan.UI/Components/ListReleases.razor
index 1182021..3020434 100644
--- a/LiMan.UI/Components/ListReleases.razor
+++ b/LiMan.UI/Components/ListReleases.razor
@@ -35,10 +35,10 @@
|
Applicazione |
- Rilascio |
- Vers. Num |
- Vers. Text |
- Tags |
+ Rilascio |
+ Vers. Num |
+ Vers. Text |
+ Tags |
|
@@ -59,19 +59,23 @@
@record.CodApp
|
-
+ |
@($"{record.ReleaseDate:yyyy.MM.dd}")
+
+
+ @($"{record.ReleaseDate:ddd, HH:mm:ss}")
+
|
-
+ |
@record.VersNum
|
-
+ |
@record.VersText
|
-
+ |
@record.RelTags
|
-
+ |
@if (recordEdit == null)
{
@@ -88,6 +92,6 @@
}
\ No newline at end of file
diff --git a/LiMan.UI/Components/ListReleases.razor.cs b/LiMan.UI/Components/ListReleases.razor.cs
index d24bca3..acba22c 100644
--- a/LiMan.UI/Components/ListReleases.razor.cs
+++ b/LiMan.UI/Components/ListReleases.razor.cs
@@ -42,6 +42,9 @@ namespace LiMan.UI.Components
#region Protected Properties
+ [Inject]
+ protected MessageService AppMServ { get; set; } = null!;
+
[Inject]
protected LiManDataService DataService { get; set; }
@@ -60,9 +63,6 @@ namespace LiMan.UI.Components
};
}
- [Inject]
- private IJSRuntime JSRuntime { get; set; }
-
protected async Task DoDelete(ReleaseModel rec2del)
{
if (!await JSRuntime.InvokeAsync("confirm", "Sicuro di voler eliminare il record?"))
@@ -83,19 +83,25 @@ namespace LiMan.UI.Components
await ReloadAllData();
}
+ protected override async Task OnInitializedAsync()
+ {
+ numRecord = await AppMServ.NumRowGridGet(gridKey);
+ }
+
protected override async Task OnParametersSetAsync()
{
await ReloadAllData();
}
- protected async Task PagerReloadNum(int newNum)
+ protected async Task SetNumRec(int newNum)
{
numRecord = newNum;
+ await AppMServ.NumRowGridSet(gridKey, newNum);
await ReloadAllData();
isLoading = false;
}
- protected async Task PagerReloadPage(int newNum)
+ protected async Task SetPage(int newNum)
{
currPage = newNum;
await ReloadAllData();
@@ -106,6 +112,7 @@ namespace LiMan.UI.Components
#region Private Fields
+ private string gridKey = "ListRelease";
private List ListRecords;
private ReleaseModel recordEdit = null;
@@ -120,6 +127,9 @@ namespace LiMan.UI.Components
private bool isLoading { get; set; } = false;
+ [Inject]
+ private IJSRuntime JSRuntime { get; set; }
+
private int numRecord { get; set; } = 10;
private int totalCount { get; set; } = 0;
diff --git a/LiMan.UI/Components/Tickets.razor.cs b/LiMan.UI/Components/Tickets.razor.cs
index 332d547..68429ed 100644
--- a/LiMan.UI/Components/Tickets.razor.cs
+++ b/LiMan.UI/Components/Tickets.razor.cs
@@ -129,7 +129,7 @@ namespace LiMan.UI.Components
ListApp = await DataService.ApplicazioniNextGetAll();
ListInstall = await DataService.InstallazioniNextGetAll();
//bool StatoRichiesta = true;
- //SearchRecords = await DataService.LicenzeNextGetFilt(AppMService.DetailDBFilter);
+ //SearchRecords = await DataService.LicenzeNextGetFilt(AppMServ.DetailDBFilter);
SearchRecords = await DataService.TicketsGetFilt(true, SelApp, SelInst);
//totalCount = SearchRecords.Count();
//AllRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
diff --git a/LiMan.UI/Data/MessageService.cs b/LiMan.UI/Data/MessageService.cs
index 6b0ac53..96e5b68 100644
--- a/LiMan.UI/Data/MessageService.cs
+++ b/LiMan.UI/Data/MessageService.cs
@@ -1,13 +1,21 @@
-using LiMan.DB.DBModels;
+using Blazored.LocalStorage;
+using LiMan.DB.DBModels;
+using Microsoft.AspNetCore.Session;
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Reflection.Metadata;
using System.Threading.Tasks;
namespace LiMan.UI.Data
{
public class MessageService
{
+ public MessageService(ILocalStorageService genLocalStorage)
+ {
+ // gestione sessioni in browser
+ localStore = genLocalStorage;
+ }
#region Public Events
public event Action EA_FilterUpdated;
@@ -89,20 +97,6 @@ namespace LiMan.UI.Data
}
}
}
- public string UserName
- {
- get => _userName;
- set
- {
- if (_userName != value)
- {
- _userName = value;
- ReportUserUpd();
- }
- }
- }
-
-
public string PageName
{
@@ -118,6 +112,7 @@ namespace LiMan.UI.Data
}
public int PageNum { get; set; } = 1;
+
public int PageSize { get; set; } = 10;
public string SearchVal
@@ -163,6 +158,19 @@ namespace LiMan.UI.Data
}
}
+ public string UserName
+ {
+ get => _userName;
+ set
+ {
+ if (_userName != value)
+ {
+ _userName = value;
+ ReportUserUpd();
+ }
+ }
+ }
+
#endregion Public Properties
#region Private Fields
@@ -180,7 +188,6 @@ namespace LiMan.UI.Data
#region Private Methods
-
private void ReportPageUpd()
{
if (EA_PageUpdated != null)
@@ -188,13 +195,6 @@ namespace LiMan.UI.Data
EA_PageUpdated?.Invoke();
}
}
- private void ReportUserUpd()
- {
- if (EA_UserNameUpd != null)
- {
- EA_UserNameUpd?.Invoke();
- }
- }
private void ReportSearch()
{
@@ -204,6 +204,57 @@ namespace LiMan.UI.Data
}
}
+ private void ReportUserUpd()
+ {
+ if (EA_UserNameUpd != null)
+ {
+ EA_UserNameUpd?.Invoke();
+ }
+ }
+
+ ///
+ /// Num record x la pagina corrente
+ ///
+ public async Task NumRowGridGet(string gridName)
+ {
+ var answ = await localStore.GetItemAsync($"{gridName}_nRow");
+ answ = answ > 0 ? answ : 10;
+ return answ;
+ }
+
+ ///
+ /// Imposta num record x la pagina corrente
+ ///
+ public async Task NumRowGridSet(string gridName, int newVal)
+ {
+ await localStore.SetItemAsync($"{gridName}_nRow", newVal);
+ }
+
+ protected ILocalStorageService localStore { get; set; } = null!;
+ ///
+ /// Preferenza utente salvata in local storage
+ ///
+ public async ValueTask UserPrefGet(string userPref)
+ {
+ var sData = await localStore.GetItemAsync(userPref);
+ if (string.IsNullOrEmpty(sData))
+ {
+ return default(T);
+ }
+ else
+ {
+ return (T)Convert.ChangeType(sData, typeof(T));
+ }
+ }
+
+ ///
+ /// Imposta pref utente
+ ///
+ public async Task UserPrefSet(string userPref, string newVal)
+ {
+ await localStore.SetItemAsync(userPref, newVal);
+ }
+
#endregion Private Methods
}
}
\ No newline at end of file
diff --git a/LiMan.UI/LiMan.UI.csproj b/LiMan.UI/LiMan.UI.csproj
index 9579f38..fb648ba 100644
--- a/LiMan.UI/LiMan.UI.csproj
+++ b/LiMan.UI/LiMan.UI.csproj
@@ -2,7 +2,7 @@
net6.0
- 1.1.2409.1716
+ 1.1.2409.1807
LiMan.UI
LiMan.UI
@@ -41,16 +41,25 @@
-
-
-
+
+
+
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
diff --git a/LiMan.UI/Program.cs b/LiMan.UI/Program.cs
index 72740c5..43b94ba 100644
--- a/LiMan.UI/Program.cs
+++ b/LiMan.UI/Program.cs
@@ -23,7 +23,7 @@ namespace LiMan.UI
.ConfigureLogging(logging =>
{
logging.ClearProviders();
- logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace);
+ logging.SetMinimumLevel(LogLevel.Debug);
})
.UseNLog();
@@ -32,7 +32,7 @@ namespace LiMan.UI
// inclusione NLog:
// https://github.com/NLog/NLog/wiki/Getting-started-with-ASP.NET-Core-5
// https://codewithmukesh.com/blog/logging-with-nlog-in-aspnet-core/
- var logger = NLog.Web.NLogBuilder.ConfigureNLog("NLog.config").GetCurrentClassLogger();
+ var logger = NLogBuilder.ConfigureNLog("NLog.config").GetCurrentClassLogger();
try
{
logger.Info("LiMan.UI Application Starting Up");
diff --git a/LiMan.UI/Resources/ChangeLog.html b/LiMan.UI/Resources/ChangeLog.html
index 8c3b3d4..d997f84 100644
--- a/LiMan.UI/Resources/ChangeLog.html
+++ b/LiMan.UI/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
License Manager
- Versione: 1.1.2409.1716
+ Versione: 1.1.2409.1807
Note di rilascio:
-
diff --git a/LiMan.UI/Resources/VersNum.txt b/LiMan.UI/Resources/VersNum.txt
index e8e4190..e130097 100644
--- a/LiMan.UI/Resources/VersNum.txt
+++ b/LiMan.UI/Resources/VersNum.txt
@@ -1 +1 @@
-1.1.2409.1716
+1.1.2409.1807
diff --git a/LiMan.UI/Resources/manifest.xml b/LiMan.UI/Resources/manifest.xml
index dc88c28..7ed87fd 100644
--- a/LiMan.UI/Resources/manifest.xml
+++ b/LiMan.UI/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 1.1.2409.1716
+ 1.1.2409.1807
https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.UI.zip
https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html
false
diff --git a/LiMan.UI/Startup.cs b/LiMan.UI/Startup.cs
index cfe2b68..a2e8522 100644
--- a/LiMan.UI/Startup.cs
+++ b/LiMan.UI/Startup.cs
@@ -21,6 +21,8 @@ using Microsoft.AspNetCore.Http;
using System.IO;
using Liman.CadCam.Services;
using StackExchange.Redis;
+using Blazored.LocalStorage;
+using Blazored.SessionStorage;
namespace LiMan.UI
{
@@ -185,6 +187,8 @@ namespace LiMan.UI
services.AddScoped();
services.AddSingleton();
services.AddSingleton();
+ services.AddBlazoredLocalStorage();
+ services.AddBlazoredSessionStorage();
}
#endregion Public Methods
|