99 Commits

Author SHA1 Message Date
Samuele Locatelli a714b5388b Merge tag 'FixEmailRev01' into develop
Fix email reversed
2023-11-06 11:09:38 +01:00
Samuele Locatelli 2633d7af0a Merge branch 'release/FixEmailRev01' 2023-11-06 11:09:29 +01:00
Samuele Locatelli ea148e953c Fix email pwd (valore, read) 2023-11-06 11:08:47 +01:00
Samuele Locatelli ea5f4b2284 Merge tag 'FixIIs04TargetDeploy' into develop
fix deploy x MsDeploy path
2023-03-14 15:27:48 +01:00
Samuele Locatelli 55cfed26bb Merge branch 'release/FixIIs04TargetDeploy' 2023-03-14 15:27:39 +01:00
Samuele Locatelli c4f646a8b0 cambio path x deploy su liman x API 2023-03-14 15:27:07 +01:00
Samuele Locatelli 2e852b0893 pulizia pubxml 2023-03-14 15:26:17 +01:00
Samuele Locatelli 94f22f8fa4 fix yaml x variables 2023-03-14 15:07:24 +01:00
Samuele Locatelli 0f75ef1633 Merge tag 'UpdateIis04Pubxml' into develop
fix pub iis04
2023-03-14 14:36:16 +01:00
Samuele Locatelli 05b6a42db1 Merge branch 'release/UpdateIis04Pubxml' 2023-03-14 14:36:10 +01:00
Samuele Locatelli 872b5ca316 fix x IIS04 2023-03-14 14:35:48 +01:00
Samuele Locatelli c7f4c97700 ancora udpate CI/CD 2023-03-14 14:33:33 +01:00
Samuele Locatelli d7d1698a10 Update vari pubxml x CI/CD 2023-03-14 14:33:28 +01:00
Samuele Locatelli 34d23a6b80 Merge tag 'FixCiCdOnMain' into develop
Fix deploy on main
2023-03-14 12:10:14 +01:00
Samuele Locatelli 09f4c3c5f9 Merge branch 'release/FixCiCdOnMain' 2023-03-14 12:10:08 +01:00
Samuele Locatelli 5ace18880b Fix yaml CI/CD 2023-03-14 12:07:34 +01:00
Samuele Locatelli 78fb307cbb Merge tag 'FixCodeOptimOnDebug' into develop
Ottimizzazione codice in debug esclusa (x problema testing...)
2023-03-14 12:04:33 +01:00
Samuele Locatelli cb185b8786 Merge branch 'release/FixCodeOptimOnDebug' 2023-03-14 12:04:21 +01:00
Samuele Locatelli 3462046e42 refresh progetto LiMan:
- compilazione senza ottimizzaizoni in debug
- verifica problema update licenze da GPW CORE NEXT
2023-03-14 11:43:50 +01:00
Samuele Locatelli 4821f441b6 Fix configurazione DB! 2023-02-03 19:37:52 +01:00
Samuele Locatelli 816a7278aa Code cleanup (typo) 2022-07-06 09:38:43 +02:00
Samuele Locatelli b502420309 Merge tag 'UpdateKeyGenProcess' into develop
Aggiornamento processo KeyGen
2022-06-08 19:13:57 +02:00
Samuele Locatelli ab1556058a Merge branch 'release/UpdateKeyGenProcess' 2022-06-08 19:13:37 +02:00
Samuele Locatelli 00ec07453b Update keygen process 2022-06-08 19:12:03 +02:00
Samuele Locatelli c924e5b4e7 Merge tag 'FixKeyGen' into develop
Update x generazione KEY
2022-06-08 14:59:44 +02:00
Samuele Locatelli 6ba7564862 Merge branch 'release/FixKeyGen' 2022-06-08 14:59:19 +02:00
Samuele Locatelli ecaabd56ec Update display multiline x KeyGen da MachineInfo 2022-06-08 14:58:58 +02:00
Samuele Locatelli bf8f455c0c Update aspetto grafico recupero key licenza 2022-06-08 12:48:13 +02:00
Samuele Locatelli f5884e371d Aggiunta classi e componenti x generazione key auth hashed 2022-06-08 12:43:20 +02:00
Samuele Locatelli 4b6c6c7360 Merge tag 'FixSmtpRelay' into develop
Completato fix invio SMTP con server outlook vs gmail
2022-06-08 11:30:38 +02:00
Samuele Locatelli b5866beb43 Merge branch 'release/FixSmtpRelay' 2022-06-08 11:30:20 +02:00
Samuele Locatelli 72063ec338 refresh data 2022-06-08 11:29:34 +02:00
Samuele Locatelli 704169ea7a update conf SMTP gmail --> outlook 2022-06-08 11:29:25 +02:00
Samuele Locatelli 8fd4d39bb5 Aggiunto try/catch x invio email + avvio con security opt auto 2022-06-08 11:29:14 +02:00
Samuele Locatelli 4dbe99f2f1 typo 2022-06-08 10:05:15 +02:00
Samuele Locatelli c7320338d7 Merge tag 'FixEmailSubject' into develop
Fix testo email
2022-05-17 13:05:29 +02:00
Samuele Locatelli ff05e237a6 Merge branch 'release/FixEmailSubject' 2022-05-17 13:05:22 +02:00
Samuele Locatelli c3ec21979c ancora fix testo 2022-05-17 13:05:13 +02:00
Samuele Locatelli a7d27169f1 Typo email message update 2022-05-17 13:04:34 +02:00
Samuele Locatelli a1f3703c1b Merge tag 'CheckLicenzeScadute' into develop
Aggiunta servizio x check licenze scadute
2022-05-16 18:15:24 +02:00
Samuele Locatelli 46937deb89 Merge branch 'release/CheckLicenzeScadute' 2022-05-16 18:15:12 +02:00
Samuele Locatelli 065d6bd7e9 Merge remote-tracking branch 'origin/develop' into develop 2022-05-16 18:14:58 +02:00
Samuele Locatelli 2df65a3f81 Refresh 2022-05-16 18:14:32 +02:00
Samuele Locatelli 42a9bb0939 Update x invio notifica licenze scadute 2022-05-16 18:14:28 +02:00
Marco Salvi 02d47189c7 Update per master 2022-04-26 15:59:40 +00:00
Marco Salvi 82f29a64c9 Update per upload zip ui e api su nexus 2022-04-26 14:25:48 +00:00
Marco Salvi 2c0ef38c8f Update per upload zip ui e api su nexus 2022-04-26 14:19:09 +00:00
Marco Salvi 0946620767 Update .gitlab-ci.yml 2022-04-26 14:04:21 +00:00
Samuele Locatelli 4e0c53a875 typo 2022-04-26 14:25:49 +02:00
Samuele Locatelli 2409d677b3 Merge tag 'AddHealthCheck' into develop
Aggiunta health check generale
2022-04-22 16:35:55 +02:00
Samuele Locatelli 57f7a58298 Merge branch 'release/AddHealthCheck' 2022-04-22 16:35:45 +02:00
Samuele Locatelli a5d70ede6a Aggiunto health check generale: .../api/health + update insomnia call 2022-04-22 16:35:10 +02:00
Samuele Locatelli 42fc9a9db1 Merge branch 'main' into develop 2022-04-22 15:59:52 +02:00
Samuele Locatelli 7a2c227296 Update conf x call insomnia 2022-04-22 15:59:43 +02:00
Samuele Locatelli daa6a793d8 Merge branch 'develop' 2022-04-22 15:34:06 +02:00
Samuele Locatelli 0e9d9aade2 Update x liman APi: anche qui selezione file share secondo tipo HostOs 2022-04-22 15:33:59 +02:00
Samuele Locatelli d59f2489d0 Merge branch 'main' into develop 2022-04-22 11:47:01 +02:00
Samuele Locatelli e2bd1bc4ca Refresh 2022-04-22 11:45:49 +02:00
Samuele Locatelli 26c3321461 Modifica startup: verifica HostOs x decidere COME montare la cartella unsafe_uploads 2022-04-22 11:45:42 +02:00
marco.salvi acd0b7fed1 Modifica comportamento pagina ticket per essere uniforme al comportamento in homepage 2022-03-21 18:47:17 +01:00
marco.salvi d8ca11601d Merge branch 'develop' of https://gitlab.steamware.net/egalware/limanapp into develop 2022-03-18 16:28:04 +01:00
marco.salvi baf3c89c10 Modifica visualizzazione ticket homepage 2022-03-18 16:27:47 +01:00
Samuele Locatelli 3ac94e4a14 Merge tag 'PubblicazioneModificheTicketMarco' into develop
Pubblicazione modifiche ticket by Marco
2022-03-18 12:37:02 +01:00
Samuele Locatelli 0bdc4ef879 Merge branch 'release/PubblicazioneModificheTicketMarco' 2022-03-18 12:36:55 +01:00
marco.salvi 53f6712d86 Merge branch 'develop' of https://gitlab.steamware.net/egalware/limanapp into develop 2022-03-18 12:31:50 +01:00
marco.salvi 431690be9d Modificata visualizzaizone ticket in homepage in base al tipo se licenza o fileupload 2022-03-18 12:29:24 +01:00
Samuele Locatelli f23d19cf64 Merge tag 'FixDeployTransfer' into develop
Fix deploy transfer: non è + un single page app
2022-03-17 19:32:11 +01:00
Samuele Locatelli 3584075fcf Merge branch 'release/FixDeployTransfer' 2022-03-17 19:31:55 +01:00
Samuele Locatelli bc59b06b6e Levato single APP... 2022-03-17 19:30:30 +01:00
Samuele Locatelli c70e6151d9 test build/publish 2022-03-17 19:28:00 +01:00
Samuele Locatelli b8ec296dc6 Update x ridurre errori compilazione 2022-03-17 19:20:35 +01:00
Samuele Locatelli 8bfa06ec0a cambio opzione framework dependancy x Transfer APP 2022-03-17 18:39:40 +01:00
Samuele Locatelli 39388f44c7 Typo fix 2022-03-17 18:38:31 +01:00
Samuele Locatelli 9fd6736f27 refresh conf x transfer program 2022-03-17 18:22:58 +01:00
Samuele Locatelli ad9e9fc957 test fix transfer CI/CD 2022-03-17 18:12:14 +01:00
Samuele Locatelli 46dd6e0cc3 Typo vari 2022-03-17 18:10:50 +01:00
Samuele Locatelli bd8617750f Merge tag 'FixTransferProgramEnums' into develop
Fix enum da core x transfer program
2022-03-17 14:41:24 +01:00
Samuele Locatelli f4fa99c0c2 Merge branch 'release/FixTransferProgramEnums' 2022-03-17 14:41:16 +01:00
Samuele Locatelli 3c271dd802 Fix using x Transfer program 2022-03-17 14:40:50 +01:00
Samuele Locatelli d285162d63 Merge tag 'AddClosedTicketFromApi' into develop
Aggiunta nell'elenco ticket da installaizone anche quelli chiusi
2022-03-17 14:39:34 +01:00
Samuele Locatelli 9604e12b21 Merge branch 'release/AddClosedTicketFromApi' 2022-03-17 14:39:17 +01:00
Samuele Locatelli 4298d1d8be Update: mostra TUTTI i ticket via REST 2022-03-17 14:38:51 +01:00
Samuele Locatelli 61340fe6dc Merge tag 'InizioFixGestioneTicket' into develop
Inizio gestione ticket licenze come prima
2022-03-17 13:01:23 +01:00
Samuele Locatelli 5f0a82ab67 Merge branch 'release/InizioFixGestioneTicket' 2022-03-17 13:01:03 +01:00
marco.salvi ce071c8cfd Ripristinato funzionamento originario gestione ticket su pagina principale, più fix chiusura pannello relativo 2022-03-17 12:58:35 +01:00
Samuele Locatelli b5d72a18bb Merge tag 'AddEmailOnTicket' into develop
Aggiunta notifica email x nuovi ticket (da testare!)
2022-03-16 18:43:02 +01:00
Samuele Locatelli 1c7aef0bad Merge branch 'release/AddEmailOnTicket' 2022-03-16 18:42:52 +01:00
Samuele Locatelli 0b6851eefb Update x invio notifica email dei tickets 2022-03-16 18:42:24 +01:00
Samuele Locatelli 74db3e9c0c Merge tag 'FixSwaggerDisplay' into develop
Fix display route swagger solo in develop / staging
2022-03-02 19:01:10 +01:00
Samuele Locatelli a0503bb07e Merge branch 'release/FixSwaggerDisplay' 2022-03-02 19:00:52 +01:00
Samuele Locatelli 78da4b0922 Fix display swagger solo in development/staging 2022-03-02 19:00:25 +01:00
Samuele Locatelli 74b640efe3 refresh DataService class 2022-02-14 15:53:16 +01:00
Samuele Locatelli c2da7c5590 Merge tag 'FixDotnet' into develop
Fix dotnet 5--> 6 che dava problema CI/CD
2022-02-11 14:57:06 +01:00
Samuele Locatelli 951cc064c7 Merge branch 'release/FixDotnet' 2022-02-11 14:56:51 +01:00
Samuele Locatelli c2f469cd29 refresh versioni dotnet 2022-02-11 14:54:20 +01:00
Samuele Locatelli c0638513cb Merge tag 'DotNet6AndFilter' into develop
Inserimento modifica x passaggio net 5 --> net 6 + update filtraggio
tickets
2022-02-11 14:38:43 +01:00
Samuele Locatelli 094750f247 Merge branch 'release/DotNet6AndFilter' 2022-02-11 14:38:19 +01:00
Samuele Locatelli 28f2dbf2e3 Merge remote-tracking branch 'origin/NetCore6Up' into develop 2022-02-11 14:35:24 +01:00
Samuele Locatelli 7841e5ebbc update e pulizia codice 2022-02-11 14:34:20 +01:00
68 changed files with 2378 additions and 1053 deletions
+4
View File
@@ -0,0 +1,4 @@
[*.cs]
# CS1591: Missing XML comment for publicly visible type or member
dotnet_diagnostic.CS1591.severity = none
+32 -47
View File
@@ -7,9 +7,9 @@ variables:
- |
$hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C
if ($hasSource -eq 0) {
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$NEXUS_PASSWD`""
} else {
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source https://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"$NEXUS_PASSWD`""
}
echo $hasSource
@@ -78,15 +78,13 @@ variables:
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/ARCHIVE/$VersNumb/$FileName
echo "mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/$FileName"
}
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "$env:APP_NAME\Resources\manifest.xml" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/manifest.xml
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "$env:APP_NAME\Resources\ChangeLog.html" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/ChangeLog.html
# mCurl -v -u $env:NEXUS_USER:$env:NEXUS_PASSWD --upload-file bin/release/$env:APP_NAME.zip $env:NEXUS_SERVER/utility/$env:NEXUS_PATH/$version/$env:APP_NAME-$version.zip
# image: mcr.microsoft.com/dotnet/sdk:6.0
stages:
- build
- test
- deploy
UI:build:
@@ -119,33 +117,6 @@ Transfer:build:
script:
- dotnet build LiMan.Transfer/LiMan.Transfer.csproj
UI:test:
stage: test
tags:
- win
only:
- develop
needs: ["UI:build"]
script:
- dotnet test LiMan.UI/LiMan.UI.csproj
API:test:
stage: test
tags:
- win
only:
- develop
needs: ["API:build"]
script:
- dotnet test LiMan.Api/LiMan.Api.csproj
Transfer:test:
stage: test
tags:
- win
needs: ["Transfer:build"]
script:
- dotnet test LiMan.Transfer/LiMan.Transfer.csproj
UI:IIS01:deploy:
stage: deploy
@@ -153,41 +124,54 @@ UI:IIS01:deploy:
- win
only:
- develop
needs: ["UI:test"]
needs: ["UI:build"]
script:
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true LiMan.UI/LiMan.UI.csproj
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true LiMan.UI/LiMan.UI.csproj
- *zipper
- *hashBuild
- *nexusUpload
API:IIS01:deploy:
stage: deploy
tags:
- win
variables:
APP_NAME: 'LiMan.Api'
only:
- develop
needs: ["API:test"]
needs: ["API:build"]
script:
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true LiMan.Api/LiMan.Api.csproj
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true LiMan.Api/LiMan.Api.csproj
- *zipper
- *hashBuild
- *nexusUpload
UI:IIS02:deploy:
UI:IIS04:deploy:
stage: deploy
tags:
- win
only:
- main
needs: ["UI:build"]
script:
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true LiMan.UI/LiMan.UI.csproj
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true LiMan.UI/LiMan.UI.csproj
API:IIS02:deploy:
script:
- dotnet publish -p:PublishProfile=IIS04.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true LiMan.UI/LiMan.UI.csproj
- *zipper
- *hashBuild
- *nexusUpload
API:IIS04:deploy:
stage: deploy
tags:
- win
variables:
APP_NAME: 'LiMan.Api'
only:
- main
needs: ["API:build"]
script:
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true LiMan.Api/LiMan.Api.csproj
- dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true LiMan.Api/LiMan.Api.csproj
script:
- dotnet publish -p:PublishProfile=IIS04.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true LiMan.Api/LiMan.Api.csproj
- *zipper
- *hashBuild
- *nexusUpload
Transfer:deploy:
stage: deploy
@@ -195,8 +179,9 @@ Transfer:deploy:
- win
variables:
APP_NAME: LiMan.Transfer
needs: ["Transfer:test"]
needs: ["Transfer:build"]
script:
- dotnet build LiMan.Transfer/LiMan.Transfer.csproj
- dotnet publish -p:PublishProfile=SingleFileX86.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release LiMan.Transfer/LiMan.Transfer.csproj
- *zipper
- *hashBuild
+1 -1
View File
@@ -10,7 +10,7 @@
"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",
"program": "${workspaceFolder}/LiMan.UI/bin/Debug/net6.0/LiMan.UI.dll",
"args": [],
"cwd": "${workspaceFolder}/LiMan.UI",
"stopAtEntry": false,
+6
View File
@@ -1,4 +1,5 @@
using System;
using static Core.Enum;
namespace Core.DTO
{
@@ -36,6 +37,11 @@ namespace Core.DTO
/// </summary>
public int IdxLic { get; set; } = 0;
/// <summary>
/// Tipologia di ticket
/// </summary>
public TipologiaTicket TType { get; set; } = TipologiaTicket.Licenze;
/// <summary>
/// IDX licenza child (opzionale)
/// </summary>
+43 -40
View File
@@ -1,53 +1,56 @@
namespace Core
{
/// <summary>
/// Stato richieste x workflow interno
/// </summary>
public enum StatoRichiesta
public class Enum
{
ND = 0,
/// <summary>
/// Stato richieste x workflow interno
/// </summary>
public enum StatoRichiesta
{
ND = 0,
Richiesta,
Richiesta,
Valutazione,
Valutazione,
Approvata,
Approvata,
Rifiutata
}
Rifiutata
}
public enum TipoLicenza
{
ND = 0,
public enum TipoLicenza
{
ND = 0,
/// <summary>
/// Licenza LEgacy Steamware
/// </summary>
GLS,
/// <summary>
/// Master Key License, che ha una data di scadenza globale ed un token = numero di utenti/token massimi associati
/// </summary>
MasterKey,
/// <summary>
/// UserKey License (licenza che consuma un token utente della licenza master) - es GPW
/// </summary>
UserKey,
/// <summary>
/// Chiave tiupo Checksum basata su licenza masster + checksum MD5 di una serie di dati (child licenses)
/// </summary>
CheckSumKey
}
/// <summary>
/// Licenza LEgacy Steamware
/// Tipologia di ticket
/// </summary>
GLS,
/// <summary>
/// Master Key License, che ha una data di scadenza globale ed un token = numero di utenti/token massimi associati
/// </summary>
MasterKey,
/// <summary>
/// UserKey License (licenza che consuma un token utente della licenza master) - es GPW
/// </summary>
UserKey,
/// <summary>
/// Chiave tiupo Checksum basata su licenza masster + checksum MD5 di una serie di dati (child licenses)
/// </summary>
CheckSumKey
}
/// <summary>
/// Tipologia di ticket
/// </summary>
public enum TipologiaTicket
{
ND = 0,
Licenze,
FileUpload
public enum TipologiaTicket
{
ND = 0,
Licenze,
FileUpload
}
}
}
+153
View File
@@ -0,0 +1,153 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
namespace Core
{
/// <summary>
/// Init classe validatore
/// </summary>
public class MachineDataValidator
{
#region Public Constructors
/// <summary>
/// Init classe validatore
/// </summary>
/// <param name="currMachineData"></param>
public MachineDataValidator(string rawData)
{
// inizializzo info di base
Dictionary<string, string> currMachineData = new Dictionary<string, string>();
if (!string.IsNullOrEmpty(rawData))
{
try
{
currMachineData = JsonConvert.DeserializeObject<Dictionary<string, string>>(rawData);
}
catch(Exception exc)
{ }
}
machTestData = currMachineData;
}
#endregion Public Constructors
#region Public Properties
/// <summary>
/// Restituisce HASH del codice impiego = payload utente
/// </summary>
/// <returns></returns>
public string machineKeyHash
{
get => calcMachineHash();
}
#endregion Public Properties
#region Private Fields
/// <summary>
/// Dati rispetto cui fare i calcoli di validazione
/// </summary>
private Dictionary<string, string> machTestData = new Dictionary<string, string>();
#endregion Private Fields
#region Private Methods
/// <summary>
/// Calcola HASH del codice impiego = payload utente
/// </summary>
/// <returns></returns>
private string calcMachineHash()
{
string hash = "";
string buffData = currBaseBuffer();
if (!string.IsNullOrEmpty(buffData))
{
// hashing!
using (var hAlgo = SHA512.Create())
//using (var hAlgo = MD5.Create())
{
byte[] InputBytes = Encoding.UTF8.GetBytes(buffData);
var byteHash = hAlgo.ComputeHash(InputBytes);
hash = BitConverter.ToString(byteHash).Replace("-", "").Replace("/", "").Replace("\\", "").ToLowerInvariant();
}
}
return hash;
}
public bool hasValidData
{
get => machTestData != null && machTestData.Count > 0;
}
/// <summary>
/// Calcola hash key da info PC
/// </summary>
/// <returns></returns>
private string currBaseBuffer()
{
string answ = "????????????????????????????????????????????";
StringBuilder sb = new StringBuilder();
try
{
// calcolo hashKey da alcuni valori solamente
sb.Append($"{machTestData["SystemName"]}|");
sb.Append($"{machTestData["ProcessorId"]}|");
sb.Append($"{machTestData["PartNumber"]}|");
sb.Append($"{machTestData["MACAddress"]}|");
sb.Append($"{machTestData["SerialNumber"]}|");
sb.Append($"{machTestData["OSArchitecture"]}|");
sb.Append($"{machTestData["SoftwareElementID"]}|");
sb.Append($"{machTestData["SystemBiosMajorVersion"]}|");
sb.Append($"{machTestData["SystemBiosMinorVersion"]}|");
sb.Append($"{machTestData["CpuVersion"]}|");
sb.Append($"{machTestData["BiosVersion"]}|");
if (sb.Length > 0)
{
answ = sb.ToString();
// lo uso 2 volte dritto e reverse...
answ += ReverseString(sb.ToString());
}
}
catch
{ }
return answ;
}
/// <summary>
/// Recupera info da dictionary
/// </summary>
/// <param name="keyName"></param>
/// <returns></returns>
private string getDictVal(string keyName)
{
string answ = $"{keyName}{keyName}";
if (machTestData.ContainsKey(keyName))
{
answ = machTestData[keyName];
}
return answ;
}
/// <summary>
/// Esegue reverse delal stringa
/// </summary>
/// <param name="myStr"></param>
/// <returns></returns>
private string ReverseString(string myStr)
{
char[] myArr = myStr.ToCharArray();
Array.Reverse(myArr);
return new string(myArr);
}
#endregion Private Methods
}
}
+2 -1
View File
@@ -5,6 +5,7 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Core.Enum;
namespace Core
{
@@ -37,7 +38,7 @@ namespace Core
{ }
/// <summary>
/// Istanzia un nuovo ogetto richeista supporto
/// Istanzia un nuovo ogetto richiesta supporto
/// </summary>
/// <param name="codApp">Codice Applicazione (es EBW-UP)</param>
/// <param name="codImp">Codice Impegno (es codice chiave HW)</param>
+2 -2
View File
@@ -3,8 +3,8 @@
public class UploadResult
{
public bool Uploaded { get; set; }
public string? FileName { get; set; }
public string? StoredFileName { get; set; }
public string FileName { get; set; } = "";
public string StoredFileName { get; set; } = "";
public int ErrorCode { get; set; }
}
}
+2 -4
View File
@@ -32,10 +32,8 @@ namespace Core
plainAuthKey = SteamCrypto.DecryptString(authKey, passPhrase); // uso combinazione cliente+applicativo come passphrase!
answ = Convert.ToDateTime(plainAuthKey.Replace(string.Format("{0}#{1}-", cliente, applicativo.PadLeft(20, '-')), "").Replace(string.Format("%{0}%", licenze), ""));
}
catch (Exception exc)
{
//logger.lg.scriviLog(string.Format("Errore decodifica auth key:{0}AuthKey: {1}{0}cliente:{2}{0}applicativo:{3}{0}errore:{4}", Environment.NewLine, authKey, cliente, applicativo, exc), tipoLog.EXCEPTION);
}
catch
{ }
return answ;
}
File diff suppressed because one or more lines are too long
@@ -56,7 +56,7 @@ namespace LiMan.APi.Controllers
/// </summary>
// POST api/attivazioni/removeKey
[HttpPost("removeKey")]
public async Task<bool> Delete([FromBody] UserLicenseRequest CurrRequest)
public async Task<bool> removeKey([FromBody] UserLicenseRequest CurrRequest)
{
bool done = await dataService.AttivazioniDelete(CurrRequest.MasterKey, CurrRequest.ParamDict);
// se ho qualcosa da loggare...
+1 -1
View File
@@ -220,7 +220,7 @@ namespace LiMan.APi.Controllers
/// Caricamento file effettivo via POST
/// </summary>
/// <param name="ticketId">TicketId x riferimento</param>
/// <param name="files">Elenco files da caricare</param>
/// <param name="file">Elenco files da caricare</param>
/// <returns></returns>
[HttpPost("single")]
public async Task<ActionResult<UploadResult>> PostSingleFile([FromForm] int ticketId, [FromForm] IFormFile file)
+81
View File
@@ -0,0 +1,81 @@
using LiMan.APi.Data;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace LiMan.APi.Controllers
{
/// <summary>
/// Controller livello Health
/// </summary>
[Route("api/health")]
[ApiController]
public class HealthController : ControllerBase
{
#region Private Fields
/// <summary>
/// Classe per logging
/// </summary>
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Public Constructors
/// <summary>
/// Init generico
/// </summary>
/// <param name="DataService"></param>
public HealthController(ApiDataService DataService)
{
dataService = DataService;
Log.Info("Avviata classe HealthController");
}
#endregion Public Constructors
#region Protected Properties
/// <summary>
/// Dataservice x accesso DB
/// </summary>
protected ApiDataService dataService { get; set; }
#endregion Protected Properties
#region Public Methods
/// GET api/health
/// <summary>
/// Recupera elenco applicativi dati cliente
/// </summary>
/// <returns></returns>
[HttpGet]
public async Task<string> Get()
{
await Task.Delay(1);
return "OK";
}
/// GET api/health/id
/// <summary>
/// Restituisce info riguardo allo stato di salute di un servizio
/// </summary>
/// <param name="id">Tipo di servizio: db/redis/...</param>
/// <returns></returns>
[HttpGet("{id}")]
public async Task<string> Get(string id)
{
string result = "NA";
await Task.Delay(1);
return result;
}
#endregion Public Methods
}
}
+184 -24
View File
@@ -1,11 +1,13 @@
using Core;
using LiMan.APi.Data;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LiMan.APi.Controllers
@@ -17,48 +19,35 @@ namespace LiMan.APi.Controllers
[ApiController]
public class LicenzaController : ControllerBase
{
#region Private Fields
/// <summary>
/// Classe per logging
/// </summary>
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Public Constructors
/// <summary>
/// Init generico
/// Init Controller Licenze
/// </summary>
/// <param name="configuration"></param>
/// <param name="emailSender"></param>
/// <param name="DataService"></param>
public LicenzaController(ApiDataService DataService)
public LicenzaController(IConfiguration configuration, IEmailSender emailSender, ApiDataService DataService)
{
_configuration = configuration;
_emailSender = emailSender;
dataService = DataService;
Log.Info("Avviata classe LicenzaController");
}
#endregion Public Constructors
#region Protected Properties
/// <summary>
/// Dataservice x accesso DB
/// </summary>
protected ApiDataService dataService { get; set; }
#endregion Protected Properties
#region Public Methods
/// GET api/licenza/id
/// <summary>
/// Recupera dati Licenza Applicativa (id licenza + num utenze) dati cliente + programma + licenza ATTUALE
///
/// </summary>
/// <param name="id">Codice cliente/Installazione</param>
/// <param name="CodApp">Codice Applicazione</param>
/// <param name="CodApp">Codice Applicazione</param>
/// <param name="Chiave">Chiave licenza da validare</param>
/// <returns></returns>
// GET api/licenza/id?CodApp=xxx&Chiave=yyyy
[HttpGet("{id}")]
public async Task<List<DB.DTO.ApplicativoDTO>> Get(string id, string CodApp, string Chiave)
{
@@ -67,9 +56,60 @@ namespace LiMan.APi.Controllers
return result;
}
/// <summary>
/// Effettua verifica scadenze licenze secondo 3 livelli dati da diversi orizzonti temporali
/// - urgente: entro 1 settimana
/// - importante: entro 1 mese
/// - info: entro 2 mesi
/// </summary>
/// <returns></returns>
[HttpGet("CheckScadenze")]
public async Task<string> Get()
{
// oggetti base
string answ = "ND";
string msgBody = "";
StringBuilder sbMain = new StringBuilder();
StringBuilder sbActions = new StringBuilder();
StringBuilder sbAllProj = new StringBuilder();
// orizzonti da valutare
DateTime oggi = DateTime.Today;
doLog("Esito della verifica Licenze (scadute/in scadenza)", logType.info, ref sbMain);
// verifico quelle GIA' SCADUTE (< oggi)
List<DB.DTO.ApplicativoDTO> elencoScadute = await dataService.LicenzeExpiring(DateTime.MinValue, oggi);
List<DB.DTO.ApplicativoDTO> elencoWeek = await dataService.LicenzeExpiring(oggi, oggi.AddDays(8));
List<DB.DTO.ApplicativoDTO> elencoMonth = await dataService.LicenzeExpiring(oggi.AddDays(8), oggi.AddDays(1).AddMonths(1));
List<DB.DTO.ApplicativoDTO> elencoTrim = await dataService.LicenzeExpiring(oggi.AddDays(1).AddMonths(1), oggi.AddDays(1).AddMonths(3));
int numScadute = elencoScadute.Count;
int numWeek = elencoWeek.Count;
int numMonth = elencoMonth.Count;
int numTrim = elencoTrim.Count;
// display scadute scadute...
msgBody += formatCheckPeriodo(elencoScadute, "Licenze <b>SCADUTE</b>", "font-size: 1.3em; color: #D62424;");
msgBody += formatCheckPeriodo(elencoWeek, "Licenze in scadenza nella <b>SETTIMANA</b>", "font-size: 1.2em; color: #DF701C;");
msgBody += formatCheckPeriodo(elencoMonth, "Licenze in scadenza nel <b>MESE</b>", "font-size: 1.15em; color: #A99C45;");
msgBody += formatCheckPeriodo(elencoTrim, "Licenze in scadenza nel <b>TRIMESTRE</b>", "font-size: 1.1em; color: #9Dc935;");
// predispongo email
string msgTopic = "LiMan: verifica Licenze in scadenza";
// invio email
await sendEmail(msgTopic, msgBody.Replace($"{Environment.NewLine}", "<br/>"));
// ritorno solo LOG azioni
answ = $"Scadute {numScadute} | Settimana: {numWeek} | Mese: {numMonth} | Trimestre: {numTrim}";
return answ;
}
/// POST api/licenza
/// <summary>
/// Recupera dati Licenza Applicativa (id licenza + num utenze) dati cliente + programma + licenza ATTUALE
/// Recupera dati Licenza Applicativa (id licenza + num utenze) dati cliente + programma +
/// licenza ATTUALE
/// </summary>
/// <param name="AppInfo">Info licenza in formato LicenseCoord</param>
/// <returns></returns>
@@ -95,5 +135,125 @@ namespace LiMan.APi.Controllers
}
#endregion Public Methods
#region Protected Enums
protected enum logType
{
none,
local,
trace,
info,
warn
}
#endregion Protected Enums
#region Protected Properties
/// <summary>
/// Dataservice x accesso DB
/// </summary>
protected ApiDataService dataService { get; set; }
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// Effettua log del tipo richiesto aggiungendo riga anche allo stringbuilder indicato
/// </summary>
/// <param name="message"></param>
/// <param name="tipoLog"></param>
/// <param name="currSB"></param>
protected void doLog(string message, logType tipoLog, ref StringBuilder currSB)
{
bool doLine = true;
switch (tipoLog)
{
case logType.info:
Log.Info(message);
break;
case logType.trace:
Log.Trace(message);
break;
case logType.warn:
Log.Warn(message);
break;
case logType.local:
break;
default:
case logType.none:
doLine = false;
break;
}
if (doLine)
{
currSB.AppendLine(message);
}
else
{
currSB.Append(message);
}
}
protected string formatCheckPeriodo(List<DB.DTO.ApplicativoDTO> elencoLicenze, string tipoVerifica, string titleStyle)
{
StringBuilder sbMain = new StringBuilder();
doLog($"<div style=\"{titleStyle}\">", logType.none, ref sbMain);
int numScadute = elencoLicenze.Count;
doLog($"{tipoVerifica}: <b>{numScadute}</b>", logType.info, ref sbMain);
doLog("<div style=\"font-size: 1em; color: black;\">", logType.none, ref sbMain);
if (elencoLicenze.Count == 0)
{
doLog($"&nbsp;- nessuna", logType.info, ref sbMain);
}
else {
foreach (var item in elencoLicenze)
{
doLog($"&nbsp;- {item.Scadenza:yyyy.MM.dd} | <b>{item.CodInst}</b> | {item.Descrizione}", logType.info, ref sbMain);
}
}
doLog("</div>", logType.none, ref sbMain);
doLog("</div>", logType.none, ref sbMain);
return sbMain.ToString();
}
protected async Task sendEmail(string subject, string message)
{
string emailRaw = _configuration["MailDest:ExpiryNotify"];
List<string> emailDestList = emailRaw.Split(",").ToList();
foreach (var dest in emailDestList)
{
try
{
await _emailSender.SendEmailAsync(dest, subject, message);
}
catch(Exception exc)
{
Log.Error($"Eccezione durante invio email:{Environment.NewLine}dest: {dest} | subject {subject}{Environment.NewLine}{exc}");
}
}
}
#endregion Protected Methods
#region Private Fields
/// <summary>
/// Classe per logging
/// </summary>
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private readonly IEmailSender _emailSender;
private IConfiguration _configuration;
#endregion Private Fields
}
}
File diff suppressed because it is too large Load Diff
+8 -1
View File
@@ -6,16 +6,23 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>C:\Users\samuele\source\repos\LiManApp\LiMan.Api\LiMan.APi.xml</DocumentationFile>
<Optimize>true</Optimize>
<Optimize>False</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<Optimize>True</Optimize>
<DebugType>none</DebugType>
</PropertyGroup>
<ItemGroup>
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS03.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS04.pubxml" />
</ItemGroup>
<ItemGroup>
<None Include="Properties\PublishProfiles\IIS01.pubxml.user" />
<None Include="Properties\PublishProfiles\IIS02.pubxml.user" />
<None Include="Properties\PublishProfiles\IIS04.pubxml.user" />
<None Include="Properties\PublishProfiles\IIS03.pubxml.user" />
</ItemGroup>
+3 -3
View File
@@ -154,7 +154,7 @@
Caricamento file effettivo via POST
</summary>
<param name="ticketId">TicketId x riferimento</param>
<param name="files">Elenco files da caricare</param>
<param name="file">Elenco files da caricare</param>
<returns></returns>
</member>
<member name="T:LiMan.APi.Controllers.InstallazioniController">
@@ -560,7 +560,7 @@
</member>
<member name="M:LiMan.APi.Data.ApiDataService.TicketAdd(Core.SupportRequest)">
<summary>
Esegue aggiunta Ticket richeisto + restitusice aperti x cliente
Esegue aggiunta Ticket richiesto + restitusice aperti x cliente
</summary>
<param name="currRequest"></param>
<returns></returns>
@@ -576,7 +576,7 @@
<param name="numRec"></param>
<returns></returns>
</member>
<member name="M:LiMan.APi.Data.ApiDataService.TicketUpdateState(System.Int32,Core.StatoRichiesta)">
<member name="M:LiMan.APi.Data.ApiDataService.TicketUpdateState(System.Int32,Core.Enum.StatoRichiesta)">
<summary>
Aggiornamentos tato ticket
</summary>
@@ -7,6 +7,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile />
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAk75miMJLMkCTEelQutKpbwAAAAACAAAAAAADZgAAwAAAABAAAADyvXRKpxfDWrEi+5cXyVPMAAAAAASAAACgAAAAEAAAAMRndt7QRE05+xDzpFe1wWwYAAAAfM5H5MJhxE4ciNpDlKikQFw6IBALwdj0FAAAAI8ZWcD16VBpqPQZ+tg+phFYzX1T</EncryptedPassword>
<History>True|2022-02-04T09:39:26.3565661Z;False|2022-02-04T10:38:16.4000573+01:00;False|2022-02-04T10:31:02.8361162+01:00;False|2022-02-04T10:29:23.4973985+01:00;False|2022-02-04T10:28:21.1773984+01:00;False|2022-02-04T10:25:50.0542905+01:00;False|2022-02-04T10:23:45.1840125+01:00;False|2022-02-04T10:23:24.8448115+01:00;False|2022-02-04T10:22:15.7243050+01:00;False|2022-02-04T10:21:53.7185925+01:00;False|2022-02-04T10:15:28.7942817+01:00;False|2022-02-04T10:12:36.7104601+01:00;True|2022-02-02T11:24:58.6066960+01:00;False|2021-11-16T14:49:02.9625741+01:00;True|2021-11-09T12:19:38.4459836+01:00;True|2021-11-09T12:19:33.2695831+01:00;True|2021-11-09T12:09:32.8676673+01:00;True|2021-11-09T12:09:26.5263401+01:00;True|2021-11-09T12:09:20.3614911+01:00;True|2021-10-15T10:15:10.5127570+02:00;False|2021-10-15T10:13:53.0299219+02:00;False|2021-10-15T08:58:38.3028788+02:00;False|2021-10-15T08:47:48.5789826+02:00;False|2021-10-14T19:32:56.5281204+02:00;False|2021-10-14T19:31:10.1629370+02:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00;</History>
<History>True|2023-02-03T18:35:00.4015320Z;True|2022-02-04T10:39:26.3565661+01:00;False|2022-02-04T10:38:16.4000573+01:00;False|2022-02-04T10:31:02.8361162+01:00;False|2022-02-04T10:29:23.4973985+01:00;False|2022-02-04T10:28:21.1773984+01:00;False|2022-02-04T10:25:50.0542905+01:00;False|2022-02-04T10:23:45.1840125+01:00;False|2022-02-04T10:23:24.8448115+01:00;False|2022-02-04T10:22:15.7243050+01:00;False|2022-02-04T10:21:53.7185925+01:00;False|2022-02-04T10:15:28.7942817+01:00;False|2022-02-04T10:12:36.7104601+01:00;True|2022-02-02T11:24:58.6066960+01:00;False|2021-11-16T14:49:02.9625741+01:00;True|2021-11-09T12:19:38.4459836+01:00;True|2021-11-09T12:19:33.2695831+01:00;True|2021-11-09T12:09:32.8676673+01:00;True|2021-11-09T12:09:26.5263401+01:00;True|2021-11-09T12:09:20.3614911+01:00;True|2021-10-15T10:15:10.5127570+02:00;False|2021-10-15T10:13:53.0299219+02:00;False|2021-10-15T08:58:38.3028788+02:00;False|2021-10-15T08:47:48.5789826+02:00;False|2021-10-14T19:32:56.5281204+02:00;False|2021-10-14T19:31:10.1629370+02:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AllowUntrustedCertificate>true</AllowUntrustedCertificate>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>liman.egalware.com/ELM.API</SiteUrlToLaunchAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<ProjectGuid>34200ca2-489c-435a-a60b-34de7b7ba04d</ProjectGuid>
<SelfContained>false</SelfContained>
<MSDeployServiceURL>https://office.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>liman.egalware.com/ELM.API</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>false</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>true</EnableMSDeployBackup>
<EnableMsDeployAppOffline>true</EnableMsDeployAppOffline>
<UserName>jenkins</UserName>
<_SavePWD>true</_SavePWD>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
</Project>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile />
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAk75miMJLMkCTEelQutKpbwAAAAACAAAAAAADZgAAwAAAABAAAADyvXRKpxfDWrEi+5cXyVPMAAAAAASAAACgAAAAEAAAAMRndt7QRE05+xDzpFe1wWwYAAAAfM5H5MJhxE4ciNpDlKikQFw6IBALwdj0FAAAAI8ZWcD16VBpqPQZ+tg+phFYzX1T</EncryptedPassword>
<History>True|2023-03-14T13:23:13.2505933Z;True|2023-03-14T14:22:47.9125658+01:00;True|2023-02-03T19:35:00.4015320+01:00;True|2022-02-04T10:39:26.3565661+01:00;False|2022-02-04T10:38:16.4000573+01:00;False|2022-02-04T10:31:02.8361162+01:00;False|2022-02-04T10:29:23.4973985+01:00;False|2022-02-04T10:28:21.1773984+01:00;False|2022-02-04T10:25:50.0542905+01:00;False|2022-02-04T10:23:45.1840125+01:00;False|2022-02-04T10:23:24.8448115+01:00;False|2022-02-04T10:22:15.7243050+01:00;False|2022-02-04T10:21:53.7185925+01:00;False|2022-02-04T10:15:28.7942817+01:00;False|2022-02-04T10:12:36.7104601+01:00;True|2022-02-02T11:24:58.6066960+01:00;False|2021-11-16T14:49:02.9625741+01:00;True|2021-11-09T12:19:38.4459836+01:00;True|2021-11-09T12:19:33.2695831+01:00;True|2021-11-09T12:09:32.8676673+01:00;True|2021-11-09T12:09:26.5263401+01:00;True|2021-11-09T12:09:20.3614911+01:00;True|2021-10-15T10:15:10.5127570+02:00;False|2021-10-15T10:13:53.0299219+02:00;False|2021-10-15T08:58:38.3028788+02:00;False|2021-10-15T08:47:48.5789826+02:00;False|2021-10-14T19:32:56.5281204+02:00;False|2021-10-14T19:31:10.1629370+02:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>
+42 -20
View File
@@ -40,19 +40,20 @@ namespace LiMan.Serv
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
if (env.IsDevelopment() || env.IsStaging())
{
app.UseDeveloperExceptionPage();
}
app.UseSwagger(c =>
{
c.RouteTemplate = "/swagger/{documentName}/swagger.json";
});
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("v1/swagger.json", "LiMan.Api");
});
// valido solo in sviluppo
app.UseSwagger(c =>
{
c.RouteTemplate = "/swagger/{documentName}/swagger.json";
});
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("v1/swagger.json", "LiMan.Api");
});
}
app.UseHttpsRedirection();
@@ -60,14 +61,27 @@ namespace LiMan.Serv
app.UseAuthorization();
app.UseFileServer(new FileServerOptions
// verifico da conf se sia linux o windows x file da accedere...
if (Configuration["HostOs"] == "Win")
{
FileProvider = new PhysicalFileProvider(@"\\stor01\TEAM DRIVES\40_FileUpload\unsafe_uploads"),
RequestPath = new PathString("/unsafe_uploads"),
EnableDirectoryBrowsing = true
//EnableDirectoryBrowsing = false
});
app.UseFileServer(new FileServerOptions
{
FileProvider = new PhysicalFileProvider(@"\\stor01\TEAM DRIVES\40_FileUpload\unsafe_uploads"),
RequestPath = new PathString("/unsafe_uploads"),
EnableDirectoryBrowsing = true
//EnableDirectoryBrowsing = false
});
}
else
{
app.UseFileServer(new FileServerOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(env.ContentRootPath, "unsafe_uploads")),
RequestPath = new PathString("/unsafe_uploads"),
EnableDirectoryBrowsing = true
//EnableDirectoryBrowsing = false
});
}
app.UseEndpoints(endpoints =>
{
@@ -89,14 +103,22 @@ namespace LiMan.Serv
// abilitazione x email management con MailKit
services.AddTransient<IEmailSender, MailKitEmailSender>();
// recupero email reversed
string revPwd = Configuration["ExternalProviders:MailKit:SMTP:Password"] ?? "";
string pwd = "";
foreach (char c in revPwd)
{
pwd = c + pwd;
}
services.Configure<MailKitEmailSenderOptions>(options =>
{
options.Host_Address = Configuration["ExternalProviders:MailKit:SMTP:Address"];
options.Host_Port = Convert.ToInt32(Configuration["ExternalProviders:MailKit:SMTP:Port"]);
options.Host_Username = Configuration["ExternalProviders:MailKit:SMTP:Account"];
options.Host_Password = Configuration["ExternalProviders:MailKit:SMTP:Password"];
options.Host_Password = pwd;
options.Sender_EMail = Configuration["ExternalProviders:MailKit:SMTP:SenderEmail"];
options.Sender_Name = Configuration["ExternalProviders:MailKit:SMTP:SenderName"];
options.Host_SecureSocketOptions = MailKit.Security.SecureSocketOptions.Auto;
});
//services.AddStackExchangeRedisCache(options =>
@@ -107,12 +129,12 @@ namespace LiMan.Serv
services.AddControllers()
.AddJsonOptions(c => c.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.Preserve);
services.AddSingleton<ApiDataService>();
services.AddStackExchangeRedisExtensions<NewtonsoftSerializer>((options) =>
{
return Configuration.GetSection("Redis").Get<RedisConfiguration>();
});
services.AddSingleton<ApiDataService>();
}
#endregion Public Methods
+10 -9
View File
@@ -1,11 +1,12 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Environment": "PROD"
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Environment": "PROD",
"HostOs": "Win"
}
+10 -9
View File
@@ -1,11 +1,12 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Environment": "STAG"
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Environment": "STAG",
"HostOs": "Win"
}
+11 -9
View File
@@ -8,25 +8,26 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"LiMan.GLS": "Server=SQLSTEAM;Database=SteamWare_Auth;User ID=sa;Password=keyhammer;integrated security=False;MultipleActiveResultSets=True;App=LiMan.API;",
"LiMan.DB": "Server=SQLSTEAM;Database=LiMan.DB;User ID=sa;Password=keyhammer;integrated security=False;MultipleActiveResultSets=True;App=LiMan.API;",
"LiMan.GLS": "Server=W2019-SQL-STEAM;Database=SteamWare_Auth;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=LiMan.API;",
"LiMan.DB": "Server=W2019-SQL-STEAM;Database=LiMan.DB;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=LiMan.API;",
"Redis": "localhost:6379,DefaultDatabase=13"
},
"ExternalProviders": {
"MailKit": {
"SMTP": {
"Address": "smtp.gmail.com",
"Port": "465",
"Account": "steamwarebot@gmail.com",
"Password": "drmfsls16",
"SenderEmail": "steamwarebot@gmail.com",
"Address": "smtp-mail.outlook.com",
"Port": "587",
"Account": "steamwarebot@outlook.it",
"Password": "!39elanoizaNaiVnIomais",
"SenderEmail": "steamwarebot@outlook.it",
"SenderName": "Steamware Email BOT"
}
}
},
"MailDest": {
"Admin": "samuele@steamware.net",
"ProcOp": "ceo@steamware.net"
"ExpiryNotify": "samuele.locatelli@egalware.com,mara.baroni@egalware.com",
"TicketNotify": "samuele.locatelli@egalware.com, info@egalware.com"
},
"Redis": {
"Password": "",
@@ -43,5 +44,6 @@
"Database": 14
},
"FileShare": "\\\\stor01\\TEAM DRIVES\\40_FileUpload\\unsafe_uploads",
"ApiUrl": "https://liman.egalware.com/"
"ApiUrl": "https://liman.egalware.com/",
"HostOs": "Win"
}
+129 -36
View File
@@ -12,18 +12,12 @@ using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using static Core.Enum;
namespace LiMan.DB.Controllers
{
public class DbController : IDisposable
{
#region Private Fields
private static IConfiguration _configuration;
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Public Constructors
public DbController(IConfiguration configuration)
@@ -269,12 +263,13 @@ namespace LiMan.DB.Controllers
localDbCtx.Entry(currData).State = EntityState.Modified;
// salvo
localDbCtx.SaveChanges();
// true
// true
fatto = true;
}
}
return fatto;
}
public bool DbForceMigrate()
{
bool answ = false;
@@ -287,7 +282,7 @@ namespace LiMan.DB.Controllers
}
catch (Exception exc)
{
Log.Error($"Eccezione in DbForceMigrate");
Log.Error($"Eccezione in DbForceMigrate{Environment.NewLine}{exc}");
}
}
return answ;
@@ -367,6 +362,100 @@ namespace LiMan.DB.Controllers
return dbResult;
}
/// <summary>
/// Elenco applicativi in scadenza nel periodo considerato (min-max)
/// </summary>
/// <param name="minDate">Data iniziale da considerare</param>
/// <param name="maxDate">Data finale da considerare</param>
/// <returns></returns>
public List<ApplicativoDTO> GetApplicativiExpiring(DateTime minDate, DateTime maxDate)
{
// cerco solo applicativi attivi
bool hideData = true;
List<ApplicativoDTO> dbResult = new List<ApplicativoDTO>();
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
{
DateTime oggi = DateTime.Today;
// generazione stringhe casuali.... https://jonathancrozier.com/blog/how-to-generate-a-random-string-with-c-sharp
StringBuilder sbRandChiave = new StringBuilder();
StringBuilder sbRandEnigma = new StringBuilder();
StringBuilder sbRandPayload = new StringBuilder();
string stdChiave = "";
string stdEnigma = "";
string stdPayLoad = "";
int stdIdxLic = 0;
DateTime stdDataEnigma = DateTime.Today;
if (hideData)
{
int numChar = 80;
Random random = new Random();
// idxLic
stdIdxLic = random.Next(50000, 100000);
// chiave random
for (int i = 0; i < numChar; i++)
{
// Generate floating point numbers
double myFloat = random.NextDouble();
// Generate the char using below logic
var myChar = Convert.ToChar(Convert.ToInt32(Math.Floor(25 * myFloat) + 65));
sbRandChiave.Append(myChar);
}
stdChiave = $"{sbRandChiave}";
// random data enigma
stdDataEnigma = DateTime.Today.AddDays(random.Next(0, 15));
// random enigma
for (int i = 0; i < numChar; i++)
{
// Generate floating point numbers
double myFloat = random.NextDouble();
// Generate the char using below logic
var myChar = Convert.ToChar(Convert.ToInt32(Math.Floor(25 * myFloat) + 65));
sbRandEnigma.Append(myChar);
}
stdEnigma = $"{sbRandEnigma}";
// random payload
for (int i = 0; i < numChar; i++)
{
// Generate floating point numbers
double myFloat = random.NextDouble();
// Generate the char using below logic
var myChar = Convert.ToChar(Convert.ToInt32(Math.Floor(25 * myFloat) + 65));
sbRandPayload.Append(myChar);
}
stdPayLoad = $"{sbRandPayload}";
}
// calcolo DTO applicativi
dbResult = localDbCtx
.DbSetLicenze
.Where(x => (x.Scadenza >= minDate && x.Scadenza < maxDate))
.OrderBy(o => o.Scadenza)
.Select(x => new ApplicativoDTO()
{
IdxLic = hideData ? stdIdxLic : x.IdxLic,
Chiave = hideData ? stdChiave : x.Chiave,
CodApp = x.CodApp,
CodInst = x.CodInst,
Descrizione = x.Descrizione,
Tipo = x.Tipo,
Scadenza = x.Scadenza,
NumLicenze = x.NumLicenze,
NumLicenzeAttive = -1,
DataEnigma = hideData ? stdDataEnigma : x.DataEnigma,
Enigma = hideData ? stdEnigma : x.Enigma,
Payload = hideData ? stdPayLoad : x.Payload
})
.ToList();
}
return dbResult;
}
public List<ApplicativoDTO> GetApplicativiFilt(bool OnlyActive, string CodApp, string CodInst, bool hideData)
{
List<ApplicativoDTO> dbResult = new List<ApplicativoDTO>();
@@ -374,8 +463,7 @@ namespace LiMan.DB.Controllers
{
DateTime oggi = DateTime.Today;
// generazione stringhe casuali....
// https://jonathancrozier.com/blog/how-to-generate-a-random-string-with-c-sharp
// generazione stringhe casuali.... https://jonathancrozier.com/blog/how-to-generate-a-random-string-with-c-sharp
StringBuilder sbRandChiave = new StringBuilder();
StringBuilder sbRandEnigma = new StringBuilder();
StringBuilder sbRandPayload = new StringBuilder();
@@ -485,8 +573,7 @@ namespace LiMan.DB.Controllers
DateTime oggi = DateTime.Today;
int stdIdxLic = 0;
// generazione stringhe casuali....
// https://jonathancrozier.com/blog/how-to-generate-a-random-string-with-c-sharp
// generazione stringhe casuali.... https://jonathancrozier.com/blog/how-to-generate-a-random-string-with-c-sharp
StringBuilder sbRandChiave = new StringBuilder();
string stdChiave = "";
@@ -554,8 +641,7 @@ namespace LiMan.DB.Controllers
DateTime oggi = DateTime.Today;
int stdIdxLic = 0;
// generazione stringhe casuali....
// https://jonathancrozier.com/blog/how-to-generate-a-random-string-with-c-sharp
// generazione stringhe casuali.... https://jonathancrozier.com/blog/how-to-generate-a-random-string-with-c-sharp
StringBuilder sbRandChiave = new StringBuilder();
string stdChiave = "";
@@ -886,7 +972,6 @@ namespace LiMan.DB.Controllers
List<TicketDTO> dbResult = new List<TicketDTO>();
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
{
dbResult = localDbCtx
.DbSetTicket
.Where(x => (x.Status <= StatoRichiesta.Valutazione || !onlyOpen))
@@ -963,10 +1048,9 @@ namespace LiMan.DB.Controllers
List<TicketDTO> dbResult = new List<TicketDTO>();
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
{
dbResult = localDbCtx
.DbSetTicket
.Where(x => (x.Status <= StatoRichiesta.Valutazione || !onlyOpen) && (x.LicenzaNav.CodApp == CodApp || string.IsNullOrEmpty(CodApp)) && (x.LicenzaNav.CodInst == CodInst || string.IsNullOrEmpty(CodInst)))
.Where(x => (x.Status <= StatoRichiesta.Valutazione || !onlyOpen) && (x.LicenzaNav.CodApp == CodApp || string.IsNullOrEmpty(CodApp)) && (x.LicenzaNav.CodInst == CodInst || string.IsNullOrEmpty(CodInst)))
.OrderByDescending(x => x.IdxTicket)
.Include(l => l.LicenzaNav)
.Select(x => new TicketDTO
@@ -986,7 +1070,8 @@ namespace LiMan.DB.Controllers
SupplAnsw = x.SupplAnsw,
SupplEmail = x.SupplEmail,
SupplUserCode = x.SupplUserCode,
Tipo = x.Tipo
Tipo = x.Tipo,
TType = x.TType
})
.ToList();
}
@@ -1033,6 +1118,7 @@ namespace LiMan.DB.Controllers
}
return dbResult;
}
public bool TicketUpdateState(int IdxTicket, StatoRichiesta NewStatus)
{
bool fatto = false;
@@ -1053,23 +1139,6 @@ namespace LiMan.DB.Controllers
return fatto;
}
#if false
public List<TicketModel> TicketGetByLic(int IdxLic, int maxNum)
{
List<TicketModel> dbResult = new List<TicketModel>();
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
{
dbResult = localDbCtx
.DbSetTicket
.Where(x => x.IdxLic == IdxLic)
.OrderByDescending(x => x.DtReq)
.Take(maxNum)
.ToList();
}
return dbResult;
}
#endif
public bool UpsertApplicazione(ApplicativoModel updItem)
{
bool done = false;
@@ -1224,5 +1293,29 @@ namespace LiMan.DB.Controllers
}
#endregion Public Methods
#region Private Fields
private static IConfiguration _configuration;
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#if false
public List<TicketModel> TicketGetByLic(int IdxLic, int maxNum)
{
List<TicketModel> dbResult = new List<TicketModel>();
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
{
dbResult = localDbCtx
.DbSetTicket
.Where(x => x.IdxLic == IdxLic)
.OrderByDescending(x => x.DtReq)
.Take(maxNum)
.ToList();
}
return dbResult;
}
#endif
}
}
+1
View File
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static Core.Enum;
#nullable disable
+1
View File
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static Core.Enum;
#nullable disable
+1
View File
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static Core.Enum;
#nullable disable
+1
View File
@@ -2,6 +2,7 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static Core.Enum;
#nullable disable
+1
View File
@@ -5,6 +5,7 @@ using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Core.Enum;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
+1
View File
@@ -5,6 +5,7 @@ using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Core.Enum;
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
+1 -1
View File
@@ -42,7 +42,7 @@ namespace LiMan.GLS.Controllers
}
catch (Exception exc)
{
Log.Error($"Eccezione in DbForceMigrate");
Log.Error($"Eccezione in DbForceMigrate{Environment.NewLine}{exc}");
}
}
return answ;
+5 -1
View File
@@ -7,9 +7,13 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog" Version="4.7.13" />
<PackageReference Include="NLog" Version="4.7.14" />
<PackageReference Include="RestSharp" Version="106.15.0" />
<PackageReference Include="RestSharp.Serializers.NewtonsoftJson" Version="106.15.0" />
</ItemGroup>
+2 -1
View File
@@ -6,6 +6,7 @@ using RestSharp;
using RestSharp.Serializers.NewtonsoftJson;
using System;
using System.Diagnostics;
using static Core.Enum;
namespace MyApp // Note: actual namespace depends on the project name.
{
@@ -113,7 +114,7 @@ namespace MyApp // Note: actual namespace depends on the project name.
var client = new RestClient(apiUrl);
client.UseNewtonsoftJson();
SupportRequest newSuppReq = new SupportRequest();
SupportRequest? newSuppReq = new SupportRequest();
string rawData = "";
if (File.Exists(fileName))
{
@@ -1,18 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\publish\net6.0\win-x86\</PublishDir>
<PublishDir>bin\publish\net6.0\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0</TargetFramework>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<PublishSingleFile>True</PublishSingleFile>
<PublishReadyToRun>True</PublishReadyToRun>
<PublishTrimmed>False</PublishTrimmed>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>
+1 -1
View File
@@ -11,7 +11,7 @@ Sintassi
L'applicativo si occupa delal fase di
* generazione ticket richeista invio
* generazione ticket richiesta invio
* invio singoli files ZIP su piattaforma
E' necessario chiamarlo indicando 2 parametri:
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>License Manager</i>
<h4>Versione: 1.1.2202.0915</h4>
<h4>Versione: 1.1.2311.0611</h4>
<br />
Note di rilascio:
<ul>
+1 -1
View File
@@ -1 +1 @@
1.1.2202.0915
1.1.2311.0611
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.1.2202.0915</version>
<version>1.1.2311.0611</version>
<url>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.Transfer.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+3 -1
View File
@@ -1,4 +1,6 @@
namespace Core
using static Core.Enum;
namespace Core
{
public class TicketDTO
{
+101 -70
View File
@@ -1,79 +1,110 @@
<div class="card">
<div class="card-header bg-info py-1 text-light">
<h3>Attivazioni</h3>
</div>
<div class="card-body bg-light p-1">
<table class="table table-sm table-striped table-responsive-lg">
<thead>
<tr>
<th>
<button type="button" class="btn btn-sm btn-warning btn-block" value="Cancel" @onclick="close"><i class="fas fa-times"></i></button>
</th>
<th>#</th>
<th>Impiego</th>
<th>
Chiave &nbsp;
@if (showKey)
{
<button type="button" class="btn btn-sm btn-warning" @onclick="() => showDecrypt()"><i class="fas fa-eye-slash"></i></button>
}
else
{
<button type="button" class="btn btn-sm btn-success" @onclick="() => showDecrypt()"><i class="fas fa-eye"></i></button>
}
</th>
<th>Scadenza Veto</th>
<th class="text-right"><i class="fas fa-user-lock"></i></th>
<th class="text-right"><i class="fas fa-exclamation-triangle"></i></th>
</tr>
</thead>
<tbody>
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(record.IdxLic)">
<td class="text-nowrap">
<button class="btn btn-sm btn-info" @onclick="() => UnLock(record)" title="Edit record">
<i class="oi oi-lock-unlocked"></i>
</button>
</td>
<td>
<b>@record.IdxSubLic</b>
</td>
<td>
@record.CodImpiego
</td>
<td>
<div class="card-header bg-info py-1 text-light">
<div class="row">
<div class="col-4">
<h3>Attivazioni</h3>
</div>
<div class="col-4">
</div>
<div class="col-4">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#machKeyGen">
Show Machine KeyGen <i class="fas fa-key"></i>
</button>
</div>
</div>
</div>
<div class="card-body bg-light p-1">
<div class="modal" id="machKeyGen">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Machine Key Generator</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<div class="modal-body">
<MachineKeyGen></MachineKeyGen>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<table class="table table-sm table-striped table-responsive-lg">
<thead>
<tr>
<th>
<button type="button" class="btn btn-sm btn-warning btn-block" value="Cancel" @onclick="close"><i class="fas fa-times"></i></button>
</th>
<th>#</th>
<th>Impiego</th>
<th>
Chiave &nbsp;
@if (showKey)
{
<span class="text-success">@decryptAuthKey(record.Chiave)</span>
<button type="button" class="btn btn-sm btn-warning" @onclick="() => showDecrypt()"><i class="fas fa-eye-slash"></i></button>
}
else
{
@record.Chiave
<button type="button" class="btn btn-sm btn-success" @onclick="() => showDecrypt()"><i class="fas fa-eye"></i></button>
}
</td>
<td>
<span class="@cssScadenza(record.VetoUnlock)">@($"{record.VetoUnlock:yyyy.MM.dd}")</span>
</td>
<td class="text-right">
@if (record.Locked)
{
<span aria-hidden="true" title="Licenza Bloccata"><i class="fas fa-lock text-danger"></i></span>
}
else
{
<span aria-hidden="true" title="Licenza Libera"><i class="fas fa-unlock-alt text-success"></i></span>
}
</td>
<td class="text-right">
@if (!record.Locked)
{
<button title="Elimina Licenza" class="btn btn-sm btn-danger" @onclick="() => Remove(record)"><i class="fas fa-trash"></i></button>
}
</td>
</th>
<th>Scadenza Veto</th>
<th class="text-right"><i class="fas fa-user-lock"></i></th>
<th class="text-right"><i class="fas fa-exclamation-triangle"></i></th>
</tr>
}
</tbody>
</table>
</div>
</thead>
<tbody>
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(record.IdxLic)">
<td class="text-nowrap">
<button class="btn btn-sm btn-info" @onclick="() => UnLock(record)" title="Edit record">
<i class="oi oi-lock-unlocked"></i>
</button>
</td>
<td>
<b>@record.IdxSubLic</b>
</td>
<td>
@record.CodImpiego
</td>
<td>
@if (showKey)
{
<span class="text-success">@decryptAuthKey(record.Chiave)</span>
}
else
{
@record.Chiave
}
</td>
<td>
<span class="@cssScadenza(record.VetoUnlock)">@($"{record.VetoUnlock:yyyy.MM.dd}")</span>
</td>
<td class="text-right">
@if (record.Locked)
{
<span aria-hidden="true" title="Licenza Bloccata"><i class="fas fa-lock text-danger"></i></span>
}
else
{
<span aria-hidden="true" title="Licenza Libera"><i class="fas fa-unlock-alt text-success"></i></span>
}
</td>
<td class="text-right">
@if (!record.Locked)
{
<button title="Elimina Licenza" class="btn btn-sm btn-danger" @onclick="() => Remove(record)"><i class="fas fa-trash"></i></button>
}
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
-5
View File
@@ -128,10 +128,5 @@ namespace LiMan.UI.Components
#endregion Protected Methods
//protected override async Task OnInitializedAsync()
//{
// ListApp = await DataService.ApplicazioniNextGetAll();
// ListInstall = await DataService.InstallazioniNextGetAll();
//}
}
}
+1 -1
View File
@@ -204,7 +204,7 @@
else if (showTickets)
{
<div class="col small table-info p-1">
<Tickets MasterLicence="@currRecord" DataReset="ResetData" DataUpdated="UpdateTicketData"></Tickets>
<TicketsHP MasterLicence="@currRecord" DataReset="ResetData" DataUpdated="UpdateTicketData"></TicketsHP>
</div>
}
</div>
+16
View File
@@ -8,6 +8,9 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using static Core.Enum;
//inject NavigationManager NavManager;
namespace LiMan.UI.Components
{
@@ -41,6 +44,19 @@ namespace LiMan.UI.Components
tickets
}
//protected async void gtticket()
//{
// if (detailType.tickets = 2)
// {
// Select(record, detailType.tickets)
// }
// else
// {
// NavManager.NavigateTo("ListaTicket");
// }
//}
#endregion Protected Enums
#region Private Properties
+56
View File
@@ -0,0 +1,56 @@
@using Core
<div class="row">
@if (!string.IsNullOrEmpty(@rawData))
{
@if (!string.IsNullOrEmpty(@keyGen))
{
<div class="col-12">
<CopyToClipboard Text="@keyGen" ShowText="true" />
</div>
}
<div class="col-8">
@if (!string.IsNullOrEmpty(@keyGen))
{
<p>Click to Copy Generated Key to Clipboard</p>
}
</div>
<div class="col-4 text-right">
<button class="btn btn-outline-success" type="button" @onclick="() => GenerateKey()">Generate Key from data <i class="fas fa-key"></i></button>
</div>
}
<div class="col-12">
Paste File Content Here
<div class="input-group mb-2">
<textarea @bind="rawData" @bind:event="oninput" rows="12" class="form-control" placeholder="paste machine data here" aria-label="paste machine data here" @onchange="() => GenerateKey()" />
</div>
<p class="text-danger">@errorMsg</p>
</div>
</div>
@code {
private string rawData { get; set; } = "";
private string keyGen { get; set; } = "";
private string errorMsg { get; set; } = "";
private async Task GenerateKey()
{
// recupero dati..
if (!string.IsNullOrEmpty(rawData))
{
var cMDV = new MachineDataValidator(rawData);
if (cMDV.hasValidData)
{
keyGen = cMDV.machineKeyHash;
errorMsg = "";
}
else
{
keyGen = "";
errorMsg = "Invalid Content Value!!!";
}
}
await Task.Delay(1);
}
}
+106 -4
View File
@@ -91,7 +91,7 @@
<tbody>
@foreach (var record in ListRecords)
{
<tr>
<tr class="@selTick(record.IdxTicket)">
<td>
<button type="button" class="btn btn-sm btn-primary" @onclick="() => showDet(record)"><i class="fas fa-search"></i></button>
</td>
@@ -122,7 +122,7 @@
<td>
<div>@record.ContactPhone</div>
</td>
<td>
<td >
@record.ReqBody
</td>
</tr>
@@ -140,9 +140,111 @@
</div>
</div>
@if (idxTicketSel > 0)
@if (idxTicketSel > 0 && currTipo == Core.Enum.TipologiaTicket.Licenze)
{
<div class="col-3">
<div class="col-4 bg-light p-2">
<div class="row">
<div class="col-3">
@if (StatusSel != Core.Enum.StatoRichiesta.Richiesta)
{
<button type="button" class="btn btn-sm btn-info btn-block" @onclick="() => updateStato(Core.Enum.StatoRichiesta.Richiesta)">Attesa Valutazione <i class="fas fa-pause"></i></button>
}
</div>
<div class="col-3">
@if (StatusSel != Core.Enum.StatoRichiesta.Valutazione)
{
<button type="button" class="btn btn-sm btn-info btn-block" @onclick="() => updateStato(Core.Enum.StatoRichiesta.Valutazione)">Prendi in carico <i class="fas fa-play"></i></button>
}
</div>
<div class="col-3">
@if (StatusSel != Core.Enum.StatoRichiesta.Approvata)
{
<button type="button" class="btn btn-sm btn-success btn-block" @onclick="() => updateStato(Core.Enum.StatoRichiesta.Approvata)">Approva <i class="fas fa-check"></i></button>
}
</div>
<div class="col-3">
@if (StatusSel != Core.Enum.StatoRichiesta.Rifiutata)
{
<button type="button" class="btn btn-sm btn-danger btn-block" @onclick="() => updateStato(Core.Enum.StatoRichiesta.Rifiutata)">Rifiuta <i class="fas fa-times"></i></button>
}
</div>
</div>
@if (ListActivations != null && ListActivations.Count > 0)
{
<table class="table table-sm table-striped table-responsive-lg bg-light">
<thead>
<tr>
<th>
<button type="button" class="btn btn-sm btn-dark btn-block" value="Cancel" @onclick="closeDet"><i class="fas fa-times"></i></button>
</th>
<th>#</th>
<th>Impiego</th>
<th>
Chiave &nbsp;
@if (showKey)
{
<button type="button" class="btn btn-sm btn-warning" @onclick="() => showDecrypt()"><i class="fas fa-eye-slash"></i></button>
}
else
{
<button type="button" class="btn btn-sm btn-success" @onclick="() => showDecrypt()"><i class="fas fa-eye"></i></button>
}
</th>
<th>Scadenza Veto</th>
<th class="text-right"><i class="fas fa-user-lock"></i></th>
</tr>
</thead>
<tbody>
@foreach (var record in ListActivations)
{
<tr class="@checkSelect(record.IdxLic)">
<td class="text-nowrap">
<button class="btn btn-sm btn-info" @onclick="() => UnLock(record)" title="Edit record">
<i class="oi oi-lock-unlocked"></i>
</button>
</td>
<td>
<b>@record.IdxSubLic</b>
</td>
<td>
@record.CodImpiego
</td>
<td>
@if (showKey)
{
<span class="text-success">@decryptAuthKey(record.Chiave)</span>
}
else
{
@record.Chiave
}
</td>
<td>
<span class="@cssScadenza(record.VetoUnlock)">@($"{record.VetoUnlock:yyyy.MM.dd}")</span>
</td>
<td class="text-right">
@if (record.Locked)
{
<span aria-hidden="true" title="Licenza Bloccata"><i class="fas fa-lock text-danger"></i></span>
}
else
{
<span aria-hidden="true" title="Licenza Libera"><i class="fas fa-unlock-alt text-success"></i></span>
}
</td>
</tr>
}
</tbody>
</table>
}
</div>
}
else if (idxTicketSel > 0 && currTipo == Core.Enum.TipologiaTicket.FileUpload)
{
<div class="col-4 bg-light p-2">
<div>
<table class="table table-sm table-striped table-responsive-lg">
<thead>
+42 -24
View File
@@ -9,6 +9,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using static Core.Enum;
namespace LiMan.UI.Components
{
@@ -16,15 +17,19 @@ namespace LiMan.UI.Components
{
#region Private Fields
private List<SubLicenzaModel> ListActivations;
private List<TicketDTO> ListRecords;
private List<TicketDTO> SearchRecords;
private List<InstallazioneModel> ListInstall;
private List<SubLicenzaModel> ListActivations;
private List<ApplicativoModel> ListApp;
protected int totalCount = 0;
protected TipologiaTicket currTipo = TipologiaTicket.ND;
private List<FileAttachModel> FileAttached;
private bool showTickets = false;
#endregion Private Fields
#region Protected Fields
@@ -76,26 +81,26 @@ namespace LiMan.UI.Components
#region Public Properties
[Parameter]
public EventCallback<int> DataReset { get; set; }
//[Parameter]
//public EventCallback<int> DataReset { get; set; }
[Parameter]
public EventCallback<int> DataUpdated { get; set; }
//[Parameter]
//public EventCallback<int> DataUpdated { get; set; }
[Parameter]
public LicenzaModel MasterLicence
{
get
{
return _masterLic;
}
set
{
_masterLic = value;
var pUpd = Task.Run(async () => await ReloadAllData());
pUpd.Wait();
}
}
//[Parameter]
//public LicenzaModel MasterLicence
//{
// get
// {
// return _masterLic;
// }
// set
// {
// _masterLic = value;
// var pUpd = Task.Run(async () => await ReloadAllData());
// pUpd.Wait();
// }
//}
#endregion Public Properties
@@ -112,15 +117,15 @@ namespace LiMan.UI.Components
protected string mainCss
{
get => idxTicketSel == 0 ? "col-12" : "col-9";
get => idxTicketSel == 0 ? "col-12" : "col-8";
}
private async Task ReloadAllData()
{
isLoading = true;
ListActivations = null;
idxTicketSel = 0;
await Task.Delay(1);
showTickets = false;
ListApp = await DataService.ApplicazioniNextGetAll();
ListInstall = await DataService.InstallazioniNextGetAll();
//bool StatoRichiesta = true;
@@ -274,7 +279,9 @@ namespace LiMan.UI.Components
// salvo ticket sel
idxTicketSel = currTicket.IdxTicket;
StatusSel = currTicket.Status;
currTipo = currTicket.TType;
FileAttached = await DataService.FileGetFilt(idxTicketSel);
showTickets = true;
// mostro SOLO le attivazioni di cui ho ticket attivi...
//ListActivations = MasterLicence
//.Attivazioni
@@ -288,8 +295,8 @@ namespace LiMan.UI.Components
return;
// chiamo procedura sblocco...
DataService.AttivazioneUnlock(selRecord.IdxSubLic);
await DataUpdated.InvokeAsync(0);
await DataService.AttivazioneUnlock(selRecord.IdxSubLic);
//await DataUpdated.InvokeAsync(0);
}
protected async void updateStato(StatoRichiesta nuovoStato)
@@ -303,7 +310,7 @@ namespace LiMan.UI.Components
{
// salvo presa in carico ticket
await DataService.TicketUpdateState(idxTicketSel, nuovoStato);
await DataUpdated.InvokeAsync(0);
//await DataUpdated.InvokeAsync(0);
}
}
@@ -338,6 +345,17 @@ namespace LiMan.UI.Components
return answ;
}
public string selTick(int idxTicket)
{
string answ = " ";
if (idxTicketSel == idxTicket)
{
answ = "table-primary";
}
return answ;
}
#endregion Public Methods
}
}
+186
View File
@@ -0,0 +1,186 @@
@using LiMan.UI.Components
@using Microsoft.Extensions.Configuration
@inject IConfiguration Configuration
@using System.IO
@inject IJSRuntime JS
<div class="card">
<div class="card-header bg-success py-1 text-light">
<h3>Tickets</h3>
</div>
<div class="card-body bg-light p-1">
<table class="table table-sm table-striped table-responsive-lg">
<thead>
<tr>
<th>
<button type="button" class="btn btn-sm btn-warning btn-block" value="Cancel" @onclick="close"><i class="fas fa-times"></i></button>
</th>
<th>#</th>
<th>Richiedente</th>
<th>Contatti</th>
<th>
Descrizione
</th>
</tr>
</thead>
<tbody>
@foreach (var record in ListRecords)
{
<tr class="@checkSelectTick(record.IdxTicket)">
<td>
<button type="button" class="btn btn-sm btn-primary" value="Cancel" @onclick="() => showDet(record)"><i class="fas fa-search"></i></button>
</td>
<td>
@record.IdxTicket<br />
@record.Status
</td>
<td>
<div><b>@record.ContactName</b></div>
<div>@record.DtReq</div>
</td>
<td>
<div>@record.ContactEmail</div>
<div>@record.ContactPhone</div>
</td>
<td>
@record.ReqBody
</td>
</tr>
}
</tbody>
</table>
@if (idxTicketSel > 0 && currTipo == Core.Enum.TipologiaTicket.Licenze)
{
<div class="table-primary p-2">
<div class="row">
<div class="col-3">
@if (StatusSel != Core.Enum.StatoRichiesta.Richiesta)
{
<button type="button" class="btn btn-sm btn-info btn-block" @onclick="() => updateStato(Core.Enum.StatoRichiesta.Richiesta)">Attesa Valutazione <i class="fas fa-pause"></i></button>
}
</div>
<div class="col-3">
@if (StatusSel != Core.Enum.StatoRichiesta.Valutazione)
{
<button type="button" class="btn btn-sm btn-info btn-block" @onclick="() => updateStato(Core.Enum.StatoRichiesta.Valutazione)">Prendi in carico <i class="fas fa-play"></i></button>
}
</div>
<div class="col-3">
@if (StatusSel != Core.Enum.StatoRichiesta.Approvata)
{
<button type="button" class="btn btn-sm btn-success btn-block" @onclick="() => updateStato(Core.Enum.StatoRichiesta.Approvata)">Approva <i class="fas fa-check"></i></button>
}
</div>
<div class="col-3">
@if (StatusSel != Core.Enum.StatoRichiesta.Rifiutata)
{
<button type="button" class="btn btn-sm btn-danger btn-block" @onclick="() => updateStato(Core.Enum.StatoRichiesta.Rifiutata)">Rifiuta <i class="fas fa-times"></i></button>
}
</div>
</div>
</div>
@if (ListActivations != null && ListActivations.Count > 0)
{
<table class="table table-sm table-striped table-responsive-lg bg-light">
<thead>
<tr>
<th>
<button type="button" class="btn btn-sm btn-dark btn-block" value="Cancel" @onclick="closeDet"><i class="fas fa-times"></i></button>
</th>
<th>#</th>
<th>Impiego</th>
<th>
Chiave &nbsp;
@if (showKey)
{
<button type="button" class="btn btn-sm btn-warning" @onclick="() => showDecrypt()"><i class="fas fa-eye-slash"></i></button>
}
else
{
<button type="button" class="btn btn-sm btn-success" @onclick="() => showDecrypt()"><i class="fas fa-eye"></i></button>
}
</th>
<th>Scadenza Veto</th>
<th class="text-right"><i class="fas fa-user-lock"></i></th>
</tr>
</thead>
<tbody>
@foreach (var record in ListActivations)
{
<tr class="@checkSelect(record.IdxLic)">
<td class="text-nowrap">
<button class="btn btn-sm btn-info" @onclick="() => UnLock(record)" title="Edit record">
<i class="oi oi-lock-unlocked"></i>
</button>
</td>
<td>
<b>@record.IdxSubLic</b>
</td>
<td>
@record.CodImpiego
</td>
<td>
@if (showKey)
{
<span class="text-success">@decryptAuthKey(record.Chiave)</span>
}
else
{
@record.Chiave
}
</td>
<td>
<span class="@cssScadenza(record.VetoUnlock)">@($"{record.VetoUnlock:yyyy.MM.dd}")</span>
</td>
<td class="text-right">
@if (record.Locked)
{
<span aria-hidden="true" title="Licenza Bloccata"><i class="fas fa-lock text-danger"></i></span>
}
else
{
<span aria-hidden="true" title="Licenza Libera"><i class="fas fa-unlock-alt text-success"></i></span>
}
</td>
</tr>
}
</tbody>
</table>
}
}
else if (idxTicketSel > 0 && currTipo == Core.Enum.TipologiaTicket.FileUpload)
{
<div class="card border-info mb-3">
<table class="table table-sm table-striped table-responsive-lg">
<thead>
<tr>
<th>Nome File</th>
</tr>
</thead>
<tbody>
@foreach (var record in FileAttached)
{
<tr>
<td>
@*<button @onclick="() => DownloadFileFromURL(record.OriginalName, record.FullStoragePath)"> @record.OriginalName</button>*@
<a href="@(Configuration["ApiUrl"]+"/ELM.API/api/filesave/"+@record.FullStoragePath+"/"+@record.OriginalName)" target="_blank">@record.OriginalName</a>
@*<a @onclick="() => DownloadFileFromURL(record.OriginalName, record.FullStoragePath)"> @record.OriginalName</a>*@
</td>
</tr>
}
</tbody>
</table>
@* <button @onclick="DownloadFileFromURL">
Download File From URL
</button>*@
</div>
}
</div>
</div>
+270
View File
@@ -0,0 +1,270 @@
using Core;
using Core.DTO;
using LiMan.DB.DBModels;
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 Core.Enum;
namespace LiMan.UI.Components
{
public partial class TicketsHP
{
#region Private Fields
private List<SubLicenzaModel> ListActivations;
private List<TicketModel> ListRecords;
#endregion Private Fields
#region Protected Fields
protected SubLicenzaModel _currRecord = new SubLicenzaModel();
protected LicenzaModel _masterLic = new LicenzaModel();
private List<FileAttachModel> FileAttached;
protected int idxTicketSel = 0;
protected TipologiaTicket currTipo = TipologiaTicket.ND;
protected StatoRichiesta StatusSel = StatoRichiesta.ND;
protected bool showKey = false;
[Inject]
protected LiManDataService DataService { get; set; }
#endregion Protected Fields
#region Private Properties
private SubLicenzaModel currRecord
{
get
{
return _currRecord;
}
set
{
_currRecord = value;
}
}
protected override async Task OnInitializedAsync()
{
await ReloadAllData();
}
private bool isLoading { get; set; } = false;
[Inject]
private IJSRuntime JSRuntime { get; set; }
#endregion Private Properties
#region Protected Properties
#endregion Protected Properties
#region Public Properties
[Parameter]
public EventCallback<int> DataReset { get; set; }
[Parameter]
public EventCallback<int> DataUpdated { get; set; }
[Parameter]
public LicenzaModel MasterLicence
{
get
{
return _masterLic;
}
set
{
_masterLic = value;
var pUpd = Task.Run(async () => await ReloadAllData());
pUpd.Wait();
}
}
#endregion Public Properties
#region Private Methods
private async Task fullReload()
{
await DataService.InvalidateAllCache();
await ReloadAllData();
}
private async Task ReloadAllData()
{
isLoading = true;
ListActivations = null;
idxTicketSel = 0;
await Task.Delay(1);
ListRecords = MasterLicence.Tickets.ToList();
isLoading = false;
}
#endregion Private Methods
#region Protected Methods
protected async void close()
{
await DataReset.InvokeAsync(0);
}
protected async void closeDet()
{
await ReloadAllData();
}
//protected string rowsel = "background:red";
/// <summary>
/// formatta testo secondo scadenza:
/// scadenza < oggi --> verde
/// scadenza > oggi --> rosso
/// </summary>
/// <param name="scadenza"></param>
/// <returns></returns>
protected string cssScadenza(DateTime scadenza)
{
string answ = "text-dark";
double periodo = scadenza.Subtract(DateTime.Today).TotalDays;
if (periodo <= 0)
{
answ = "text-success";
}
else
{
answ = "text-danger";
}
return answ;
}
protected async Task ResetData()
{
await fullReload();
}
protected void showDecrypt()
{
showKey = !showKey;
}
//protected void showDet(TicketModel currTicket)
//{
// // salvo ticket sel
// idxTicketSel = currTicket.IdxTicket;
// StatusSel = currTicket.Status;
// currTipo = currTicket.TType;
// FileAttached = await DataService.FileGetFilt(idxTicketSel);
// // mostro SOLO le attivazioni di cui ho ticket attivi...
// ListActivations = MasterLicence
// .Attivazioni
// .Where(a => a.IdxSubLic == currTicket.IdxSubLic)
// .ToList();
//}
protected async Task showDet(TicketModel currTicket)
{
// salvo ticket sel
idxTicketSel = currTicket.IdxTicket;
StatusSel = currTicket.Status;
currTipo = currTicket.TType;
FileAttached = await DataService.FileGetFilt(idxTicketSel);
//rowsel = "background-color:red";
// mostro SOLO le attivazioni di cui ho ticket attivi...
ListActivations = MasterLicence
.Attivazioni
.Where(a => a.IdxSubLic == currTicket.IdxSubLic)
.ToList();
}
protected async Task UnLock(SubLicenzaModel selRecord)
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Sicuro di voler eliminare il blocco? la data di scadenza verrà impostata a ieri liberando la licenza per cancellazioni o rimozioni."))
return;
// chiamo procedura sblocco...
await DataService.AttivazioneUnlock(selRecord.IdxSubLic);
await DataUpdated.InvokeAsync(0);
}
protected async void updateStato(StatoRichiesta nuovoStato)
{
if (nuovoStato == StatoRichiesta.Approvata || nuovoStato == StatoRichiesta.Rifiutata)
{
if (!await JSRuntime.InvokeAsync<bool>("confirm", "Confermi l'azione richiesta? Ricorda che in caso di approvazione/rifiuto va modificato preventivamente il record dell'Attivazione coinvolta."))
return;
}
if (idxTicketSel > 0)
{
// salvo presa in carico ticket
await DataService.TicketUpdateState(idxTicketSel, nuovoStato);
await DataUpdated.InvokeAsync(0);
}
}
#endregion Protected Methods
#region Public Methods
public string checkSelect(int IdxSubLic)
{
string answ = "";
if (currRecord != null)
{
try
{
answ = (currRecord.IdxSubLic == IdxSubLic) ? "table-info" : "";
}
catch
{ }
}
return answ;
}
public string checkSelectTick(int currTicket)
{
string answ = "";
if (currTicket != 0)
{
try
{
answ = (currTicket == idxTicketSel) ? "table-info" : "";
}
catch
{ }
}
return answ;
}
public string decryptAuthKey(string authKey)
{
string answ = authKey;
try
{
answ = SteamCrypto.DecryptString(authKey, "AuthGPW");
}
catch
{ }
return answ;
}
#endregion Public Methods
}
}
+98 -105
View File
@@ -1,4 +1,8 @@
using Microsoft.Extensions.Caching.Distributed;
using Core;
using Core.DTO;
using LiMan.DB.DBModels;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
@@ -7,13 +11,9 @@ using NLog;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity.UI.Services;
using Core;
using Core.DTO;
using LiMan.DB.DBModels;
using static Core.Enum;
namespace LiMan.UI.Data
{
@@ -41,12 +41,6 @@ namespace LiMan.UI.Data
#endregion Private Fields
#region Protected Fields
protected static string connStringBBM = "";
#endregion Protected Fields
#region Public Fields
public static GLS.Controllers.LicManController dbControllerGLS;
@@ -84,6 +78,16 @@ namespace LiMan.UI.Data
#region Private Methods
/// <summary>
/// Hash Redis contenente i dati MP di una specifico TYPE (es StatusMacchina, StateMachineIngressi, ...)
/// </summary>
/// <param name="dataType"></param>
/// <returns></returns>
private static string mHash(string dataType)
{
return $"DATA:{dataType}";
}
private DistributedCacheEntryOptions cacheOpt(bool fastCache)
{
var numSecAbsExp = fastCache ? chAbsExp : chAbsExp * 10;
@@ -105,17 +109,6 @@ namespace LiMan.UI.Data
#region Internal Methods
/// <summary>
/// Effettua sblocco di una licenza impostando data veto a oggi
/// </summary>
/// <param name="idxSubLic"></param>
/// <returns></returns>
public async Task<bool> AttivazioneUnlock(int idxSubLic)
{
bool fatto = dbControllerNext.AttivazioniUnlock(idxSubLic);
await Task.Delay(1);
return fatto;
}
/// <summary>
/// Effettua sblocco di una licenza impostando data veto a oggi
/// </summary>
@@ -132,16 +125,6 @@ namespace LiMan.UI.Data
#region Public Methods
/// <summary>
/// Hash Redis contenente i dati MP di una specifico TYPE (es StatusMacchina, StateMachineIngressi, ...)
/// </summary>
/// <param name="dataType"></param>
/// <returns></returns>
public static string mHash(string dataType)
{
return $"DATA:{dataType}";
}
public async Task<List<GLS.DatabaseModels.AnagApplicazioni>> ApplicazioniGLSGetAll()
{
List<GLS.DatabaseModels.AnagApplicazioni> dbResult = new List<GLS.DatabaseModels.AnagApplicazioni>();
@@ -224,6 +207,18 @@ namespace LiMan.UI.Data
return await Task.FromResult(done);
}
/// <summary>
/// Effettua sblocco di una licenza impostando data veto a oggi
/// </summary>
/// <param name="idxSubLic"></param>
/// <returns></returns>
public async Task<bool> AttivazioneUnlock(int idxSubLic)
{
bool fatto = dbControllerNext.AttivazioniUnlock(idxSubLic);
await Task.Delay(1);
return fatto;
}
/// <summary>
/// Recupera attivazioni data licenza
/// </summary>
@@ -252,6 +247,23 @@ namespace LiMan.UI.Data
dbControllerGLS.Dispose();
}
/// <summary>
/// Elenco file registrati dato ticket id
/// </summary>
/// <param name="idxTicket">Identificativo del ticket</param>
/// <returns></returns>
public async Task<List<FileAttachModel>> FileGetFilt(int idxTicket)
{
List<FileAttachModel> dbResult = new List<FileAttachModel>();
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<List<GLS.DatabaseModels.AnagInstallazioni>> InstallazioniGLSGetAll()
{
List<GLS.DatabaseModels.AnagInstallazioni> dbResult = new List<GLS.DatabaseModels.AnagInstallazioni>();
@@ -540,24 +552,6 @@ namespace LiMan.UI.Data
return await Task.FromResult(dbResult);
}
/// <summary>
/// Elenco file registrati dato ticket id
/// </summary>
/// <param name="idxTicket">Identificativo del ticket</param>
/// <returns></returns>
public async Task<List<FileAttachModel>> FileGetFilt(int idxTicket)
{
List<FileAttachModel> dbResult = new List<FileAttachModel>();
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<bool> LicenzeNextUpdate(DB.DBModels.LicenzaModel currItem)
{
bool done = false;
@@ -594,6 +588,59 @@ namespace LiMan.UI.Data
return answ;
}
/// <summary>
/// Recupera elenco Tickets filtrato
/// </summary>
/// <param name="CurrFilter"></param>
/// <returns></returns>
public async Task<List<TicketDTO>> TicketsGetAll()
{
Stopwatch stopWatch = new Stopwatch();
List<TicketDTO> dbResult = new List<TicketDTO>();
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);
}
/// <summary>
/// Recupera elenco Tickets filtrato
/// </summary>
/// <param name="CurrFilter"></param>
/// <returns></returns>
public async Task<List<TicketDTO>> TicketsGetFilt(SelectNext CurrFilter)
{
Stopwatch stopWatch = new Stopwatch();
List<TicketDTO> dbResult = new List<TicketDTO>();
stopWatch.Start();
dbResult = dbControllerNext.TicketGetFiltAllLic(CurrFilter.OnlyActive, Core.Enum.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);
}
/// <summary>
/// Ricerca ticket filtrati
/// </summary>
/// <param name="onlyOpen"></param>
/// <param name="CodApp"></param>
/// <param name="CodInst"></param>
/// <returns></returns>
public async Task<List<TicketDTO>> TicketsGetFilt(bool onlyOpen, string CodApp, string CodInst)
{
Stopwatch stopWatch = new Stopwatch();
List<TicketDTO> dbResult = new List<TicketDTO>();
stopWatch.Start();
dbResult = dbControllerNext.TicketGetFilt(onlyOpen, CodApp, CodInst);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per TicketsGetFilt: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
/// <summary>
/// Aggiornamentos tato ticket
/// </summary>
@@ -615,60 +662,6 @@ namespace LiMan.UI.Data
return await Task.FromResult(fatto);
}
/// <summary>
/// Recupera elenco Tickets filtrato
/// </summary>
/// <param name="CurrFilter"></param>
/// <returns></returns>
public async Task<List<TicketDTO>> TicketsGetFilt(SelectNext CurrFilter)
{
Stopwatch stopWatch = new Stopwatch();
List<TicketDTO> dbResult = new List<TicketDTO>();
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);
}
/// <summary>
/// Recupera elenco Tickets filtrato
/// </summary>
/// <param name="CurrFilter"></param>
/// <returns></returns>
public async Task<List<TicketDTO>> TicketsGetAll()
{
Stopwatch stopWatch = new Stopwatch();
List<TicketDTO> dbResult = new List<TicketDTO>();
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);
}
/// <summary>
/// Ricerca ticket filtrati
/// </summary>
/// <param name="onlyOpen"></param>
/// <param name="CodApp"></param>
/// <param name="CodInst"></param>
/// <returns></returns>
public async Task<List<TicketDTO>> TicketsGetFilt(bool onlyOpen,string CodApp, string CodInst)
{
Stopwatch stopWatch = new Stopwatch();
List<TicketDTO> dbResult = new List<TicketDTO>();
stopWatch.Start();
dbResult = dbControllerNext.TicketGetFilt(onlyOpen,CodApp,CodInst);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per TicketsGetFilt: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
#endregion Public Methods
}
}
+3 -1
View File
@@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>1.1.2202.1113</Version>
<Version>1.1.2311.0611</Version>
<RootNamespace>LiMan.UI</RootNamespace>
<AssemblyName>LiMan.UI</AssemblyName>
</PropertyGroup>
@@ -15,12 +15,14 @@
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS01.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS02.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS03.pubxml" />
<_WebToolingArtifacts Remove="Properties\PublishProfiles\IIS04.pubxml" />
</ItemGroup>
<ItemGroup>
<None Include="compilerconfig.json" />
<None Include="Properties\PublishProfiles\IIS01.pubxml.user" />
<None Include="Properties\PublishProfiles\IIS02.pubxml.user" />
<None Include="Properties\PublishProfiles\IIS04.pubxml.user" />
<None Include="Properties\PublishProfiles\IIS03.pubxml.user" />
<None Include="wwwroot\fonts\lato-v17-latin-regular.svg" />
<None Include="wwwroot\fonts\lato-v17-latin-regular.woff2" />
+1
View File
@@ -16,5 +16,6 @@
AppMService.ShowSearch = false;
AppMService.PageName = "Home";
AppMService.PageIcon = "fas fa-home pr-1";
await Task.Delay(1);
}
}
+1 -1
View File
@@ -10,7 +10,7 @@
protected override async Task OnInitializedAsync()
{
await DataService.InvalidateAllCache();
// rimanod a home
// rimando alla home
NavManager.NavigateTo("/");
}
}
@@ -22,7 +22,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<EnableMsDeployAppOffline>True</EnableMsDeployAppOffline>
<UserName>jenkins</UserName>
<_SavePWD>True</_SavePWD>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>
@@ -22,7 +22,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<EnableMsDeployAppOffline>True</EnableMsDeployAppOffline>
<UserName>jenkins</UserName>
<_SavePWD>True</_SavePWD>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>
@@ -22,7 +22,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<EnableMsDeployAppOffline>True</EnableMsDeployAppOffline>
<UserName>jenkins</UserName>
<_SavePWD>True</_SavePWD>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>
@@ -7,6 +7,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile />
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAk75miMJLMkCTEelQutKpbwAAAAACAAAAAAADZgAAwAAAABAAAAA7RC2yFYQ+sbph7Gm3hrEMAAAAAASAAACgAAAAEAAAAFhL9j1HkRjMaqEESfncpZcYAAAAIMz57CMDX9ZLAPLwms1/yHQTf/r/v74FFAAAAB6WaNF8er6HZmelU4da+AsQFSC5</EncryptedPassword>
<History>True|2021-11-15T11:36:27.8522254Z;True|2021-11-15T12:36:22.0508830+01:00;True|2021-11-15T12:35:07.9738431+01:00;True|2021-11-15T12:35:02.4129864+01:00;True|2021-10-15T10:15:10.5127570+02:00;False|2021-10-15T10:13:53.0299219+02:00;False|2021-10-15T08:58:38.3028788+02:00;False|2021-10-15T08:47:48.5789826+02:00;False|2021-10-14T19:32:56.5281204+02:00;False|2021-10-14T19:31:10.1629370+02:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00;</History>
<History>True|2023-02-03T18:36:31.3348002Z;True|2021-11-15T12:36:27.8522254+01:00;True|2021-11-15T12:36:22.0508830+01:00;True|2021-11-15T12:35:07.9738431+01:00;True|2021-11-15T12:35:02.4129864+01:00;True|2021-10-15T10:15:10.5127570+02:00;False|2021-10-15T10:13:53.0299219+02:00;False|2021-10-15T08:58:38.3028788+02:00;False|2021-10-15T08:47:48.5789826+02:00;False|2021-10-14T19:32:56.5281204+02:00;False|2021-10-14T19:31:10.1629370+02:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AllowUntrustedCertificate>true</AllowUntrustedCertificate>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>office.egalware.com/ELM.UI</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<ProjectGuid>34200ca2-489c-435a-a60b-34de7b7ba04d</ProjectGuid>
<MSDeployServiceURL>https://office.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>office.egalware.com/ELM.UI</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>true</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>false</EnableMSDeployBackup>
<EnableMsDeployAppOffline>true</EnableMsDeployAppOffline>
<UserName>jenkins</UserName>
<_SavePWD>true</_SavePWD>
<TargetFramework>net6.0</TargetFramework>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile />
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAk75miMJLMkCTEelQutKpbwAAAAACAAAAAAADZgAAwAAAABAAAAA7RC2yFYQ+sbph7Gm3hrEMAAAAAASAAACgAAAAEAAAAFhL9j1HkRjMaqEESfncpZcYAAAAIMz57CMDX9ZLAPLwms1/yHQTf/r/v74FFAAAAB6WaNF8er6HZmelU4da+AsQFSC5</EncryptedPassword>
<History>True|2023-03-14T12:58:06.8712164Z;True|2023-02-03T19:36:31.3348002+01:00;True|2021-11-15T12:36:27.8522254+01:00;True|2021-11-15T12:36:22.0508830+01:00;True|2021-11-15T12:35:07.9738431+01:00;True|2021-11-15T12:35:02.4129864+01:00;True|2021-10-15T10:15:10.5127570+02:00;False|2021-10-15T10:13:53.0299219+02:00;False|2021-10-15T08:58:38.3028788+02:00;False|2021-10-15T08:47:48.5789826+02:00;False|2021-10-14T19:32:56.5281204+02:00;False|2021-10-14T19:31:10.1629370+02:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>
+2 -2
View File
@@ -1,8 +1,7 @@
<body>
<i>License Manager</i>
<h4>Versione: {{CURRENT-REL}}</h4>
<br />
Note di rilascio:
<br /> Note di rilascio:
<ul>
<li>
<b>Ultime modifiche:</b>
@@ -11,6 +10,7 @@
<li>
<b>v.1.* &rarr;</b>
<ul>
<li>Nuova release dotnet6</li>
<li>Prima release dotnet5</li>
<li>Integrazione EFCore</li>
</ul>
+3 -3
View File
@@ -1,8 +1,7 @@
<body>
<i>License Manager</i>
<h4>Versione: 1.1.2202.1113</h4>
<br />
Note di rilascio:
<h4>Versione: 1.1.2311.0611</h4>
<br /> Note di rilascio:
<ul>
<li>
<b>Ultime modifiche:</b>
@@ -11,6 +10,7 @@
<li>
<b>v.1.* &rarr;</b>
<ul>
<li>Nuova release dotnet6</li>
<li>Prima release dotnet5</li>
<li>Integrazione EFCore</li>
</ul>
+1 -1
View File
@@ -1 +1 @@
1.1.2202.1113
1.1.2311.0611
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.1.2202.1113</version>
<version>1.1.2311.0611</version>
<url>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.UI.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+23 -8
View File
@@ -8,6 +8,7 @@ using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Localization;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Hosting;
using System;
using System.Collections.Generic;
@@ -15,9 +16,9 @@ using System.Globalization;
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;
using System.IO;
namespace LiMan.UI
{
@@ -75,14 +76,27 @@ namespace LiMan.UI
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseFileServer(new FileServerOptions
// verifico da conf se sia linux o windows x file da accedere...
if (Configuration["HostOs"] == "Win")
{
FileProvider = new PhysicalFileProvider(@"\\stor01\TEAM DRIVES\40_FileUpload\unsafe_uploads"),
RequestPath = new PathString("/unsafe_uploads"),
EnableDirectoryBrowsing = true
//EnableDirectoryBrowsing = false
});
app.UseFileServer(new FileServerOptions
{
FileProvider = new PhysicalFileProvider(@"\\stor01\TEAM DRIVES\40_FileUpload\unsafe_uploads"),
RequestPath = new PathString("/unsafe_uploads"),
EnableDirectoryBrowsing = true
//EnableDirectoryBrowsing = false
});
}
else
{
app.UseFileServer(new FileServerOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(env.ContentRootPath, "unsafe_uploads")),
RequestPath = new PathString("/unsafe_uploads"),
EnableDirectoryBrowsing = true
//EnableDirectoryBrowsing = false
});
}
app.UseRouting();
@@ -132,6 +146,7 @@ namespace LiMan.UI
options.Host_Password = Configuration["ExternalProviders:MailKit:SMTP:Password"];
options.Sender_EMail = Configuration["ExternalProviders:MailKit:SMTP:SenderEmail"];
options.Sender_Name = Configuration["ExternalProviders:MailKit:SMTP:SenderName"];
options.Host_SecureSocketOptions = MailKit.Security.SecureSocketOptions.Auto;
});
services.AddLocalization();
+10 -9
View File
@@ -1,11 +1,12 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Environment": "PROD"
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Environment": "PROD",
"HostOs": "Win"
}
+10 -9
View File
@@ -1,11 +1,12 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Environment": "STAG"
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Environment": "STAG",
"HostOs": "Win"
}
+4 -3
View File
@@ -8,8 +8,8 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"LiMan.GLS": "Server=SQLSTEAM;Database=SteamWare_Auth;User ID=sa;Password=keyhammer;integrated security=False;MultipleActiveResultSets=True;App=LiMan.UI;",
"LiMan.DB": "Server=SQLSTEAM;Database=LiMan.DB;User ID=sa;Password=keyhammer;integrated security=False;MultipleActiveResultSets=True;App=LiMan.UI;",
"LiMan.GLS": "Server=W2019-SQL-STEAM;Database=SteamWare_Auth;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=LiMan.UI;",
"LiMan.DB": "Server=W2019-SQL-STEAM;Database=LiMan.DB;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=LiMan.UI;",
"Redis": "localhost:6379"
},
"ReloadStatusTimer": 30000,
@@ -29,5 +29,6 @@
"Admin": "samuele@steamware.net",
"ProcOp": "ceo@steamware.net"
},
"ApiUrl": "https://liman.egalware.com"
"ApiUrl": "https://liman.egalware.com",
"HostOs" : "Win"
}
+6 -1
View File
@@ -13,7 +13,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core", "Core\Core.csproj",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiMan.APi", "LiMan.Api\LiMan.APi.csproj", "{FABDED94-D3B0-4208-BF4F-C0D35A39A783}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiMan.Transfer", "LiMan.Transfer\LiMan.Transfer.csproj", "{CB680925-5B3D-42E8-8E0F-0177A9ABF8FE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiMan.Transfer", "LiMan.Transfer\LiMan.Transfer.csproj", "{CB680925-5B3D-42E8-8E0F-0177A9ABF8FE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C8C0B995-47A8-4E34-B89A-C58804280B8B}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution