diff --git a/MP.SPEC/Components/CmpFooter.razor.cs b/MP.SPEC/Components/CmpFooter.razor.cs index acdc906d..9e72abd9 100644 --- a/MP.SPEC/Components/CmpFooter.razor.cs +++ b/MP.SPEC/Components/CmpFooter.razor.cs @@ -33,15 +33,15 @@ namespace MP.SPEC.Components aTimer.Start(); } + #endregion Public Methods + + #region Protected Methods + protected override void OnInitialized() { version = typeof(Program).Assembly.GetName().Version; } - #endregion Public Methods - - #region Protected Methods - #endregion Protected Methods #region Private Fields diff --git a/MP.SPEC/Components/DataPager.razor.cs b/MP.SPEC/Components/DataPager.razor.cs index d8aefc54..dc625ff6 100644 --- a/MP.SPEC/Components/DataPager.razor.cs +++ b/MP.SPEC/Components/DataPager.razor.cs @@ -23,12 +23,6 @@ namespace MP.SPEC.Components } } } - - public async Task resetCurrPage() - { - await Task.Delay(1); - currPage = 1; - } [Parameter] public EventCallback numPageChanged { get; set; } @@ -82,6 +76,16 @@ namespace MP.SPEC.Components #endregion Public Properties + #region Public Methods + + public async Task resetCurrPage() + { + await Task.Delay(1); + currPage = 1; + } + + #endregion Public Methods + #region Protected Fields protected bool _showLoading = false; diff --git a/MP.SPEC/Components/DossiersFilter.razor.cs b/MP.SPEC/Components/DossiersFilter.razor.cs index 12a155a5..eefd1f4f 100644 --- a/MP.SPEC/Components/DossiersFilter.razor.cs +++ b/MP.SPEC/Components/DossiersFilter.razor.cs @@ -1,21 +1,6 @@ -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.SPEC; -using MP.SPEC.Shared; -using MP.SPEC.Components; -using MP.SPEC.Data; using MP.Data.DatabaseModels; +using MP.SPEC.Data; namespace MP.SPEC.Components { @@ -31,15 +16,27 @@ namespace MP.SPEC.Components #endregion Public Properties - #region Protected Fields - - #endregion Protected Fields - #region Protected Properties [Inject] protected MpDataService MDService { get; set; } = null!; + protected DateTime selDtRef + { + get + { + return SelFilterDossier.DtRef; + } + + set + { + if (!SelFilterDossier.DtRef.Equals(value)) + { + SelFilterDossier.DtRef = value; + reportChange(); + } + } + } protected string selMacchina { @@ -60,7 +57,6 @@ namespace MP.SPEC.Components } } - protected int selMaxRecord { get @@ -78,23 +74,6 @@ namespace MP.SPEC.Components } } - protected DateTime selDtRef - { - get - { - return SelFilterDossier.DtRef; - } - - set - { - if (!SelFilterDossier.DtRef.Equals(value)) - { - SelFilterDossier.DtRef = value; - reportChange(); - } - } - } - #endregion Protected Properties #region Protected Methods diff --git a/MP.SPEC/Components/ListPARAMS.razor.cs b/MP.SPEC/Components/ListPARAMS.razor.cs index 8f7048e2..6b0b346b 100644 --- a/MP.SPEC/Components/ListPARAMS.razor.cs +++ b/MP.SPEC/Components/ListPARAMS.razor.cs @@ -111,10 +111,11 @@ namespace MP.SPEC.Components { get => SelFilter.TempoAgg; } - //protected int RefreshPeriod { get; set; } = 5000; #endregion Protected Properties + //protected int RefreshPeriod { get; set; } = 5000; + #region Protected Methods protected override async Task OnInitializedAsync() diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index 51023f56..01dd5644 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -12,7 +12,6 @@ namespace MP.SPEC.Components [Parameter] public EventCallback PagerResetReq { get; set; } - [Parameter] public EventCallback RecordSel { get; set; } @@ -35,38 +34,6 @@ namespace MP.SPEC.Components return answ; } - protected async Task resetSel() - { - await RecordSel.InvokeAsync(null); - } - - protected bool POdlDelEnabled(int idxOdl) - { - return idxOdl == 0; - } - - protected async Task selRecord(PODLModel selRec) - { - await RecordSel.InvokeAsync(selRec); - } - - - /// - /// Eliminazione record selezioanto (previa conferma) - /// - /// - /// - protected async Task deleteRecord(PODLModel selRec) - { - if (!await JSRuntime.InvokeAsync("confirm", "Eliminazione Record: sei sicuro di voler procedere?")) - return; - await Task.Delay(1); - var done = await MDService.PODLDeleteRecord(selRec); - currRecord = null; - await reloadData(); - await Task.Delay(1); - } - #endregion Public Methods #region Protected Properties @@ -84,6 +51,22 @@ namespace MP.SPEC.Components #region Protected Methods + /// + /// Eliminazione record selezioanto (previa conferma) + /// + /// + /// + protected async Task deleteRecord(PODLModel selRec) + { + if (!await JSRuntime.InvokeAsync("confirm", "Eliminazione Record: sei sicuro di voler procedere?")) + return; + await Task.Delay(1); + var done = await MDService.PODLDeleteRecord(selRec); + currRecord = null; + await reloadData(); + await Task.Delay(1); + } + protected override async Task OnInitializedAsync() { MsgService.EA_PageUpdated += MessageService_EA_PageUpdated; @@ -104,6 +87,21 @@ namespace MP.SPEC.Components }); } + protected bool POdlDelEnabled(int idxOdl) + { + return idxOdl == 0; + } + + protected async Task resetSel() + { + await RecordSel.InvokeAsync(null); + } + + protected async Task selRecord(PODLModel selRec) + { + await RecordSel.InvokeAsync(selRec); + } + protected async Task UpdateData() { currRecord = null; @@ -118,6 +116,7 @@ namespace MP.SPEC.Components private List? ListRecords; + private List? ListStati; private List? SearchRecords; #endregion Private Fields @@ -175,6 +174,17 @@ namespace MP.SPEC.Components }); } + private async Task reloadData() + { + isLoading = true; + SearchRecords = await MDService.ListPODLFilt(SearchVal, StatoSel); + totalCount = SearchRecords.Count; + ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); + await Task.Delay(1); + await InvokeAsync(() => StateHasChanged()); + isLoading = false; + } + private string tradFase(string codFase) { string answ = codFase; @@ -189,20 +199,6 @@ namespace MP.SPEC.Components return answ; } - - private List? ListStati; - - private async Task reloadData() - { - isLoading = true; - SearchRecords = await MDService.ListPODLFilt(SearchVal, StatoSel); - totalCount = SearchRecords.Count; - ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); - await Task.Delay(1); - await InvokeAsync(() => StateHasChanged()); - isLoading = false; - } - #endregion Private Methods } } \ No newline at end of file diff --git a/MP.SPEC/Components/ParamsFilter.razor.cs b/MP.SPEC/Components/ParamsFilter.razor.cs index a715db76..9fbb67ff 100644 --- a/MP.SPEC/Components/ParamsFilter.razor.cs +++ b/MP.SPEC/Components/ParamsFilter.razor.cs @@ -15,7 +15,7 @@ namespace MP.SPEC.Components #endregion Public Properties - #region Protected Fields + #region Protected Properties protected string lastUpdate { @@ -23,10 +23,6 @@ namespace MP.SPEC.Components set => SelFilter.lastUpdate = value; } - #endregion Protected Fields - - #region Protected Properties - protected bool liveUpdate { get => SelFilter.LiveUpdate; @@ -134,6 +130,14 @@ namespace MP.SPEC.Components await FilterChanged.InvokeAsync(SelFilter); } + protected async Task takeSnapshot() + { + // fermo udpate + liveUpdate = false; + await MDService.DossiersTakeParamsSnapshot(selMacchina, 10); + lastUpdate = $"Last Snapshot: {DateTime.Now:yyyy/MM/dd HH:mm:ss}"; + } + protected void toggleParams() { showEditPar = !showEditPar; @@ -149,14 +153,6 @@ namespace MP.SPEC.Components } } - protected async Task takeSnapshot() - { - // fermo udpate - liveUpdate = false; - await MDService.DossiersTakeParamsSnapshot(selMacchina, 10); - lastUpdate = $"Last Snapshot: {DateTime.Now:yyyy/MM/dd HH:mm:ss}"; - } - #endregion Protected Methods #region Private Fields diff --git a/MP.SPEC/Data/SelectDossierParams.cs b/MP.SPEC/Data/SelectDossierParams.cs index ebcf3928..9d55bb87 100644 --- a/MP.SPEC/Data/SelectDossierParams.cs +++ b/MP.SPEC/Data/SelectDossierParams.cs @@ -11,13 +11,25 @@ #region Public Properties + public int CurrPage { get; set; } = 1; + + public DateTime DtRef { get; set; } = Init(5); + + public string IdxMacchina { get; set; } = "*"; + + public int MaxRecord { get; set; } = 100; + + #endregion Public Properties + + #region Public Methods + /// -        /// Inizializzazione con periodo e arrotondamento -        /// -        /// -        /// -        /// -        public static DateTime Init(int minRound) +         /// Inizializzazione con periodo e arrotondamento +         /// +         /// +         /// +         /// + public static DateTime Init(int minRound) { TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today); int minDay = (int)Math.Ceiling((double)(DayElapsed.TotalMinutes / minRound)) * minRound; @@ -25,16 +37,6 @@ return endRounded; } - public string IdxMacchina { get; set; } = "*"; - - public int MaxRecord { get; set; } = 100; - public DateTime DtRef { get; set; } = Init(5); - public int CurrPage { get; set; } = 1; - - #endregion Public Properties - - #region Public Methods - public override bool Equals(object obj) { if (!(obj is SelectDossierParams item)) diff --git a/MP.SPEC/Data/SelectFluxParams.cs b/MP.SPEC/Data/SelectFluxParams.cs index 92559e14..39660b9f 100644 --- a/MP.SPEC/Data/SelectFluxParams.cs +++ b/MP.SPEC/Data/SelectFluxParams.cs @@ -12,13 +12,13 @@ #region Public Properties public string CodFlux { get; set; } = "*"; + public int CurrPage { get; set; } = 1; public string IdxMacchina { get; set; } = "*"; + public string lastUpdate { get; set; } = "-"; public bool LiveUpdate { get; set; } = true; public int MaxRecord { get; set; } = 100; public int TempoAgg { get; set; } = 2000; - public int CurrPage { get; set; } = 1; - public string lastUpdate { get; set; } = "-"; #endregion Public Properties diff --git a/MP.SPEC/Pages/Error.cshtml.cs b/MP.SPEC/Pages/Error.cshtml.cs index 655495ec..db2be022 100644 --- a/MP.SPEC/Pages/Error.cshtml.cs +++ b/MP.SPEC/Pages/Error.cshtml.cs @@ -8,20 +8,36 @@ namespace MP.SPEC.Pages [IgnoreAntiforgeryToken] public class ErrorModel : PageModel { - public string? RequestId { get; set; } - - public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); - - private readonly ILogger _logger; + #region Public Constructors public ErrorModel(ILogger logger) { _logger = logger; } + #endregion Public Constructors + + #region Public Properties + + public string? RequestId { get; set; } + + public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + + #endregion Public Properties + + #region Public Methods + public void OnGet() { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; } + + #endregion Public Methods + + #region Private Fields + + private readonly ILogger _logger; + + #endregion Private Fields } } \ No newline at end of file diff --git a/MP.SPEC/Pages/PARAMS.razor.cs b/MP.SPEC/Pages/PARAMS.razor.cs index 999f2bb4..16ba0000 100644 --- a/MP.SPEC/Pages/PARAMS.razor.cs +++ b/MP.SPEC/Pages/PARAMS.razor.cs @@ -29,7 +29,7 @@ namespace MP.SPEC.Pages protected void ForceReloadPage(int newNum) { currPage = newNum; - currFilter.lastUpdate= $"Last Snapshot: {DateTime.Now:yyyy/MM/dd HH:mm:ss}"; + currFilter.lastUpdate = $"Last Snapshot: {DateTime.Now:yyyy/MM/dd HH:mm:ss}"; currFilter.LiveUpdate = (currPage == 1); StateHasChanged(); } @@ -66,11 +66,6 @@ namespace MP.SPEC.Pages #endregion Protected Methods - #region Private Fields - - - #endregion Private Fields - #region Private Properties private SelectFluxParams currFilter { get; set; } = new SelectFluxParams(); @@ -81,8 +76,8 @@ namespace MP.SPEC.Pages set => MsgService.currPage = value; } - private bool isLoading { get; set; } = true; private bool isFiltering { get; set; } = false; + private bool isLoading { get; set; } = true; private int numRecord { diff --git a/MP.SPEC/Pages/Utils.razor.cs b/MP.SPEC/Pages/Utils.razor.cs index 99947dcd..b706f3b9 100644 --- a/MP.SPEC/Pages/Utils.razor.cs +++ b/MP.SPEC/Pages/Utils.razor.cs @@ -1,18 +1,25 @@ using Microsoft.AspNetCore.Components; using MP.SPEC.Data; -using System.Reflection; namespace MP.SPEC.Pages { public partial class Utils { - [Inject] - protected MpDataService MDService { get; set; } + #region Public Methods public async Task flushCache() { await Task.Delay(1); await MDService.FlushRedisCache(); } + + #endregion Public Methods + + #region Protected Properties + + [Inject] + protected MpDataService MDService { get; set; } + + #endregion Protected Properties } -} +} \ No newline at end of file diff --git a/MP.SPEC/Properties/launchSettings.json b/MP.SPEC/Properties/launchSettings.json index 0f74370e..07a04c8e 100644 --- a/MP.SPEC/Properties/launchSettings.json +++ b/MP.SPEC/Properties/launchSettings.json @@ -1,28 +1,28 @@ { - "iisSettings": { - "windowsAuthentication": true, - "anonymousAuthentication": false, - "iisExpress": { - "applicationUrl": "http://localhost:46815", - "sslPort": 44370 - } - }, - "profiles": { - "MP.SPEC": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "applicationUrl": "https://localhost:7212;http://localhost:5212", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } + "iisSettings": { + "windowsAuthentication": true, + "anonymousAuthentication": false, + "iisExpress": { + "applicationUrl": "http://localhost:46815", + "sslPort": 44370 } + }, + "profiles": { + "MP.SPEC": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:7212;http://localhost:5212", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } } \ No newline at end of file diff --git a/MP.SPEC/Shared/MainLayout.razor.css b/MP.SPEC/Shared/MainLayout.razor.css index b4db48d9..d5884352 100644 --- a/MP.SPEC/Shared/MainLayout.razor.css +++ b/MP.SPEC/Shared/MainLayout.razor.css @@ -24,16 +24,16 @@ main { display: flex;*/ } -.top-row ::deep a, -.top-row .btn-link { - white-space: nowrap; - margin-left: 1.5rem; -} + .top-row ::deep a, + .top-row .btn-link { + white-space: nowrap; + margin-left: 1.5rem; + } -.top-row a:first-child { - overflow: hidden; - text-overflow: ellipsis; -} + .top-row a:first-child { + overflow: hidden; + text-overflow: ellipsis; + } .bottom-row { color: #dedede; @@ -46,9 +46,11 @@ main { .top-row:not(.auth) { display: none; } + .top-row.auth { justify-content: space-between; } + .top-row a, .top-row .btn-link { margin-left: 0; @@ -59,34 +61,40 @@ main { .page { flex-direction: row; } + .sidebar { width: 15rem; height: 100vh; position: sticky; top: 0; } + .sidebarSmall { width: 5rem; height: 100vh; position: sticky; top: 0; } + .top-row { position: sticky; top: 0; z-index: 1; } + .top-row, article { padding-left: 0.5rem !important; padding-right: 0.5rem !important; } + .bottom-row { position: fixed; bottom: 0; z-index: 1; } - .main>div { + + .main > div { padding-left: 0.5rem !important; padding-right: 0.5rem !important; /*padding-left: 2rem !important; diff --git a/MP.SPEC/Shared/NavMenu.razor.css b/MP.SPEC/Shared/NavMenu.razor.css index 75cac5de..e132378a 100644 --- a/MP.SPEC/Shared/NavMenu.razor.css +++ b/MP.SPEC/Shared/NavMenu.razor.css @@ -59,4 +59,4 @@ /* Never collapse the sidebar for wide screens */ display: block; } -} +} \ No newline at end of file