From e389cbd7a38ae8bbb169f0d9aed85a2b99c10c5f Mon Sep 17 00:00:00 2001 From: "marco.salvi" Date: Fri, 4 Feb 2022 13:02:18 +0100 Subject: [PATCH 1/6] Template pagina lista ticket e file allegati --- .vscode/launch.json | 35 ++++++++++++ .vscode/tasks.json | 41 +++++++++++++ LiMan.DB/Controllers/DbController.cs | 76 +++++++++++++++++++++++++ LiMan.UI/Components/ListAttach.razor | 66 +++++++++++++++++++++ LiMan.UI/Components/ListAttach.razor.cs | 20 +++++++ LiMan.UI/Components/Tickets.razor | 21 ++++++- LiMan.UI/Components/Tickets.razor.cs | 18 +++--- LiMan.UI/Data/LiManDataService.cs | 35 ++++++++++++ LiMan.UI/LiMan.UI.csproj | 2 +- LiMan.UI/Resources/ChangeLog.html | 2 +- LiMan.UI/Resources/VersNum.txt | 2 +- LiMan.UI/Resources/manifest.xml | 2 +- 12 files changed, 306 insertions(+), 14 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 LiMan.UI/Components/ListAttach.razor create mode 100644 LiMan.UI/Components/ListAttach.razor.cs diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..7d9d36a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,35 @@ +{ + "version": "0.2.0", + "configurations": [ + { + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "name": ".NET Core Launch (web)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceFolder}/LiMan.UI/bin/Debug/net5.0/LiMan.UI.dll", + "args": [], + "cwd": "${workspaceFolder}/LiMan.UI", + "stopAtEntry": false, + // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser + "serverReadyAction": { + "action": "openExternally", + "pattern": "\\bNow listening on:\\s+(https?://\\S+)" + }, + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "sourceFileMap": { + "/Views": "${workspaceFolder}/Views" + } + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..a46ac72 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,41 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/LiMan.UI/LiMan.UI.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/LiMan.UI/LiMan.UI.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "run", + "--project", + "${workspaceFolder}/LiMan.UI/LiMan.UI.csproj" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/LiMan.DB/Controllers/DbController.cs b/LiMan.DB/Controllers/DbController.cs index 4699e54..6063885 100644 --- a/LiMan.DB/Controllers/DbController.cs +++ b/LiMan.DB/Controllers/DbController.cs @@ -901,6 +901,82 @@ namespace LiMan.DB.Controllers return dbResult; } + public List TicketGetFiltAllLic(bool onlyOpen, TipologiaTicket Tipo, string CodApp, string CodInst, int maxNum) + { + List dbResult = new List(); + using (LMDbContext localDbCtx = new LMDbContext(_configuration)) + { + // recupero locenza... + var currLic = localDbCtx + .DbSetLicenze + .Where(x => x.CodApp == CodApp && x.CodInst == CodInst) + .FirstOrDefault(); + + if (currLic != null) + { + dbResult = localDbCtx + .DbSetTicket + .Where(x => (x.LicenzaNav.CodApp == CodApp && x.LicenzaNav.CodInst == CodInst) && (x.Status <= StatoRichiesta.Valutazione || !onlyOpen) && (x.TType == Tipo || Tipo == TipologiaTicket.ND)) + .OrderByDescending(x => x.IdxTicket) + .Take(maxNum) + .Select(x => new TicketDTO + { + IdxTicket = x.IdxTicket, + IdxLic = x.IdxLic, + IdxSubLic = x.IdxSubLic, + CodImpiego = x.CodImpiego, + ContactName = x.ContactName, + ContactEmail = x.ContactEmail, + ContactPhone = x.ContactPhone, + DtReq = x.DtReq, + ReqBody = x.ReqBody, + Status = x.Status, + SupplAnsw = x.SupplAnsw, + SupplEmail = x.SupplEmail, + SupplUserCode = x.SupplUserCode, + Tipo = x.Tipo + }) + .ToList(); + } + } + return dbResult; + } + + + public List TicketGetAll(bool onlyOpen, int maxNum) + { + List dbResult = new List(); + using (LMDbContext localDbCtx = new LMDbContext(_configuration)) + { + + dbResult = localDbCtx + .DbSetTicket + .Where(x => (x.Status <= StatoRichiesta.Valutazione || !onlyOpen)) + .OrderByDescending(x => x.IdxTicket) + .Take(maxNum) + .Select(x => new TicketDTO + { + IdxTicket = x.IdxTicket, + IdxLic = x.IdxLic, + IdxSubLic = x.IdxSubLic, + CodImpiego = x.CodImpiego, + ContactName = x.ContactName, + ContactEmail = x.ContactEmail, + ContactPhone = x.ContactPhone, + DtReq = x.DtReq, + ReqBody = x.ReqBody, + Status = x.Status, + SupplAnsw = x.SupplAnsw, + SupplEmail = x.SupplEmail, + SupplUserCode = x.SupplUserCode, + Tipo = x.Tipo + }) + .ToList(); + } + return dbResult; + } + + public bool TicketUpdateState(int IdxTicket, StatoRichiesta NewStatus) { bool fatto = false; diff --git a/LiMan.UI/Components/ListAttach.razor b/LiMan.UI/Components/ListAttach.razor new file mode 100644 index 0000000..cfe5da2 --- /dev/null +++ b/LiMan.UI/Components/ListAttach.razor @@ -0,0 +1,66 @@ +@using LiMan.UI.Components + +
+
+
+
+

File Allegati

+
+
+ +
+
+
+
+ + @if (ListRecords == null) + { + + } + else if (totalCount == 0) + { +
Nessun record trovato
+ } + else + { + + + + + + + + + + + @* @foreach (var record in ListRecords) + { + + + + + + + + }*@ + +
+ + #OriginalNameFullStoragePath
+ + + @record.IdxTicket
+ @record.Status +
+
@record.ContactName
+
@record.DtReq
+
+
@record.ContactEmail
+
@record.ContactPhone
+
+ @record.ReqBody +
+ } +
+
> + diff --git a/LiMan.UI/Components/ListAttach.razor.cs b/LiMan.UI/Components/ListAttach.razor.cs new file mode 100644 index 0000000..5705a1a --- /dev/null +++ b/LiMan.UI/Components/ListAttach.razor.cs @@ -0,0 +1,20 @@ +using Core; +using LiMan.DB.DBModels; +using LiMan.DB.DTO; +using LiMan.UI.Data; +using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using static LiMan.DB.Enum; + +namespace LiMan.UI.Components +{ + public partial class ListAttach + { + private List files; + protected int totalCount = 0; + } +} \ No newline at end of file diff --git a/LiMan.UI/Components/Tickets.razor b/LiMan.UI/Components/Tickets.razor index 963441a..dff4f9b 100644 --- a/LiMan.UI/Components/Tickets.razor +++ b/LiMan.UI/Components/Tickets.razor @@ -1,14 +1,28 @@ -
+@using LiMan.UI.Components + +

Tickets

+
+ + @if (ListRecords == null) + { + + } + else if (totalCount == 0) + { +
Nessun record trovato
+ } + else + { @@ -23,7 +37,7 @@ {
- + # Richiedente
- + @record.IdxTicket
@@ -44,6 +58,7 @@ }
+ } @if (idxTicketSel > 0) {
diff --git a/LiMan.UI/Components/Tickets.razor.cs b/LiMan.UI/Components/Tickets.razor.cs index aaf2e3d..21621bd 100644 --- a/LiMan.UI/Components/Tickets.razor.cs +++ b/LiMan.UI/Components/Tickets.razor.cs @@ -1,5 +1,6 @@ using Core; using LiMan.DB.DBModels; +using LiMan.DB.DTO; using LiMan.UI.Data; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; @@ -16,7 +17,8 @@ namespace LiMan.UI.Components #region Private Fields private List ListActivations; - private List ListRecords; + private List ListRecords; + protected int totalCount = 0; #endregion Private Fields @@ -106,7 +108,9 @@ namespace LiMan.UI.Components ListActivations = null; idxTicketSel = 0; await Task.Delay(1); - ListRecords = MasterLicence.Tickets.ToList(); + //bool StatoRichiesta = true; + ListRecords = await DataService.TicketsGetAll(); + totalCount = ListRecords.Count(); isLoading = false; } @@ -157,16 +161,16 @@ namespace LiMan.UI.Components showKey = !showKey; } - protected void showDet(TicketModel currTicket) + protected void showDet(TicketDTO currTicket) { // salvo ticket sel idxTicketSel = currTicket.IdxTicket; StatusSel = currTicket.Status; // mostro SOLO le attivazioni di cui ho ticket attivi... - ListActivations = MasterLicence - .Attivazioni - .Where(a => a.IdxSubLic == currTicket.IdxSubLic) - .ToList(); + //ListActivations = MasterLicence + //.Attivazioni + //.Where(a => a.IdxSubLic == currTicket.IdxSubLic) + //.ToList(); } protected async Task UnLock(SubLicenzaModel selRecord) diff --git a/LiMan.UI/Data/LiManDataService.cs b/LiMan.UI/Data/LiManDataService.cs index a4bd2c1..0f69212 100644 --- a/LiMan.UI/Data/LiManDataService.cs +++ b/LiMan.UI/Data/LiManDataService.cs @@ -584,6 +584,41 @@ namespace LiMan.UI.Data return await Task.FromResult(fatto); } + + /// + /// Recupera elenco Tickets filtrato + /// + /// + /// + public async Task> TicketsGetFilt(SelectNext CurrFilter) + { + Stopwatch stopWatch = new Stopwatch(); + List dbResult = new List(); + stopWatch.Start(); + dbResult = dbControllerNext.TicketGetFiltAllLic(CurrFilter.OnlyActive, Core.TipologiaTicket.ND, CurrFilter.ApplicazioneSel, CurrFilter.InstallazioneSel, 1000); + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Trace($"Effettuata lettura da DB per TicketsGetFilt: {ts.TotalMilliseconds} ms"); + return await Task.FromResult(dbResult); + } + + /// + /// Recupera elenco Tickets filtrato + /// + /// + /// + public async Task> TicketsGetAll() + { + Stopwatch stopWatch = new Stopwatch(); + List dbResult = new List(); + stopWatch.Start(); + dbResult = dbControllerNext.TicketGetAll(false, 1000); + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Trace($"Effettuata lettura da DB per TicketsGetAll: {ts.TotalMilliseconds} ms"); + return await Task.FromResult(dbResult); + } + #endregion Public Methods } } \ No newline at end of file diff --git a/LiMan.UI/LiMan.UI.csproj b/LiMan.UI/LiMan.UI.csproj index 2618a5d..5604a6b 100644 --- a/LiMan.UI/LiMan.UI.csproj +++ b/LiMan.UI/LiMan.UI.csproj @@ -2,7 +2,7 @@ net5.0 - 1.1.2112.2211 + 1.1.2202.0316 LiMan.UI LiMan.UI diff --git a/LiMan.UI/Resources/ChangeLog.html b/LiMan.UI/Resources/ChangeLog.html index 48ce924..fe43706 100644 --- a/LiMan.UI/Resources/ChangeLog.html +++ b/LiMan.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ License Manager -

Versione: 1.1.2112.2211

+

Versione: 1.1.2202.0316


Note di rilascio:
    diff --git a/LiMan.UI/Resources/VersNum.txt b/LiMan.UI/Resources/VersNum.txt index 7dfe333..a10f3c3 100644 --- a/LiMan.UI/Resources/VersNum.txt +++ b/LiMan.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2112.2211 +1.1.2202.0316 diff --git a/LiMan.UI/Resources/manifest.xml b/LiMan.UI/Resources/manifest.xml index 606a2f4..57a577a 100644 --- a/LiMan.UI/Resources/manifest.xml +++ b/LiMan.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2112.2211 + 1.1.2202.0316 https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.UI.zip https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html false From e565bb06bb8cd62ab3cc7938c6b8f7aebbb32f57 Mon Sep 17 00:00:00 2001 From: "marco.salvi" Date: Fri, 4 Feb 2022 18:10:57 +0100 Subject: [PATCH 2/6] Aggiornamento pagina ticket con visualizzazione laterale file allegati --- LiMan.UI/Components/ListAttach.razor | 8 +- LiMan.UI/Components/ListAttach.razor.cs | 37 +++- LiMan.UI/Components/Tickets.razor | 251 +++++++++++------------- LiMan.UI/Components/Tickets.razor.cs | 17 +- LiMan.UI/Data/LiManDataService.cs | 19 ++ LiMan.UI/LiMan.UI.csproj | 2 +- LiMan.UI/Resources/ChangeLog.html | 2 +- LiMan.UI/Resources/VersNum.txt | 2 +- LiMan.UI/Resources/manifest.xml | 2 +- 9 files changed, 182 insertions(+), 158 deletions(-) diff --git a/LiMan.UI/Components/ListAttach.razor b/LiMan.UI/Components/ListAttach.razor index cfe5da2..36dc28a 100644 --- a/LiMan.UI/Components/ListAttach.razor +++ b/LiMan.UI/Components/ListAttach.razor @@ -6,9 +6,9 @@

    File Allegati

    -
    + @*
    -
    +
    *@
@@ -26,9 +26,9 @@ - + *@ diff --git a/LiMan.UI/Components/ListAttach.razor.cs b/LiMan.UI/Components/ListAttach.razor.cs index 5705a1a..abf22e1 100644 --- a/LiMan.UI/Components/ListAttach.razor.cs +++ b/LiMan.UI/Components/ListAttach.razor.cs @@ -14,7 +14,42 @@ namespace LiMan.UI.Components { public partial class ListAttach { - private List files; + private List ListRecords; protected int totalCount = 0; + + //protected override async Task OnInitializedAsync() + //{ + // await ReloadAllData(); + //} + + private bool isLoading { get; set; } = false; + + [Inject] + private IJSRuntime JSRuntime { get; set; } + + [Inject] + protected LiManDataService DataService { get; set; } + + + [Parameter] + public EventCallback DataReset { get; set; } + + private async Task fullReload() + { + await DataService.InvalidateAllCache(); + await ReloadAllData(); + } + + private async Task ReloadAllData() + { + //isLoading = true; + //ListActivations = null; + //idxTicketSel = 0; + await Task.Delay(1); + //bool StatoRichiesta = true; + ListRecords = await DataService.FileGetFilt(5); + totalCount = ListRecords.Count(); + //isLoading = false; + } } } \ No newline at end of file diff --git a/LiMan.UI/Components/Tickets.razor b/LiMan.UI/Components/Tickets.razor index dff4f9b..6e071a9 100644 --- a/LiMan.UI/Components/Tickets.razor +++ b/LiMan.UI/Components/Tickets.razor @@ -1,12 +1,13 @@ @using LiMan.UI.Components - +
+

Tickets

- +
- + @if (ListRecords == null) { @@ -18,145 +19,115 @@ else { -
+ @* - # OriginalName FullStoragePath
- - - - - - - - - - - @foreach (var record in ListRecords) - { +
- - #RichiedenteContatti - Descrizione -
+ - - - - - + + + + + - } - -
- - - @record.IdxTicket
- @record.Status -
-
@record.ContactName
-
@record.DtReq
-
-
@record.ContactEmail
-
@record.ContactPhone
-
- @record.ReqBody - + + #RichiedenteContatti + Descrizione +
- } - @if (idxTicketSel > 0) - { -
-
-
- @if (StatusSel != DB.Enum.StatoRichiesta.Richiesta) - { - - } -
-
- @if (StatusSel != DB.Enum.StatoRichiesta.Valutazione) - { - - } -
-
- @if (StatusSel != DB.Enum.StatoRichiesta.Approvata) - { - - } -
-
- @if (StatusSel != DB.Enum.StatoRichiesta.Rifiutata) - { - - } -
-
- @if (ListActivations != null && ListActivations.Count > 0) - { - - - - - - - - - - - - - @foreach (var record in ListActivations) - { - - - - - - - - - } - -
- - #Impiego - Chiave   - @if (showKey) - { - - } - else - { - - } - Scadenza Veto
- - - @record.IdxSubLic - - @record.CodImpiego - - @if (showKey) - { - @decryptAuthKey(record.Chiave) - } - else - { - @record.Chiave - } - - @($"{record.VetoUnlock:yyyy.MM.dd}") - - @if (record.Locked) - { - - } - else - { - - } -
- } -
+ + + @foreach (var record in ListRecords) + { + + + + + + @record.IdxTicket
+ @record.Status + + +
@record.ContactName
+
@record.DtReq
+ + +
@record.ContactEmail
+
@record.ContactPhone
+ + + @record.ReqBody + + + } + + + } +
+
+
+
+ @if (idxTicketSel > 0) + { +
+ + + + + + @**@ + + + + @foreach (var record in FileAttached) + { + + + @**@ + + } + +
Nome FileOriginalNameFullStoragePath
+ @record.OriginalName
+ +
+
@record.FullStoragePath
+
+
+ } + +
+ + + +@*
+ @if (idxTicketSel > 0) + { +
+ + + + + + @* + + + + @foreach (var record in FileAttached) + { + + + @* + + } + +
#OriginalNameFullStoragePath
+ @record.OriginalName
+ +
+
@record.FullStoragePath
+
+
+ } +
+*@ \ No newline at end of file diff --git a/LiMan.UI/Components/Tickets.razor.cs b/LiMan.UI/Components/Tickets.razor.cs index 21621bd..830324b 100644 --- a/LiMan.UI/Components/Tickets.razor.cs +++ b/LiMan.UI/Components/Tickets.razor.cs @@ -20,6 +20,8 @@ namespace LiMan.UI.Components private List ListRecords; protected int totalCount = 0; + private List FileAttached; + #endregion Private Fields #region Protected Fields @@ -110,6 +112,7 @@ namespace LiMan.UI.Components await Task.Delay(1); //bool StatoRichiesta = true; ListRecords = await DataService.TicketsGetAll(); + totalCount = ListRecords.Count(); isLoading = false; } @@ -118,11 +121,6 @@ namespace LiMan.UI.Components #region Protected Methods - protected async void close() - { - await DataUpdated.InvokeAsync(0); - } - protected async void closeDet() { await ReloadAllData(); @@ -161,16 +159,17 @@ namespace LiMan.UI.Components showKey = !showKey; } - protected void showDet(TicketDTO currTicket) + protected async Task showDet(TicketDTO currTicket) { // salvo ticket sel idxTicketSel = currTicket.IdxTicket; StatusSel = currTicket.Status; + FileAttached = await DataService.FileGetFilt(idxTicketSel); // mostro SOLO le attivazioni di cui ho ticket attivi... //ListActivations = MasterLicence - //.Attivazioni - //.Where(a => a.IdxSubLic == currTicket.IdxSubLic) - //.ToList(); + //.Attivazioni + //.Where(a => a.IdxSubLic == currTicket.IdxSubLic) + //.ToList(); } protected async Task UnLock(SubLicenzaModel selRecord) diff --git a/LiMan.UI/Data/LiManDataService.cs b/LiMan.UI/Data/LiManDataService.cs index 5001076..5e7e1b5 100644 --- a/LiMan.UI/Data/LiManDataService.cs +++ b/LiMan.UI/Data/LiManDataService.cs @@ -12,6 +12,7 @@ using System.Text; using System.Threading.Tasks; using static LiMan.DB.Enum; using Microsoft.AspNetCore.Identity.UI.Services; +using LiMan.DB.DBModels; namespace LiMan.UI.Data { @@ -538,6 +539,24 @@ namespace LiMan.UI.Data return await Task.FromResult(dbResult); } + /// + /// Elenco file registrati dato ticket id + /// + /// Identificativo del ticket + /// + public async Task> FileGetFilt(int idxTicket) + { + List dbResult = new List(); + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + dbResult = dbControllerNext.FileGetFilt(idxTicket); + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Trace($"Effettuata lettura da DB per FileGetFilt: {ts.TotalMilliseconds} ms"); + return await Task.FromResult(dbResult); + + } + public async Task LicenzeNextUpdate(DB.DBModels.LicenzaModel currItem) { bool done = false; diff --git a/LiMan.UI/LiMan.UI.csproj b/LiMan.UI/LiMan.UI.csproj index 0bf83cb..fe5cca9 100644 --- a/LiMan.UI/LiMan.UI.csproj +++ b/LiMan.UI/LiMan.UI.csproj @@ -2,7 +2,7 @@ net5.0 - 1.1.2202.0409 + 1.1.2202.0418 LiMan.UI LiMan.UI diff --git a/LiMan.UI/Resources/ChangeLog.html b/LiMan.UI/Resources/ChangeLog.html index d43bdf9..b21b820 100644 --- a/LiMan.UI/Resources/ChangeLog.html +++ b/LiMan.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ License Manager -

Versione: 1.1.2202.0409

+

Versione: 1.1.2202.0418


Note di rilascio:
    diff --git a/LiMan.UI/Resources/VersNum.txt b/LiMan.UI/Resources/VersNum.txt index 4ed29e8..e568cc5 100644 --- a/LiMan.UI/Resources/VersNum.txt +++ b/LiMan.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2202.0409 +1.1.2202.0418 diff --git a/LiMan.UI/Resources/manifest.xml b/LiMan.UI/Resources/manifest.xml index 823f8e8..57e5918 100644 --- a/LiMan.UI/Resources/manifest.xml +++ b/LiMan.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2202.0409 + 1.1.2202.0418 https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.UI.zip https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html false From f7d09c7e66514f5469ff14f139c703a96df292db Mon Sep 17 00:00:00 2001 From: "marco.salvi" Date: Mon, 7 Feb 2022 10:54:05 +0100 Subject: [PATCH 3/6] Modifica impaginazione pagina ticket --- LiMan.UI/Components/ListAttach.razor.cs | 1 - LiMan.UI/Components/Tickets.razor | 222 ++++++++++++------------ LiMan.UI/Components/Tickets.razor.cs | 6 + LiMan.UI/Data/LiManDataService.cs | 10 +- LiMan.UI/LiMan.UI.csproj | 2 +- LiMan.UI/Resources/ChangeLog.html | 2 +- LiMan.UI/Resources/VersNum.txt | 2 +- LiMan.UI/Resources/manifest.xml | 2 +- 8 files changed, 128 insertions(+), 119 deletions(-) diff --git a/LiMan.UI/Components/ListAttach.razor.cs b/LiMan.UI/Components/ListAttach.razor.cs index abf22e1..5e4bd97 100644 --- a/LiMan.UI/Components/ListAttach.razor.cs +++ b/LiMan.UI/Components/ListAttach.razor.cs @@ -8,7 +8,6 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using static LiMan.DB.Enum; namespace LiMan.UI.Components { diff --git a/LiMan.UI/Components/Tickets.razor b/LiMan.UI/Components/Tickets.razor index 6b55a9b..61d0cfb 100644 --- a/LiMan.UI/Components/Tickets.razor +++ b/LiMan.UI/Components/Tickets.razor @@ -1,135 +1,137 @@ @using LiMan.UI.Components
    -
    -
    -
    -

    Tickets

    -
    +
    +
    +
    +

    Tickets

    +
    -
    +
    - @if (ListRecords == null) - { - - } - else if (totalCount == 0) - { -
    Nessun record trovato
    - } - else - { + @if (ListRecords == null) + { + + } + else if (totalCount == 0) + { +
    Nessun record trovato
    + } + else + { - - - - - - - - - - - - - @foreach (var record in ListRecords) - { - - - - - - - - } - - -
    - - #RichiedenteContatti - Descrizione -
    - - - @record.IdxTicket
    - @record.Status -
    -
    @record.ContactName
    -
    @record.DtReq
    -
    -
    @record.ContactEmail
    -
    @record.ContactPhone
    -
    - @record.ReqBody -
    - } - -
    - -
    -
    -
    - @if (idxTicketSel > 0) - { -
    - - - @**@ + + + + + + - @foreach (var record in FileAttached) - { - + @foreach (var record in ListRecords) + { + + + + - @**@ - } - -
    Nome FileOriginalNameFullStoragePath + + #RichiedenteContatti + Descrizione +
    - @record.OriginalName
    - + +
    + @record.IdxTicket
    + @record.Status +
    +
    @record.ContactName
    +
    @record.DtReq
    +
    +
    @record.ContactEmail
    +
    @record.ContactPhone
    +
    + @record.ReqBody -
    @record.FullStoragePath
    -
    -
    } - -
    + + + + } + +
    + +
    +
    + + @if (idxTicketSel > 0) + { +
    +
    + + + + + + @**@ + + + + @foreach (var record in FileAttached) + { + + + + @**@ + + } + +
    Nome FileOriginalNameFullStoragePath
    + @record.OriginalName
    + +
    +
    @record.FullStoragePath
    +
    +
    +
    + } +
    + @*
    @if (idxTicketSel > 0) { -
    - - - - - - @* - - - - @foreach (var record in FileAttached) - { - - + @* + } - + +
    #OriginalNameFullStoragePath
    - @record.OriginalName
    +
    + + + + + + @* + + + + @foreach (var record in FileAttached) + { + + - @* - - } - -
    #OriginalNameFullStoragePath
    + @record.OriginalName
    -
    -
    @record.FullStoragePath
    -
    -
    +
    +
    @record.FullStoragePath
    +
    +
    + } +
    *@ \ No newline at end of file diff --git a/LiMan.UI/Components/Tickets.razor.cs b/LiMan.UI/Components/Tickets.razor.cs index 22dc2e4..295be22 100644 --- a/LiMan.UI/Components/Tickets.razor.cs +++ b/LiMan.UI/Components/Tickets.razor.cs @@ -1,4 +1,5 @@ using Core; +using Core.DTO; using LiMan.DB.DBModels; using LiMan.DB.DTO; using LiMan.UI.Data; @@ -103,6 +104,11 @@ namespace LiMan.UI.Components await ReloadAllData(); } + protected string mainCss + { + get => idxTicketSel == 0 ? "col-12" : "col-9"; + } + private async Task ReloadAllData() { isLoading = true; diff --git a/LiMan.UI/Data/LiManDataService.cs b/LiMan.UI/Data/LiManDataService.cs index ba07917..bc6ebfd 100644 --- a/LiMan.UI/Data/LiManDataService.cs +++ b/LiMan.UI/Data/LiManDataService.cs @@ -12,6 +12,8 @@ using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Identity.UI.Services; using Core; +using Core.DTO; +using LiMan.DB.DBModels; namespace LiMan.UI.Data { @@ -619,10 +621,10 @@ namespace LiMan.UI.Data /// /// /// - public async Task> TicketsGetFilt(SelectNext CurrFilter) + public async Task> TicketsGetFilt(SelectNext CurrFilter) { Stopwatch stopWatch = new Stopwatch(); - List dbResult = new List(); + List dbResult = new List(); stopWatch.Start(); dbResult = dbControllerNext.TicketGetFiltAllLic(CurrFilter.OnlyActive, Core.TipologiaTicket.ND, CurrFilter.ApplicazioneSel, CurrFilter.InstallazioneSel, 1000); stopWatch.Stop(); @@ -636,10 +638,10 @@ namespace LiMan.UI.Data /// /// /// - public async Task> TicketsGetAll() + public async Task> TicketsGetAll() { Stopwatch stopWatch = new Stopwatch(); - List dbResult = new List(); + List dbResult = new List(); stopWatch.Start(); dbResult = dbControllerNext.TicketGetAll(false, 1000); stopWatch.Stop(); diff --git a/LiMan.UI/LiMan.UI.csproj b/LiMan.UI/LiMan.UI.csproj index cdeca2b..86114de 100644 --- a/LiMan.UI/LiMan.UI.csproj +++ b/LiMan.UI/LiMan.UI.csproj @@ -2,7 +2,7 @@ net5.0 - 1.1.2202.0709 + 1.1.2202.0710 LiMan.UI LiMan.UI diff --git a/LiMan.UI/Resources/ChangeLog.html b/LiMan.UI/Resources/ChangeLog.html index 16bed4a..91b1178 100644 --- a/LiMan.UI/Resources/ChangeLog.html +++ b/LiMan.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ License Manager -

    Versione: 1.1.2202.0709

    +

    Versione: 1.1.2202.0710


    Note di rilascio:
      diff --git a/LiMan.UI/Resources/VersNum.txt b/LiMan.UI/Resources/VersNum.txt index 8c83aa2..098fc2f 100644 --- a/LiMan.UI/Resources/VersNum.txt +++ b/LiMan.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2202.0709 +1.1.2202.0710 diff --git a/LiMan.UI/Resources/manifest.xml b/LiMan.UI/Resources/manifest.xml index 601d909..4300ce2 100644 --- a/LiMan.UI/Resources/manifest.xml +++ b/LiMan.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2202.0709 + 1.1.2202.0710 https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.UI.zip https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html false From 86077f0217cc22eff2f06891387cbe901eacc3d0 Mon Sep 17 00:00:00 2001 From: "marco.salvi" Date: Wed, 9 Feb 2022 10:37:11 +0100 Subject: [PATCH 4/6] Pulizia javascript per download file inutile e modifica costruzione link per download --- LiMan.Api/appsettings.json | 3 ++- LiMan.UI/Components/Tickets.razor | 23 ++++++++++++++++++----- LiMan.UI/Components/Tickets.razor.cs | 10 ++++++++++ LiMan.UI/LiMan.UI.csproj | 2 +- LiMan.UI/Resources/ChangeLog.html | 2 +- LiMan.UI/Resources/VersNum.txt | 2 +- LiMan.UI/Resources/manifest.xml | 2 +- LiMan.UI/Startup.cs | 11 +++++++++++ LiMan.UI/appsettings.json | 3 ++- 9 files changed, 47 insertions(+), 11 deletions(-) diff --git a/LiMan.Api/appsettings.json b/LiMan.Api/appsettings.json index 9eaca6a..e723b87 100644 --- a/LiMan.Api/appsettings.json +++ b/LiMan.Api/appsettings.json @@ -42,5 +42,6 @@ ], "Database": 14 }, - "FileShare": "\\\\stor01\\TEAM DRIVES\\40_FileUpload\\unsafe_uploads" + "FileShare": "\\\\stor01\\TEAM DRIVES\\40_FileUpload\\unsafe_uploads", + "ApiUrl": "https://liman.egalware.com/" } \ No newline at end of file diff --git a/LiMan.UI/Components/Tickets.razor b/LiMan.UI/Components/Tickets.razor index 61d0cfb..567f637 100644 --- a/LiMan.UI/Components/Tickets.razor +++ b/LiMan.UI/Components/Tickets.razor @@ -1,4 +1,10 @@ @using LiMan.UI.Components +@using Microsoft.Extensions.Configuration +@inject IConfiguration Configuration + +@using System.IO +@inject IJSRuntime JS +
      @@ -76,8 +82,7 @@ Nome File - OriginalName - @*FullStoragePath*@ + FullStoragePath @@ -86,16 +91,24 @@ - @record.OriginalName
      + @**@ + @record.OriginalName + @* @record.OriginalName*@ + - @* +
      @record.FullStoragePath
      - *@ + + } + + @* *@
      } diff --git a/LiMan.UI/Components/Tickets.razor.cs b/LiMan.UI/Components/Tickets.razor.cs index 295be22..31fe242 100644 --- a/LiMan.UI/Components/Tickets.razor.cs +++ b/LiMan.UI/Components/Tickets.razor.cs @@ -122,6 +122,16 @@ namespace LiMan.UI.Components isLoading = false; } + + //private async void DownloadFileFromURL(string fileName, string rawUrl) + //{ + // rawUrl = rawUrl.Replace("\\", "/"); + // var fileURL = $"unsafe_uploads/"+rawUrl; + // //var fileName = "log-0001.txt"; + // //var fileName = FileAttached; + // await JS.InvokeVoidAsync("triggerFileDownload", fileName, fileURL); + //} + #endregion Private Methods #region Protected Methods diff --git a/LiMan.UI/LiMan.UI.csproj b/LiMan.UI/LiMan.UI.csproj index 86114de..98affc9 100644 --- a/LiMan.UI/LiMan.UI.csproj +++ b/LiMan.UI/LiMan.UI.csproj @@ -2,7 +2,7 @@ net5.0 - 1.1.2202.0710 + 1.1.2202.0910 LiMan.UI LiMan.UI diff --git a/LiMan.UI/Resources/ChangeLog.html b/LiMan.UI/Resources/ChangeLog.html index 91b1178..5c7c3f4 100644 --- a/LiMan.UI/Resources/ChangeLog.html +++ b/LiMan.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ License Manager -

      Versione: 1.1.2202.0710

      +

      Versione: 1.1.2202.0910


      Note di rilascio:
        diff --git a/LiMan.UI/Resources/VersNum.txt b/LiMan.UI/Resources/VersNum.txt index 098fc2f..f27f229 100644 --- a/LiMan.UI/Resources/VersNum.txt +++ b/LiMan.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2202.0710 +1.1.2202.0910 diff --git a/LiMan.UI/Resources/manifest.xml b/LiMan.UI/Resources/manifest.xml index 4300ce2..bb0d05f 100644 --- a/LiMan.UI/Resources/manifest.xml +++ b/LiMan.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2202.0710 + 1.1.2202.0910 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 57cfb22..3fe6b22 100644 --- a/LiMan.UI/Startup.cs +++ b/LiMan.UI/Startup.cs @@ -15,6 +15,8 @@ using System.Globalization; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Identity.UI.Services; +using Microsoft.Extensions.FileProviders; +using Microsoft.AspNetCore.Http; namespace LiMan.UI { @@ -72,6 +74,15 @@ namespace LiMan.UI app.UseHttpsRedirection(); app.UseStaticFiles(); + + app.UseFileServer(new FileServerOptions + { + FileProvider = new PhysicalFileProvider(@"\\stor01\TEAM DRIVES\40_FileUpload\unsafe_uploads"), + RequestPath = new PathString("/unsafe_uploads"), + EnableDirectoryBrowsing = true + //EnableDirectoryBrowsing = false + }); + app.UseRouting(); app.UseEndpoints(endpoints => diff --git a/LiMan.UI/appsettings.json b/LiMan.UI/appsettings.json index 1da47b7..04e53ef 100644 --- a/LiMan.UI/appsettings.json +++ b/LiMan.UI/appsettings.json @@ -28,5 +28,6 @@ "MailDest": { "Admin": "samuele@steamware.net", "ProcOp": "ceo@steamware.net" - } + }, + "ApiUrl": "https://liman.egalware.com" } \ No newline at end of file From 20fc4f17936459ce881013877722f11ef8c3c791 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 9 Feb 2022 12:47:12 +0100 Subject: [PATCH 5/6] Aggiunta gestione AUTH su pagine --- LiMan.UI/Pages/Applicazioni.razor | 1 + LiMan.UI/Pages/Installazioni.razor | 1 + LiMan.UI/Pages/LiManDB.razor | 1 + LiMan.UI/Pages/LiManGLS.razor | 1 + LiMan.UI/Pages/LicenseManager.razor | 1 + LiMan.UI/Pages/ListaTicket.razor | 1 + 6 files changed, 6 insertions(+) diff --git a/LiMan.UI/Pages/Applicazioni.razor b/LiMan.UI/Pages/Applicazioni.razor index 18c5944..95b606e 100644 --- a/LiMan.UI/Pages/Applicazioni.razor +++ b/LiMan.UI/Pages/Applicazioni.razor @@ -1,4 +1,5 @@ @page "/Applicazioni" +@attribute [Authorize] @using LiMan.UI.Components @using LiMan.UI.Data diff --git a/LiMan.UI/Pages/Installazioni.razor b/LiMan.UI/Pages/Installazioni.razor index c3f2cc7..10cad1e 100644 --- a/LiMan.UI/Pages/Installazioni.razor +++ b/LiMan.UI/Pages/Installazioni.razor @@ -1,4 +1,5 @@ @page "/Installazioni" +@attribute [Authorize] @using LiMan.UI.Components @using LiMan.UI.Data diff --git a/LiMan.UI/Pages/LiManDB.razor b/LiMan.UI/Pages/LiManDB.razor index e507c15..59e2a61 100644 --- a/LiMan.UI/Pages/LiManDB.razor +++ b/LiMan.UI/Pages/LiManDB.razor @@ -1,4 +1,5 @@ @page "/LiManDB" +@attribute [Authorize] @using LiMan.UI.Components diff --git a/LiMan.UI/Pages/LiManGLS.razor b/LiMan.UI/Pages/LiManGLS.razor index f6e1214..1e05c7c 100644 --- a/LiMan.UI/Pages/LiManGLS.razor +++ b/LiMan.UI/Pages/LiManGLS.razor @@ -1,4 +1,5 @@ @page "/LiManGLS" +@attribute [Authorize] @using LiMan.UI.Components diff --git a/LiMan.UI/Pages/LicenseManager.razor b/LiMan.UI/Pages/LicenseManager.razor index c9e02be..522ed4a 100644 --- a/LiMan.UI/Pages/LicenseManager.razor +++ b/LiMan.UI/Pages/LicenseManager.razor @@ -1,4 +1,5 @@ @page "/LicenseManager" +@attribute [Authorize] @using LiMan.UI.Components diff --git a/LiMan.UI/Pages/ListaTicket.razor b/LiMan.UI/Pages/ListaTicket.razor index c45a328..9c711b7 100644 --- a/LiMan.UI/Pages/ListaTicket.razor +++ b/LiMan.UI/Pages/ListaTicket.razor @@ -1,4 +1,5 @@ @page "/ListaTicket" +@attribute [Authorize] @using LiMan.UI.Components @using LiMan.UI.Data From 5eb53c677d4b1221748a4a37f6abb300aae390aa Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 9 Feb 2022 12:47:20 +0100 Subject: [PATCH 6/6] Fix gestione autenticazione in progetto --- LiMan.Transfer/Resources/ChangeLog.html | 2 +- LiMan.Transfer/Resources/VersNum.txt | 2 +- LiMan.Transfer/Resources/manifest.xml | 2 +- LiMan.UI/App.razor | 22 ++++++++++++---------- LiMan.UI/Components/CmpTop.razor | 4 +++- LiMan.UI/LiMan.UI.csproj | 3 ++- LiMan.UI/Properties/launchSettings.json | 4 ++-- LiMan.UI/Resources/ChangeLog.html | 2 +- LiMan.UI/Resources/VersNum.txt | 2 +- LiMan.UI/Resources/manifest.xml | 2 +- LiMan.UI/Startup.cs | 12 ++++++++++++ 11 files changed, 37 insertions(+), 20 deletions(-) diff --git a/LiMan.Transfer/Resources/ChangeLog.html b/LiMan.Transfer/Resources/ChangeLog.html index 1cc67b7..ac6d0cf 100644 --- a/LiMan.Transfer/Resources/ChangeLog.html +++ b/LiMan.Transfer/Resources/ChangeLog.html @@ -1,6 +1,6 @@ License Manager -

        Versione: 1.1.2202.0907

        +

        Versione: 1.1.2202.0912


        Note di rilascio:
          diff --git a/LiMan.Transfer/Resources/VersNum.txt b/LiMan.Transfer/Resources/VersNum.txt index 08203ff..29776ab 100644 --- a/LiMan.Transfer/Resources/VersNum.txt +++ b/LiMan.Transfer/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2202.0907 +1.1.2202.0912 diff --git a/LiMan.Transfer/Resources/manifest.xml b/LiMan.Transfer/Resources/manifest.xml index 93a9fc0..3d50f58 100644 --- a/LiMan.Transfer/Resources/manifest.xml +++ b/LiMan.Transfer/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2202.0907 + 1.1.2202.0912 https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.Transfer.zip https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html false diff --git a/LiMan.UI/App.razor b/LiMan.UI/App.razor index 3a2af53..4df9aaf 100644 --- a/LiMan.UI/App.razor +++ b/LiMan.UI/App.razor @@ -1,10 +1,12 @@ - - - - - - -

          Sorry, there's nothing at this address.

          -
          -
          -
          + + + + + + + +

          Sorry, there's nothing at this address.

          +
          +
          +
          +
          diff --git a/LiMan.UI/Components/CmpTop.razor b/LiMan.UI/Components/CmpTop.razor index 436c6a1..6e2fd8b 100644 --- a/LiMan.UI/Components/CmpTop.razor +++ b/LiMan.UI/Components/CmpTop.razor @@ -8,7 +8,9 @@
          - @**@ + + +
          @PageName diff --git a/LiMan.UI/LiMan.UI.csproj b/LiMan.UI/LiMan.UI.csproj index a06f002..5fff649 100644 --- a/LiMan.UI/LiMan.UI.csproj +++ b/LiMan.UI/LiMan.UI.csproj @@ -2,7 +2,7 @@ net5.0 - 1.1.2202.0907 + 1.1.2202.0912 LiMan.UI LiMan.UI @@ -37,6 +37,7 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/LiMan.UI/Properties/launchSettings.json b/LiMan.UI/Properties/launchSettings.json index 03a78d5..0dd09c4 100644 --- a/LiMan.UI/Properties/launchSettings.json +++ b/LiMan.UI/Properties/launchSettings.json @@ -1,7 +1,7 @@ { "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, + "windowsAuthentication": true, + "anonymousAuthentication": false, "iisExpress": { "applicationUrl": "http://localhost:61247", "sslPort": 44392 diff --git a/LiMan.UI/Resources/ChangeLog.html b/LiMan.UI/Resources/ChangeLog.html index 1cc67b7..ac6d0cf 100644 --- a/LiMan.UI/Resources/ChangeLog.html +++ b/LiMan.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ License Manager -

          Versione: 1.1.2202.0907

          +

          Versione: 1.1.2202.0912


          Note di rilascio:
            diff --git a/LiMan.UI/Resources/VersNum.txt b/LiMan.UI/Resources/VersNum.txt index 08203ff..29776ab 100644 --- a/LiMan.UI/Resources/VersNum.txt +++ b/LiMan.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2202.0907 +1.1.2202.0912 diff --git a/LiMan.UI/Resources/manifest.xml b/LiMan.UI/Resources/manifest.xml index 7b99f80..0970b42 100644 --- a/LiMan.UI/Resources/manifest.xml +++ b/LiMan.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2202.0907 + 1.1.2202.0912 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 3fe6b22..4347759 100644 --- a/LiMan.UI/Startup.cs +++ b/LiMan.UI/Startup.cs @@ -16,6 +16,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Identity.UI.Services; using Microsoft.Extensions.FileProviders; +using Microsoft.AspNetCore.Authentication.Negotiate; using Microsoft.AspNetCore.Http; namespace LiMan.UI @@ -85,6 +86,9 @@ namespace LiMan.UI app.UseRouting(); + app.UseAuthentication(); + app.UseAuthorization(); + app.UseEndpoints(endpoints => { endpoints.MapBlazorHub(); @@ -96,6 +100,14 @@ namespace LiMan.UI // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { + services.AddAuthentication(NegotiateDefaults.AuthenticationScheme) + .AddNegotiate(); + services.AddAuthorization(options => + { + // By default, all incoming requests will be authorized according to the default policy. + options.FallbackPolicy = options.DefaultPolicy; + }); + // cookie applicazione da 14 gg (defaul) a 30 services.ConfigureApplicationCookie(o => {