diff --git a/LiMan.DL/DatabaseModels/LicManContext.cs b/LiMan.DL/DatabaseModels/LicManContext.cs index 4254283..6951af0 100644 --- a/LiMan.DL/DatabaseModels/LicManContext.cs +++ b/LiMan.DL/DatabaseModels/LicManContext.cs @@ -20,6 +20,7 @@ namespace LiMan.DL.DatabaseModels #region Public Constructors + [Obsolete("This constructor should never be used directly, and is only needed to generate entityframework stuff. Connection string can be adapted as pleased.")] public LicManContext() { } @@ -70,28 +71,17 @@ namespace LiMan.DL.DatabaseModels protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { - // default - string connString = "Server=SQLSTEAM;Database=SteamWare_Auth;Trusted_Connection=True;"; - - // tento setup da config - try - { - string srv = _configuration["DbConfig:srv"]; - string db = _configuration["DbConfig:db"]; - string usr = _configuration["DbConfig:usr"]; - string pwd = _configuration["DbConfig:pwd"]; - - //DbConfig.InitDb(server, nKey, sKey); - //DbConfig.CheckUser(nKey, sKey); - - // uso conn string calcolata - connString = $"Server={srv};Database={db};User ID={usr}Password={pwd};"; - } - catch - { } if (!optionsBuilder.IsConfigured) { - optionsBuilder.UseSqlServer(connString); + string connString = _configuration.GetConnectionString("LiMan.DB"); + if (!string.IsNullOrEmpty(connString)) + { + optionsBuilder.UseSqlServer(connString); + } + else + { + optionsBuilder.UseSqlServer("Server=SQLSTEAM;Database=SteamWare_Auth;Trusted_Connection=True;"); + } } } diff --git a/LiMan.UI/Data/LiManDataService.cs b/LiMan.UI/Data/LiManDataService.cs index 959fbc6..9eee509 100644 --- a/LiMan.UI/Data/LiManDataService.cs +++ b/LiMan.UI/Data/LiManDataService.cs @@ -59,7 +59,7 @@ namespace LiMan.UI.Data this.memoryCache = memoryCache; this.distributedCache = distributedCache; // conf DB - string connStr = _configuration.GetConnectionString("GWMS.Data"); + string connStr = _configuration.GetConnectionString("LiMan.DB"); if (string.IsNullOrEmpty(connStr)) { _logger.LogError("ConnString empty!"); @@ -67,6 +67,7 @@ namespace LiMan.UI.Data else { dbController = new LiMan.DL.Controllers.LicManController(configuration); + _logger.LogInformation("DbController OK"); } } diff --git a/LiMan.UI/NLog.config b/LiMan.UI/NLog.config new file mode 100644 index 0000000..bd41408 --- /dev/null +++ b/LiMan.UI/NLog.config @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LiMan.UI/Pages/Applicazioni.razor b/LiMan.UI/Pages/Applicazioni.razor index cbe8621..ed88291 100644 --- a/LiMan.UI/Pages/Applicazioni.razor +++ b/LiMan.UI/Pages/Applicazioni.razor @@ -107,7 +107,7 @@ *@ -
+
@if (currRecord != null) { @**@ @@ -164,7 +164,7 @@
}
- \ No newline at end of file diff --git a/LiMan.UI/Pages/_Host.cshtml b/LiMan.UI/Pages/_Host.cshtml index 17f63fb..25ea868 100644 --- a/LiMan.UI/Pages/_Host.cshtml +++ b/LiMan.UI/Pages/_Host.cshtml @@ -17,7 +17,7 @@ LiMan.UI - + @@ -37,8 +37,8 @@ - - + + \ No newline at end of file diff --git a/LiMan.UI/Resources/ChangeLog-original.html b/LiMan.UI/Resources/ChangeLog-original.html new file mode 100644 index 0000000..0a14842 --- /dev/null +++ b/LiMan.UI/Resources/ChangeLog-original.html @@ -0,0 +1,27 @@ + + License Manager +

Versione: {{CURRENT-REL}}

+
+ Note di rilascio: + +
+
+ +
+
+ © Steamware 2006-2021 +
+
+ \ No newline at end of file diff --git a/LiMan.UI/Resources/ChangeLog.html b/LiMan.UI/Resources/ChangeLog.html new file mode 100644 index 0000000..eaaf6b5 --- /dev/null +++ b/LiMan.UI/Resources/ChangeLog.html @@ -0,0 +1,27 @@ + + Modulo License Manager +

Versione: 6.14.2109.3016

+
+ Note di rilascio: + +
+
+ +
+
+ © Steamware 2006-2021 +
+
+ \ No newline at end of file diff --git a/LiMan.UI/Resources/VersNum.txt b/LiMan.UI/Resources/VersNum.txt new file mode 100644 index 0000000..15ece1f --- /dev/null +++ b/LiMan.UI/Resources/VersNum.txt @@ -0,0 +1 @@ +6.14.2109.3016 diff --git a/LiMan.UI/Resources/logoSteamware.png b/LiMan.UI/Resources/logoSteamware.png new file mode 100644 index 0000000..0958b50 Binary files /dev/null and b/LiMan.UI/Resources/logoSteamware.png differ diff --git a/LiMan.UI/Resources/manifest-original.xml b/LiMan.UI/Resources/manifest-original.xml new file mode 100644 index 0000000..f95e076 --- /dev/null +++ b/LiMan.UI/Resources/manifest-original.xml @@ -0,0 +1,7 @@ + + + 1.0.0.0 + https://nexus.steamware.net/repository/SWS/{{DIRNAME}}/{{BRANCHNAME}}/{{PACKNAME}}.zip + https://nexus.steamware.net/repository/SWS/{{DIRNAME}}/{{BRANCHNAME}}/ChangeLog.html + false + diff --git a/LiMan.UI/Resources/manifest.xml b/LiMan.UI/Resources/manifest.xml new file mode 100644 index 0000000..1fdfb11 --- /dev/null +++ b/LiMan.UI/Resources/manifest.xml @@ -0,0 +1,7 @@ + + + 6.14.2109.3016 + https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/MP.Prog.zip + https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/ChangeLog.html + false + diff --git a/LiMan.UI/appsettings.json b/LiMan.UI/appsettings.json index d9d9a9b..8eadd32 100644 --- a/LiMan.UI/appsettings.json +++ b/LiMan.UI/appsettings.json @@ -1,10 +1,15 @@ { - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "AllowedHosts": "*", + "ConnectionStrings": { + "DefaultConnection": "Server=SQL2016DEV;Database=SteamWare_Auth;User ID=sa;Password=keyhammer;integrated security=False;MultipleActiveResultSets=True;App=LiMan.UI;", + "LiMan.DB": "Server=SQLSTEAM;Database=SteamWare_Auth;User ID=sa;Password=keyhammer;integrated security=False;MultipleActiveResultSets=True;App=LiMan.UI;", + "Redis": "localhost:6379" } - }, - "AllowedHosts": "*" -} +} \ No newline at end of file diff --git a/LiMan.UI/post-build.ps1 b/LiMan.UI/post-build.ps1 new file mode 100644 index 0000000..b74f583 --- /dev/null +++ b/LiMan.UI/post-build.ps1 @@ -0,0 +1,32 @@ +param([string]$ProjectDir, [string]$ProjectPath); + +$FileMajMin = "..\MajMin.vers" +$FileVers = "Resources\VersNum.txt" +$FileManIn = "Resources\manifest-original.xml" +$FileManOut = "Resources\manifest.xml" +$FileCLogIn = "Resources\ChangeLog-original.html" +$FileCLogOut = "Resources\ChangeLog.html" +$MajMin = Get-Content $FileMajMin # "6.14." +$currentDate = get-date -format yyMM; +$currentTime = get-date -format ddHH; +$find = "(.|\n)*?"; +$currRelNum = $MajMin + $currentDate +"." + $currentTime +$replace = "" + $MajMin + $currentDate +"." + $currentTime + ""; +$csproj = Get-Content $ProjectPath +$csprojUpdated = $csproj -replace $find, $replace + +Set-Content -Path $ProjectPath -Value $csprojUpdated +Set-Content -Path $FileVers -Value $currRelNum + +# replace x manifest +$manData = Get-Content $FileManIn +$manData = $manData -replace "1.0.0.0", $currRelNum +$manData = $manData -replace "{{DIRNAME}}", "LiMan" +$manData = $manData -replace "{{BRANCHNAME}}", "stable/LAST" +$manData = $manData -replace "{{PACKNAME}}", "LiMan.UI" +Set-Content -Path $FileManOut -Value $manData + +# replace x ChangeLog +$clogData = Get-Content $FileCLogIn +$clogData = $clogData -replace "{{CURRENT-REL}}", $currRelNum +Set-Content -Path $FileCLogOut -Value $clogData diff --git a/MajMin.vers b/MajMin.vers new file mode 100644 index 0000000..c4e3f49 --- /dev/null +++ b/MajMin.vers @@ -0,0 +1 @@ +6.14. \ No newline at end of file