Compare commits

..

56 Commits

Author SHA1 Message Date
Samuele Locatelli e197245bec Merge branch 'develop' 2021-09-21 18:38:52 +02:00
Samuele Locatelli b316c81b96 Merge branch 'release/AddLandProj' 2021-09-21 18:38:28 +02:00
Samuele Locatelli f8f9b5bbe2 Fix URL e parametri 2021-09-21 18:33:40 +02:00
Samuele Locatelli d312fa1eb2 Fix conf deploy/nexus 2021-09-21 18:24:21 +02:00
Samuele Locatelli 57920f2b59 update conf x staging/dev/prod 2021-09-21 18:23:50 +02:00
Samuele Locatelli 546c8cc92b Merge branch 'feature/LAND-DEPLOY' into develop 2021-09-21 18:13:39 +02:00
Samuele Locatelli c348652291 Sistemato coda compilazione x develop 2021-09-21 18:13:26 +02:00
Samuele Locatelli 93e13da83b splitattato ogni step 2021-09-21 18:09:57 +02:00
Samuele Locatelli e5a611c844 Separato anche build e test 2021-09-21 18:06:51 +02:00
Samuele Locatelli 535cf8ecf2 Test separazione in 3 task deploy 2021-09-21 18:00:49 +02:00
Samuele Locatelli 54b384cb92 aggiunto test stage x feature 2021-09-21 17:55:47 +02:00
Samuele Locatelli 82f6d5a0c7 test deploy feature CI-CD 2021-09-21 17:54:43 +02:00
Samuele Locatelli b4af3bfd61 COmpletato modifica x test nuovo installer 2021-09-21 17:53:52 +02:00
Samuele Locatelli 0cb40dde36 Modifica conf installer Land x profili 2021-09-21 17:53:44 +02:00
Samuele Locatelli f1dc5253b6 Merge branch 'feature/MP-CORE-LAND' into develop 2021-09-21 17:29:29 +02:00
Samuele Locatelli 5c65b5c0e4 Refresh pre revisione installer 2021-09-21 17:29:21 +02:00
Samuele Locatelli 5e15c9f836 Fix reload doppio con reset pagina 1 2021-09-21 17:22:18 +02:00
Samuele Locatelli 15420f605e Aggiunta versione HwSwInfo preliminare 2021-09-21 17:15:23 +02:00
Samuele Locatelli 45c0337fe3 Cleanup 2021-09-21 16:18:15 +02:00
Samuele Locatelli 01ed314319 Ricerca cartellini (fixed) 2021-09-21 16:18:11 +02:00
Samuele Locatelli 77a45dbdc1 Fix Info/About page 2021-09-21 14:30:16 +02:00
Samuele Locatelli 1ac15dd9a0 Merge branch 'feature/MP-CORE-LAND' into develop 2021-09-20 20:36:34 +02:00
Samuele Locatelli abd652b944 Pagina Contacts 2021-09-20 20:36:27 +02:00
Samuele Locatelli 08a761c678 Pagina About 2021-09-20 20:28:31 +02:00
Samuele Locatelli 532862340e Completata review estetica alert download 2021-09-20 20:16:41 +02:00
Samuele Locatelli 97e0224e77 Display Update avanzamento download 2021-09-20 20:03:16 +02:00
Samuele Locatelli c740b4492f abbozzo download 2021-09-20 19:25:37 +02:00
Samuele Locatelli cd01907565 Merge branch 'feature/MP-CORE-LAND' into develop 2021-09-20 19:22:38 +02:00
Samuele Locatelli 4f4cd7bf2f Ok singolo download 2021-09-20 19:21:42 +02:00
Samuele Locatelli 5cdb0e077d Pulizia pagine inutilizzate 2021-09-20 16:53:36 +02:00
Samuele Locatelli 661d2580bc Cambio: home mostrata con componenti 2021-09-20 16:53:00 +02:00
Samuele Locatelli c9d75fc084 COmpletata review QRCode cards 2021-09-20 16:39:07 +02:00
Samuele Locatelli 397be33d04 Refresh 2021-09-20 16:24:54 +02:00
Samuele Locatelli a99406ca76 Fix x elementi non in stampa 2021-09-20 16:24:48 +02:00
Samuele Locatelli d5896b136b Aggiunta lib x qrcode 2021-09-20 16:24:38 +02:00
Samuele Locatelli c980019ca1 Fix modelli 2021-09-20 16:24:21 +02:00
Samuele Locatelli 521edc8f91 Pagina cartellino QR Operatori 2021-09-20 16:24:12 +02:00
Samuele Locatelli d4b8116fc1 Pulizia moduli inutilizzati 2021-09-20 16:23:40 +02:00
Samuele Locatelli f95d426953 review home 2021-09-20 15:20:15 +02:00
Samuele Locatelli cdd12bf764 Fix grafico pagina elenco 2021-09-20 13:15:17 +02:00
Samuele Locatelli 74c13ed1a7 Update display componenti in elenco 2021-09-20 12:43:34 +02:00
Samuele Locatelli 4070c4600f Fix chiamate vocabolario sovrapposte 2021-09-20 11:54:06 +02:00
Samuele Locatelli 3267f6a44d Implementazione vocabolario (sync) 2021-09-20 11:03:52 +02:00
Samuele Locatelli da65188ca9 Update NavMenu 2021-09-18 12:57:15 +02:00
Samuele Locatelli aa15b170be Merge branch 'feature/MP-CORE-LAND' into develop 2021-09-18 12:52:18 +02:00
Samuele Locatelli 8639fbfb9b Update home page LAND vers CORE 2021-09-18 12:52:01 +02:00
Samuele Locatelli 1c3785ee16 Update metodi di base x recupero dati in HOME 2021-09-18 11:57:33 +02:00
Samuele Locatelli 0ead243221 Restore client libs 2021-09-18 11:57:22 +02:00
Samuele Locatelli e4de6dc438 Refresh nuget EFCore 2021-09-18 11:00:44 +02:00
Samuele Locatelli f04d739e7b Prima vers land da completare 2021-09-18 10:55:24 +02:00
Samuele Locatelli 031676d783 Bozza migrazione controller DB 2021-09-17 19:42:03 +02:00
Samuele Locatelli f0419fdf72 Aggiunto pèrogetto CORE LAND x rifare LAND site 2021-09-17 19:14:45 +02:00
Samuele Locatelli 1c11e03d5f Merge tag 'FixNexusUpload' into develop
Fix nexus upload
2021-09-17 17:08:00 +02:00
Samuele Locatelli f7834d362e Merge branch 'release/FixNexusUpload' 2021-09-17 17:07:51 +02:00
Samuele Locatelli afb673bd79 Aggiornamenti x pubblicazione nexus nuovo formato 2021-09-17 17:07:32 +02:00
Samuele Locatelli b08eafe7f4 Merge tag 'FixStatsSlowInit' into develop
Fix caricamento init async x filtro
2021-09-16 17:37:23 +02:00
335 changed files with 109635 additions and 55 deletions
+161 -33
View File
@@ -53,11 +53,11 @@ variables:
$File2Send = Get-ChildItem($env:APP_NAME + "\bin\publish\*")
ForEach ($File in $File2Send) {
$FileName = Split-Path $File -leaf
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/0/$FileName
mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/$VersNumb/$FileName
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 $File https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/ARCHIVE/$VersNumb/$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/0/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/0/ChangeLog.html
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
@@ -69,88 +69,158 @@ stages:
- installer
- release
build:
LAND:build:
stage: build
tags:
- win
before_script:
- *nuget-fix
- dotnet restore MP-LAND.sln
script:
- dotnet build MP.Land/MP.Land.csproj
PROG:build:
stage: build
tags:
- win
before_script:
- *nuget-fix
- dotnet restore MP-PROG.sln
script:
- dotnet build MP.Prog/MP.Prog.csproj
STAT:build:
stage: build
tags:
- win
before_script:
- *nuget-fix
- dotnet restore MP-STATS.sln
- dotnet restore MP-PROG.sln
script:
- dotnet build MP.Stats/MP.Stats.csproj
- dotnet build MP.Prog/MP.Prog.csproj
test:
LAND:test:
stage: test
tags:
- win
only:
- develop
needs: ["build"]
needs: ["LAND:build"]
script:
- dotnet test MP.Land/MP.Land.csproj
PROG:test:
stage: test
tags:
- win
only:
- develop
needs: ["PROG:build"]
script:
- dotnet test MP.Prog/MP.Prog.csproj
STAT:test:
stage: test
tags:
- win
only:
- develop
needs: ["STAT:build"]
script:
- dotnet test MP.Stats/MP.Stats.csproj
- dotnet test MP.Prog/MP.Prog.csproj
IIS01:deploy:
LAND:IIS01:deploy:
stage: deploy
tags:
- win
only:
- develop
needs: ["test"]
# before_script:
# - *nuget-fix
# - dotnet restore
needs: ["LAND:test"]
script:
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Land/MP.Land.csproj
PROG:IIS01:deploy:
stage: deploy
tags:
- win
only:
- develop
needs: ["PROG:test"]
script:
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Stats/MP.Stats.csproj
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Prog/MP.Prog.csproj
IIS02:deploy:
STAT:IIS01:deploy:
stage: deploy
tags:
- win
only:
- develop
needs: ["STAT:test"]
script:
- dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Stats/MP.Stats.csproj
LAND:IIS02:deploy:
stage: deploy
tags:
- win
only:
- master
needs: ["build"]
# before_script:
# - *nuget-fix
# - dotnet restore
needs: ["LAND:build"]
script:
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Land/MP.Land.csproj
- dotnet publish -p:PublishProfile=W2019-IIS-DEVProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Land/MP.Land.csproj
PROG:IIS02:deploy:
stage: deploy
tags:
- win
only:
- master
needs: ["PROG:build"]
script:
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Prog/MP.Prog.csproj
- dotnet publish -p:PublishProfile=W2019-IIS-DEVProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Prog/MP.Prog.csproj
STAT:IIS02:deploy:
stage: deploy
tags:
- win
only:
- master
needs: ["STAT:build"]
script:
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Stats/MP.Stats.csproj
- dotnet publish -p:PublishProfile=W2019-IIS-DEVProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Stats/MP.Stats.csproj
- dotnet publish -p:PublishProfile=IIS02.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Prog/MP.Prog.csproj
- dotnet publish -p:PublishProfile=W2019-IIS-DEVProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=viadante16 -p:AllowUntrustedCertificate=true MP.Prog/MP.Prog.csproj
STA:installer:
LAND:installer:
stage: installer
tags:
- win
only:
- develop
- master
needs: ["build"]
needs: ["LAND:build"]
variables:
APP_NAME: MP.Stats
NEXUS_PATH: MP-STATS
APP_NAME: MP.Land
NEXUS_PATH: MP-LAND
before_script:
# - *nuget-fix
# - dotnet restore
script:
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release MP.Stats/MP.Stats.csproj -o:publish
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release MP.Land/MP.Land.csproj -o:publish
# qui il deploy su nexus...
- *hashBuild
- *nexusUpload
PRG:installer:
PROG:installer:
stage: installer
tags:
- win
only:
- develop
- master
needs: ["build"]
needs: ["PROG:build"]
variables:
APP_NAME: MP.Prog
NEXUS_PATH: MP-PROG
@@ -163,7 +233,28 @@ PRG:installer:
- *hashBuild
- *nexusUpload
release:
STAT:installer:
stage: installer
tags:
- win
only:
- develop
- master
needs: ["STAT:build"]
variables:
APP_NAME: MP.Stats
NEXUS_PATH: MP-STATS
before_script:
# - *nuget-fix
# - dotnet restore
script:
- dotnet publish -p:PublishProfile=IISProfile.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release MP.Stats/MP.Stats.csproj -o:publish
# qui il deploy su nexus...
- *hashBuild
- *nexusUpload
LAND:release:
stage: release
tags:
- win
@@ -173,12 +264,49 @@ release:
- tags
except:
- branches
needs: ["build"]
needs: ["LAND:build"]
artifacts:
paths:
- publish/
script:
- dotnet publish -c Release -o ./publish MP.Land/MP.Land.csproj
PROG:release:
stage: release
tags:
- win
only:
#- feature/Deploy_CI_CD
# - master
- tags
except:
- branches
needs: ["PROG:build"]
artifacts:
paths:
- publish/
script:
- dotnet publish -c Release -o ./publish MP.Stats/MP.Stats.csproj
- dotnet publish -c Release -o ./publish MP.Prog/MP.Prog.csproj
STAT:release:
stage: release
tags:
- win
only:
#- feature/Deploy_CI_CD
# - master
- tags
except:
- branches
needs: ["STAT:build"]
artifacts:
paths:
- publish/
script:
- dotnet publish -c Release -o ./publish MP.Land/MP.Land.csproj
- dotnet publish -c Release -o ./publish MP.Prog/MP.Prog.csproj
- dotnet publish -c Release -o ./publish MP.Stats/MP.Stats.csproj
+31
View File
@@ -0,0 +1,31 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31229.75
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Land", "MP.Land\MP.Land.csproj", "{D949AB45-9B65-4594-A97E-182BC3831707}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.AppAuth", "MP.AppAuth\MP.AppAuth.csproj", "{E8B1E617-87BC-4638-A8B6-04EEBA3B8F47}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D949AB45-9B65-4594-A97E-182BC3831707}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D949AB45-9B65-4594-A97E-182BC3831707}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D949AB45-9B65-4594-A97E-182BC3831707}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D949AB45-9B65-4594-A97E-182BC3831707}.Release|Any CPU.Build.0 = Release|Any CPU
{E8B1E617-87BC-4638-A8B6-04EEBA3B8F47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E8B1E617-87BC-4638-A8B6-04EEBA3B8F47}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E8B1E617-87BC-4638-A8B6-04EEBA3B8F47}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E8B1E617-87BC-4638-A8B6-04EEBA3B8F47}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {632D11D1-088B-4795-97E5-048534002558}
EndGlobalSection
EndGlobal
+119
View File
@@ -0,0 +1,119 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using MP.AppAuth.Models;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.AppAuth
{
public partial class AppAuthContext : DbContext
{
#region Private Fields
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private IConfiguration _configuration;
#endregion Private Fields
#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 AppAuthContext()
{
}
public AppAuthContext(IConfiguration configuration)
{
_configuration = configuration;
try
{
// se non ci fosse... crea o migra!
Database.Migrate();
}
catch (Exception exc)
{
Log.Error(exc, "Exception during context initialization 01");
}
}
public AppAuthContext(DbContextOptions<AppAuthContext> options) : base(options)
{
try
{
// se non ci fosse... crea o migra!
Database.Migrate();
}
catch (Exception exc)
{
Log.Error(exc, "Exception during context initialization 02");
}
}
#endregion Public Constructors
#region Public Properties
public virtual DbSet<AnagraficaOperatori> DbSetAnagOpr { get; set; }
public virtual DbSet<UpdMan> DbSetUpdMan { get; set; }
public virtual DbSet<Vocabolario> DbSetVocabolario { get; set; }
#endregion Public Properties
#region Private Methods
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
#endregion Private Methods
#region Protected Methods
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
string connString = _configuration.GetConnectionString("MP.Land");
if (!string.IsNullOrEmpty(connString))
{
optionsBuilder.UseSqlServer(connString);
}
else
{
optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;");
}
}
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS");
modelBuilder.Entity<Vocabolario>(entity =>
{
entity.HasKey(e => new { e.Lingua, e.Lemma });
entity.ToTable("Vocabolario");
entity.Property(e => e.Lingua).HasMaxLength(3);
entity.Property(e => e.Lemma).HasMaxLength(50);
entity.Property(e => e.Traduzione)
.IsRequired()
.HasMaxLength(500);
});
//
modelBuilder.Seed();
OnModelCreatingPartial(modelBuilder);
}
#endregion Protected Methods
}
}
+125
View File
@@ -0,0 +1,125 @@
using Microsoft.Extensions.Configuration;
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.AppAuth.Controllers
{
public class AppAuthController : IDisposable
{
#region Private Fields
private static IConfiguration _configuration;
private static AppAuthContext dbCtx;
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Public Constructors
public AppAuthController(IConfiguration configuration)
{
_configuration = configuration;
dbCtx = new AppAuthContext(configuration);
Log.Info("Avviata classe AppAuthController");
}
#endregion Public Constructors
#region Public Methods
public List<Models.AnagraficaOperatori> AnagOpGetAll(string searchVal)
{
List<Models.AnagraficaOperatori> dbResult = new List<Models.AnagraficaOperatori>();
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
{
if (!string.IsNullOrEmpty(searchVal))
{
dbResult = localDbCtx
.DbSetAnagOpr
.Where(x => x.Cognome.Contains(searchVal) || x.Nome.Contains(searchVal))
.ToList();
}
else
{
dbResult = localDbCtx
.DbSetAnagOpr
.ToList();
}
}
// ritorno
return dbResult;
}
public void Dispose()
{
// Clear database context
dbCtx.Dispose();
}
public void ResetController()
{
dbCtx = new AppAuthContext(_configuration);
Log.Info("Effettuato reset AppAuthController");
}
/// <summary>
/// Annulla modifiche su una specifica entity (cancel update)
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
public bool RollBackEntity(object item)
{
bool answ = false;
try
{
if (dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Deleted || dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Modified)
{
dbCtx.Entry(item).Reload();
}
}
catch (Exception exc)
{
Log.Error($"Eccezione in rollBackEntity{Environment.NewLine}{exc}");
}
return answ;
}
/// <summary>
/// Elenco Record x gestione Update
/// </summary>
/// <returns></returns>
public List<Models.UpdMan> UpdManGetAll()
{
List<Models.UpdMan> dbResult = new List<Models.UpdMan>();
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
{
dbResult = localDbCtx
.DbSetUpdMan
.ToList();
}
return dbResult;
}
/// <summary>
/// Elenco Record x gestione Update
/// </summary>
/// <returns></returns>
public List<Models.Vocabolario> VocabolarioGetAll()
{
List<Models.Vocabolario> dbResult = new List<Models.Vocabolario>();
using (AppAuthContext localDbCtx = new AppAuthContext(_configuration))
{
dbResult = localDbCtx
.DbSetVocabolario
.ToList();
}
return dbResult;
}
#endregion Public Methods
}
}
+276
View File
@@ -0,0 +1,276 @@
using NLog;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace MP.AppAuth
{
/// <summary>
/// Helper x estrarre dati sintetici su HW, Software, librerie installate...
/// </summary>
public class HwSwInfo
{
#region Private Fields
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Protected Fields
/// <summary>
/// Assembly di base
/// </summary>
protected Assembly assembly = Assembly.GetExecutingAssembly();
#endregion Protected Fields
#region Public Constructors
/// <summary>
/// Istanza base
/// </summary>
public HwSwInfo()
{
assembly = Assembly.GetExecutingAssembly();
}
public HwSwInfo(Assembly targetAssembly)
{
assembly = targetAssembly;
}
#endregion Public Constructors
#if false
/// <summary>
/// Singleton!
/// </summary>
public static HwSwInfo man = new HwSwInfo();
#endif
#region Public Properties
/// <summary>
/// Statistiche IIS
/// </summary>
public string IISStats
{
get
{
StringBuilder sb = new StringBuilder();
using (var iis = Process.GetCurrentProcess())
{
//Process iis = Process.GetCurrentProcess();
sb.AppendLine(string.Format("UPTIME: {0}", ToDateString(DateTime.Now - iis.StartTime)));
sb.AppendLine(string.Format("Priority: {0}", iis.PriorityClass));
sb.AppendLine(string.Format("Physical Memory Used: {0}", memFormat(iis.WorkingSet64)));
sb.AppendLine(string.Format("Virtual Memory Used: {0}", memFormat(iis.VirtualMemorySize64)));
}
return sb.ToString();
}
}
/// <summary>
/// Versioni di ogni libreria compresa
/// </summary>
public string librariesVers
{
get
{
string answ = "";
try
{
AssemblyName[] referencedAssemblyNames = assembly.GetReferencedAssemblies();
foreach (AssemblyName referencedAssemblyName in referencedAssemblyNames.OrderBy(n => n.Name))
{
answ += referencedAssemblyName.FullName + Environment.NewLine;
}
}
catch
{ }
return answ;
}
}
/// <summary>
/// Nome MainAssembly
/// </summary>
public string mainAssembly
{
get
{
string answ = "";
try
{
answ = assembly.FullName;
}
catch
{ }
return answ;
}
}
/// <summary>
/// Num di librerie inserite
/// </summary>
public int numLibraries
{
get
{
int numLib = 0; ;
try
{
AssemblyName[] referencedAssemblyNames = assembly.GetReferencedAssemblies();
foreach (AssemblyName referencedAssemblyName in referencedAssemblyNames.OrderBy(n => n.Name))
{
numLib++;
}
}
catch
{ }
return numLib;
}
}
///// <summary>
///// Dati sui server redis...
///// </summary>
//public string redisServersData
//{
// get
// {
// StringBuilder sb = new StringBuilder();
// try
// {
// var servData = memLayer.ML.redServInfo();
// foreach (var item in servData)
// {
// sb.AppendLine(string.Format("Server: {0} | {1} | {2}", item, item.Version, item.ServerType));
// // da completare con altre info?!?
// var srvInfo = item.Info();
// // esporto un pò di info x gruppo...
// foreach (IGrouping<string, System.Collections.Generic.KeyValuePair<string, string>> capitolo in srvInfo)
// {
// sb.AppendLine("----------------------------------------------");
// sb.AppendLine(string.Format("Capitolo: {0}", capitolo.Key));
// sb.AppendLine("----------------------------------------------");
// foreach (var kvp in capitolo)
// {
// sb.AppendLine(string.Format("{0}:{1}", kvp.Key, kvp.Value));
// }
// sb.AppendLine();
// }
// }
// }
// catch (Exception exc)
// {
// Log.Error($"Errore in redisServersData{Environment.NewLine}{exc}");
// }
// return sb.ToString();
// }
//}
/// <summary>
/// Runtime assembly
/// </summary>
public string runtimeImg
{
get
{
string answ = "";
try
{
answ = assembly.ImageRuntimeVersion;
}
catch
{ }
return answ;
}
}
/// <summary>
/// Statistiche server
/// </summary>
public string ServerStats
{
get
{
StringBuilder sb = new StringBuilder();
try
{
// calcoli preliminari
// compongo output
sb.AppendLine(string.Format("NAME: {0}", Environment.MachineName));
sb.AppendLine(System.Runtime.InteropServices.RuntimeInformation.OSDescription);
sb.AppendLine(System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription);
sb.AppendLine(string.Format("OS 64bit: {0} | PROC 64bit: {1}", Environment.Is64BitOperatingSystem, Environment.Is64BitProcess));
//sb.AppendLine(string.Format("SYS UPTIME: {0}", ToDateString(uptime)));
sb.AppendLine(string.Format("CPU: {0}", Environment.ProcessorCount));
//sb.AppendLine(string.Format("RAM: {0}", memFormat(computer.TotalPhysicalMemory)));
//sb.AppendLine(string.Format("Virtual Memory: {0}", memFormat(computer.TotalVirtualMemory)));
//sb.AppendLine(string.Format("Available RAM: {0}", memFormat(computer.AvailablePhysicalMemory)));
//sb.AppendLine(string.Format("Available Virtual Memory: {0}", memFormat(computer.AvailableVirtualMemory)));
sb.AppendLine(string.Format("DIR: {0}", Environment.CurrentDirectory));
sb.AppendLine(string.Format("USER: {0} | USER: {1}", Environment.UserDomainName, Environment.UserName));
}
catch (Exception exc)
{
Log.Error($"Errore in ServerStats{Environment.NewLine}{exc}");
}
return sb.ToString();
}
}
#endregion Public Properties
#region Public Methods
/// <summary>
/// Singleton!
/// </summary>
public static HwSwInfo man(Assembly targetAssembly)
{
HwSwInfo answ = new HwSwInfo(targetAssembly);
return answ;
}
/// <summary>
/// Formatta un numero da int a size in Kb/Mb/Gb/Tb
/// </summary>
/// <param name="rawSize"></param>
/// <returns></returns>
public string memFormat(double rawSize)
{
string[] sizes = { "B", "KB", "MB", "GB", "TB" };
int order = 0;
while (rawSize >= 1024 && order < sizes.Length - 1)
{
order++;
rawSize = rawSize / 1024;
}
// Adjust the format string to your preferences. For example "{0:0.#}{1}" would
// show a single decimal place, and no space.
return String.Format("{0:0.##} {1}", rawSize, sizes[order]);
}
/// <summary>
/// Stringa timing in gg, ore, ... da timespan
/// </summary>
/// <param name="time"></param>
/// <returns></returns>
public string ToDateString(TimeSpan time)
{
return string.Format("{0}gg, {1:00}:{2:00}:{3:00} (h:m:s)", time.Days, time.Hours, time.Minutes, time.Seconds);
}
#endregion Public Methods
}
}
+26
View File
@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="Migrations\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.10">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.10">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NLog" Version="4.7.11" />
</ItemGroup>
</Project>
+28
View File
@@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.AppAuth
{
public static class ModelBuilderExtensions
{
#region Public Methods
/// <summary>
/// Estensione per seed iniziale dei dati nel DB
/// </summary>
/// <param name="modelBuilder"></param>
public static void Seed(this ModelBuilder modelBuilder)
{
//// inizializzazione dei valori di default x MACCHINA
//modelBuilder.Entity<MacchinaModel>().HasData(
// new MacchinaModel { IdxMacchina = "0", RuleName = "0", Descrizione = "--- Tutte ---", Nome = "--- Tutte ---", BasePath = "", ImgUrl = "", Note = "", ShowOrder = 0 }
// );
}
#endregion Public Methods
}
}
+22
View File
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class AnagArticoli
{
#region Public Properties
public string CodArticolo { get; set; }
public string CurrRev { get; set; }
public string DescArticolo { get; set; }
public string Disegno { get; set; }
public bool? FlagIsNew { get; set; }
public string ProdRev { get; set; }
public string Tipo { get; set; }
#endregion Public Properties
}
}
+17
View File
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class AnagClassiTempo
{
#region Public Properties
public string ClasseTempo { get; set; }
public string Descrizione { get; set; }
#endregion Public Properties
}
}
+20
View File
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class AnagKeyValue
{
#region Public Properties
public string Descrizione { get; set; }
public string NomeVar { get; set; }
public double? ValFloat { get; set; }
public int? ValInt { get; set; }
public string ValString { get; set; }
#endregion Public Properties
}
}
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class AnagraficaCausaliScarto
{
#region Public Properties
public string Causale { get; set; }
public string CssClass { get; set; }
public string Descrizione { get; set; }
public string Icona { get; set; }
#endregion Public Properties
}
}
+17
View File
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class AnagraficaFlussi
{
#region Public Properties
public string CodFlux { get; set; }
public string DescrFlux { get; set; }
#endregion Public Properties
}
}
+18
View File
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class AnagraficaIngressi
{
#region Public Properties
public string Descrizione { get; set; }
public int IdxFamigliaIngresso { get; set; }
public int ValoreIngresso { get; set; }
#endregion Public Properties
}
}
+18
View File
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class AnagraficaMicroStati
{
#region Public Properties
public string Descrizione { get; set; }
public int IdxFamigliaIngresso { get; set; }
public int IdxMicroStato { get; set; }
#endregion Public Properties
}
}
+27
View File
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
namespace MP.AppAuth.Models
{
[Table("AnagraficaOperatori")]
public partial class AnagraficaOperatori
{
#region Public Properties
public string AuthKey { get; set; }
public string CodOprExt { get; set; }
public string Cognome { get; set; }
public bool? IsAdmin { get; set; }
[Key]
public int MatrOpr { get; set; }
public string Nome { get; set; }
#endregion Public Properties
}
}
+19
View File
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class Config
{
#region Public Properties
public string Chiave { get; set; }
public string Note { get; set; }
public string Valore { get; set; }
public string ValoreStd { get; set; }
#endregion Public Properties
}
}
+27
View File
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class DatiMacchine
{
#region Public Properties
public string CodArticoloA { get; set; }
public string CodArticoloB { get; set; }
public bool HasCounter { get; set; }
public string IdxMacchina { get; set; }
public bool? InsEnabled { get; set; }
public bool? IsTrigerDbon { get; set; }
public bool? PalletChange { get; set; }
public int? RefreshPeriod { get; set; }
public string SerialPort { get; set; }
public bool? SimplePallet { get; set; }
public bool? Simulazione { get; set; }
public bool SLogEnabled { get; set; }
#endregion Public Properties
}
}
+17
View File
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class FamigliaTipoIngressi
{
#region Public Properties
public string DescrizioneIngresso { get; set; }
public int IdxFamigliaIngresso { get; set; }
#endregion Public Properties
}
}
+19
View File
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class FamiglieMacchine
{
#region Public Properties
public string Descrizione { get; set; }
public bool? HasIob { get; set; }
public bool? HasUdi { get; set; }
public int IdxFamiglia { get; set; }
#endregion Public Properties
}
}
+19
View File
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class KeepAlive
{
#region Public Properties
public DateTime? DataOraMacchina { get; set; }
public DateTime? DataOraServer { get; set; }
public DateTime? DataOraStart { get; set; }
public string IdxMacchina { get; set; }
#endregion Public Properties
}
}
+21
View File
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class LinkMenuJqm
{
#region Public Properties
public string Icona { get; set; }
public int IdxLink { get; set; }
public string NavigateUrl { get; set; }
public int? Ordine { get; set; }
public string Testo { get; set; }
public string TipoLink { get; set; }
#endregion Public Properties
}
}
+20
View File
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class ListValue
{
#region Public Properties
public string FieldName { get; set; }
public string Label { get; set; }
public int? Ordinal { get; set; }
public string TableName { get; set; }
public string Value { get; set; }
#endregion Public Properties
}
}
+25
View File
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace MP.AppAuth.Models
{
public partial class Macchine
{
#region Public Properties
public string CodMacchina { get; set; }
public int ColNum { get; set; }
public string Css { get; set; }
public string Descrizione { get; set; }
public string IdxMacchina { get; set; }
public string Locazione { get; set; }
public string Nome { get; set; }
public string Note { get; set; }
public int RowNum { get; set; }
public string Url { get; set; }
#endregion Public Properties
}
}
+27
View File
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#nullable disable
namespace MP.AppAuth.Models
{
[Table("UpdMan")]
public partial class UpdMan
{
#region Public Properties
[Key]
public string AppName { get; set; }
public string AppUrl { get; set; }
public bool IsAuth { get; set; } = false;
public string LicenseKey { get; set; }
public string LocalRepo { get; set; }
public string ManifestUrl { get; set; }
public string PackName { get; set; }
#endregion Public Properties
}
}
+21
View File
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.AppAuth.Models
{
[Table("Vocabolario")]
public partial class Vocabolario
{
#region Public Properties
public string Lemma { get; set; }
public string Lingua { get; set; }
public string Traduzione { get; set; }
#endregion Public Properties
}
}
+473
View File
@@ -0,0 +1,473 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using MP.AppAuth.Models;
#nullable disable
namespace MP.AppAuth
{
public partial class MoonProContext : DbContext
{
#region Public Constructors
public MoonProContext()
{
}
public MoonProContext(DbContextOptions<MoonProContext> options)
: base(options)
{
}
#endregion Public Constructors
#region Public Properties
public virtual DbSet<AnagArticoli> AnagArticolis { get; set; }
public virtual DbSet<AnagClassiTempo> AnagClassiTempos { get; set; }
public virtual DbSet<AnagKeyValue> AnagKeyValues { get; set; }
public virtual DbSet<AnagraficaCausaliScarto> AnagraficaCausaliScartos { get; set; }
public virtual DbSet<AnagraficaFlussi> AnagraficaFlussis { get; set; }
public virtual DbSet<AnagraficaIngressi> AnagraficaIngressis { get; set; }
public virtual DbSet<AnagraficaMicroStati> AnagraficaMicroStatis { get; set; }
public virtual DbSet<AnagraficaOperatori> AnagraficaOperatoris { get; set; }
public virtual DbSet<Config> Configs { get; set; }
public virtual DbSet<DatiMacchine> DatiMacchines { get; set; }
public virtual DbSet<FamigliaTipoIngressi> FamigliaTipoIngressis { get; set; }
public virtual DbSet<FamiglieMacchine> FamiglieMacchines { get; set; }
public virtual DbSet<KeepAlive> KeepAlives { get; set; }
public virtual DbSet<LinkMenuJqm> LinkMenuJqms { get; set; }
public virtual DbSet<ListValue> ListValues { get; set; }
public virtual DbSet<Macchine> Macchines { get; set; }
public virtual DbSet<UpdMan> UpdMan { get; set; }
public virtual DbSet<Vocabolario> Vocabolario { get; set; }
#endregion Public Properties
#region Private Methods
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
#endregion Private Methods
#region Protected Methods
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
optionsBuilder.UseSqlServer("Data Source=SQL2016DEV;Initial Catalog=MoonPro;Trusted_Connection=True;");
}
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS");
modelBuilder.Entity<AnagArticoli>(entity =>
{
entity.HasKey(e => e.CodArticolo);
entity.ToTable("AnagArticoli");
entity.Property(e => e.CodArticolo).HasMaxLength(50);
entity.Property(e => e.CurrRev)
.IsRequired()
.HasMaxLength(50)
.HasDefaultValueSql("('')");
entity.Property(e => e.DescArticolo)
.IsRequired()
.HasMaxLength(250)
.HasDefaultValueSql("('')");
entity.Property(e => e.Disegno)
.IsRequired()
.HasMaxLength(50)
.HasDefaultValueSql("('')");
entity.Property(e => e.FlagIsNew).HasComputedColumnSql("(case when [CurrRev]=[ProdRev] then CONVERT([bit],(0),(0)) else CONVERT([bit],(1),(0)) end)", false);
entity.Property(e => e.ProdRev)
.IsRequired()
.HasMaxLength(50)
.HasDefaultValueSql("('')");
entity.Property(e => e.Tipo)
.IsRequired()
.HasMaxLength(50)
.HasDefaultValueSql("('ART')")
.HasComment("Tipo di articolo: ART, KIT, ...");
});
modelBuilder.Entity<AnagClassiTempo>(entity =>
{
entity.HasKey(e => e.ClasseTempo);
entity.ToTable("AnagClassiTempo");
entity.Property(e => e.ClasseTempo).HasMaxLength(50);
entity.Property(e => e.Descrizione).HasMaxLength(500);
});
modelBuilder.Entity<AnagKeyValue>(entity =>
{
entity.HasKey(e => e.NomeVar);
entity.ToTable("AnagKeyValue");
entity.Property(e => e.NomeVar)
.HasMaxLength(50)
.HasColumnName("nomeVar");
entity.Property(e => e.Descrizione)
.HasMaxLength(250)
.HasColumnName("descrizione")
.HasDefaultValueSql("('-')");
entity.Property(e => e.ValFloat)
.HasColumnName("valFloat")
.HasDefaultValueSql("((0))");
entity.Property(e => e.ValInt)
.HasColumnName("valInt")
.HasDefaultValueSql("((0))");
entity.Property(e => e.ValString)
.HasMaxLength(250)
.HasColumnName("valString")
.HasDefaultValueSql("('')");
});
modelBuilder.Entity<AnagraficaCausaliScarto>(entity =>
{
entity.HasKey(e => e.Causale);
entity.ToTable("AnagraficaCausaliScarto");
entity.Property(e => e.Causale)
.HasMaxLength(50)
.HasDefaultValueSql("('ND')");
entity.Property(e => e.CssClass)
.IsRequired()
.HasMaxLength(50)
.HasColumnName("cssClass")
.HasDefaultValueSql("('')");
entity.Property(e => e.Descrizione)
.IsRequired()
.HasMaxLength(250)
.HasDefaultValueSql("('ND')");
entity.Property(e => e.Icona)
.IsRequired()
.HasMaxLength(50)
.HasColumnName("icona")
.HasDefaultValueSql("('')");
});
modelBuilder.Entity<AnagraficaFlussi>(entity =>
{
entity.HasKey(e => e.CodFlux);
entity.ToTable("AnagraficaFlussi");
entity.Property(e => e.CodFlux).HasMaxLength(50);
entity.Property(e => e.DescrFlux).HasMaxLength(50);
});
modelBuilder.Entity<AnagraficaIngressi>(entity =>
{
entity.HasKey(e => new { e.IdxFamigliaIngresso, e.ValoreIngresso });
entity.ToTable("AnagraficaIngressi");
entity.Property(e => e.Descrizione).HasMaxLength(50);
});
modelBuilder.Entity<AnagraficaMicroStati>(entity =>
{
entity.HasKey(e => new { e.IdxFamigliaIngresso, e.IdxMicroStato });
entity.ToTable("AnagraficaMicroStati");
entity.Property(e => e.Descrizione).HasMaxLength(250);
});
modelBuilder.Entity<AnagraficaOperatori>(entity =>
{
entity.HasKey(e => e.MatrOpr);
entity.ToTable("AnagraficaOperatori");
entity.Property(e => e.MatrOpr).ValueGeneratedNever();
entity.Property(e => e.AuthKey)
.HasMaxLength(50)
.HasColumnName("authKey")
.HasDefaultValueSql("('12345')");
entity.Property(e => e.CodOprExt)
.IsRequired()
.HasMaxLength(50)
.HasDefaultValueSql("('')")
.HasComment("Codice operatore per sistema esterno");
entity.Property(e => e.Cognome).HasMaxLength(50);
entity.Property(e => e.IsAdmin).HasColumnName("isAdmin");
entity.Property(e => e.Nome).HasMaxLength(50);
});
modelBuilder.Entity<Config>(entity =>
{
entity.HasKey(e => e.Chiave);
entity.ToTable("Config");
entity.Property(e => e.Chiave)
.HasMaxLength(50)
.HasColumnName("chiave");
entity.Property(e => e.Note).HasColumnName("note");
entity.Property(e => e.Valore).HasColumnName("valore");
entity.Property(e => e.ValoreStd)
.HasColumnName("valoreStd")
.HasComment("Valore di default/riferimento per la variabile");
});
modelBuilder.Entity<DatiMacchine>(entity =>
{
entity.HasKey(e => e.IdxMacchina);
entity.ToTable("DatiMacchine");
entity.Property(e => e.IdxMacchina)
.HasMaxLength(50)
.HasColumnName("idxMacchina");
entity.Property(e => e.CodArticoloA)
.HasMaxLength(50)
.HasColumnName("CodArticolo_A");
entity.Property(e => e.CodArticoloB)
.HasMaxLength(50)
.HasColumnName("CodArticolo_B");
entity.Property(e => e.HasCounter)
.HasColumnName("hasCounter")
.HasComment("Indica se la macchina abbia un COUNTER (assoluto) o meno, tipicamente true x IOB-WIN, false per IOB-PI");
entity.Property(e => e.InsEnabled)
.HasColumnName("insEnabled")
.HasDefaultValueSql("((1))")
.HasComment("definisce se l'INSERT sia abilitato per la macchina (disabilitato in fase di ricostruzione batch...)");
entity.Property(e => e.IsTrigerDbon)
.IsRequired()
.HasColumnName("isTrigerDBOn")
.HasDefaultValueSql("((1))")
.HasComment("Abilita o meno il trigger su DiarioDiBordo x ricalcolo eventi");
entity.Property(e => e.PalletChange).HasColumnName("palletChange");
entity.Property(e => e.RefreshPeriod).HasColumnName("refreshPeriod");
entity.Property(e => e.SLogEnabled)
.HasColumnName("sLogEnabled")
.HasComment("definisce se sia abilitata la registrazione di TUTTI gli invii di dati in ingresso da questa specifica macchina");
entity.Property(e => e.SerialPort)
.HasMaxLength(50)
.HasColumnName("serialPort");
entity.Property(e => e.SimplePallet).HasColumnName("simplePallet");
entity.Property(e => e.Simulazione).HasColumnName("simulazione");
});
modelBuilder.Entity<FamigliaTipoIngressi>(entity =>
{
entity.HasKey(e => e.IdxFamigliaIngresso);
entity.ToTable("FamigliaTipoIngressi");
entity.Property(e => e.IdxFamigliaIngresso).ValueGeneratedNever();
entity.Property(e => e.DescrizioneIngresso).HasMaxLength(250);
});
modelBuilder.Entity<FamiglieMacchine>(entity =>
{
entity.HasKey(e => e.IdxFamiglia);
entity.ToTable("FamiglieMacchine");
entity.Property(e => e.Descrizione)
.IsRequired()
.HasMaxLength(250);
entity.Property(e => e.HasIob)
.IsRequired()
.HasColumnName("HasIOB")
.HasDefaultValueSql("((1))")
.HasComment("Indica se la famiglia macchina prevede una IOB x alimentare dati in AUTOMATICO da impianto");
entity.Property(e => e.HasUdi)
.IsRequired()
.HasColumnName("HasUDI")
.HasDefaultValueSql("((1))")
.HasComment("Indica se la famiglia macchina prevede UserDataInput ovvero inserimento MANUALE informazioni");
});
modelBuilder.Entity<KeepAlive>(entity =>
{
entity.HasKey(e => e.IdxMacchina);
entity.ToTable("KeepAlive");
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
entity.Property(e => e.DataOraMacchina).HasColumnType("datetime");
entity.Property(e => e.DataOraStart).HasColumnType("datetime");
});
modelBuilder.Entity<LinkMenuJqm>(entity =>
{
entity.HasKey(e => e.IdxLink)
.HasName("PK_linkMenuJQM");
entity.ToTable("LinkMenuJQM");
entity.Property(e => e.IdxLink).HasColumnName("idxLink");
entity.Property(e => e.Icona)
.HasMaxLength(50)
.HasColumnName("icona");
entity.Property(e => e.NavigateUrl).HasMaxLength(50);
entity.Property(e => e.Ordine).HasColumnName("ordine");
entity.Property(e => e.Testo).HasMaxLength(50);
entity.Property(e => e.TipoLink).HasMaxLength(50);
});
modelBuilder.Entity<ListValue>(entity =>
{
entity.HasKey(e => new { e.TableName, e.FieldName, e.Value });
entity.Property(e => e.TableName).HasMaxLength(50);
entity.Property(e => e.FieldName).HasMaxLength(50);
entity.Property(e => e.Value)
.HasMaxLength(50)
.HasColumnName("value");
entity.Property(e => e.Label)
.HasMaxLength(50)
.HasColumnName("label");
entity.Property(e => e.Ordinal).HasColumnName("ordinal");
});
modelBuilder.Entity<Macchine>(entity =>
{
entity.HasKey(e => e.IdxMacchina);
entity.ToTable("Macchine");
entity.Property(e => e.IdxMacchina).HasMaxLength(50);
entity.Property(e => e.CodMacchina).HasMaxLength(50);
entity.Property(e => e.Css)
.IsRequired()
.HasMaxLength(50)
.HasColumnName("css")
.HasDefaultValueSql("('col text-center')")
.HasComment("Classe container standard (col, col-2, ...)");
entity.Property(e => e.Descrizione).HasMaxLength(50);
entity.Property(e => e.Locazione)
.HasMaxLength(50)
.HasColumnName("locazione");
entity.Property(e => e.Nome).HasMaxLength(50);
entity.Property(e => e.Note).HasMaxLength(50);
entity.Property(e => e.Url)
.HasMaxLength(250)
.HasColumnName("url");
});
modelBuilder.Entity<UpdMan>(entity =>
{
entity.HasKey(e => e.AppName)
.HasName("PK_UpdateMan");
entity.ToTable("UpdMan");
entity.Property(e => e.AppName).HasMaxLength(50);
entity.Property(e => e.AppUrl)
.IsRequired()
.HasMaxLength(250)
.HasDefaultValueSql("('')");
entity.Property(e => e.IsAuth)
.IsRequired()
.HasDefaultValueSql("((1))");
entity.Property(e => e.LicenseKey)
.IsRequired()
.HasDefaultValueSql("('')");
entity.Property(e => e.LocalRepo)
.IsRequired()
.HasMaxLength(250);
entity.Property(e => e.ManifestUrl)
.IsRequired()
.HasMaxLength(250);
entity.Property(e => e.PackName)
.IsRequired()
.HasMaxLength(50)
.HasDefaultValueSql("('')");
});
modelBuilder.Entity<Vocabolario>(entity =>
{
entity.HasKey(e => new { e.Lingua, e.Lemma });
entity.ToTable("Vocabolario");
entity.Property(e => e.Lingua).HasMaxLength(3);
entity.Property(e => e.Lemma).HasMaxLength(50);
entity.Property(e => e.Traduzione)
.IsRequired()
.HasMaxLength(500);
});
OnModelCreatingPartial(modelBuilder);
}
#endregion Protected Methods
}
}
+270
View File
@@ -0,0 +1,270 @@
using NLog;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
namespace MP.AppAuth
{
/// <summary>
/// Object of this class gives you all the details about the update useful in handling the update logic yourself.
/// </summary>
public class UpdateInfoEventArgs : EventArgs
{
#region Public Properties
/// <summary>
/// URL of the webpage specifying changes in the new update.
/// </summary>
public string ChangelogURL { get; set; }
/// <summary>
/// Returns newest version of the application available to download.
/// </summary>
public Version CurrentVersion { get; set; }
/// <summary>
/// Download URL of the update file.
/// </summary>
public string DownloadURL { get; set; }
/// <summary>
/// Returns version of the application currently installed on the user's PC.
/// </summary>
public Version InstalledVersion { get; set; }
/// <summary>
/// If new update is available then returns true otherwise false.
/// </summary>
public bool IsUpdateAvailable { get; set; }
/// <summary>
/// Shows if the update is required or optional.
/// </summary>
public bool Mandatory { get; set; }
#endregion Public Properties
}
/// <summary>
/// Gestione update applicazioni
/// </summary>
public class UpdateMan
{
#region Private Fields
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Protected Fields
protected bool doAuth = false;
#endregion Protected Fields
#region Public Fields
/// <summary>
/// Init classe
/// </summary>
public static UpdateMan obj = new UpdateMan();
#endregion Public Fields
#region Public Constructors
/// <summary>
/// Init classe
/// </summary>
public UpdateMan()
{ }
/// <summary>
/// Init classe
/// </summary>
/// <param name="user"></param>
/// <param name="pwd"></param>
public UpdateMan(string user, string pwd)
{
userName = user;
passwd = pwd;
doAuth = !string.IsNullOrEmpty($"{userName}{passwd}");
}
#endregion Public Constructors
#region Protected Properties
protected string passwd { get; set; } = "";
protected string userName { get; set; } = "";
#endregion Protected Properties
#region Public Methods
/// <summary>
/// Effettua download ultima versione applicativo
/// </summary>
/// <param name="remoteUrl"></param>
/// <param name="localRepo"></param>
/// <param name="packName"></param>
public long downloadLatest(string remoteUrl, string localRepo, string packName)
{
long size = 0;
// verifico directory
if (!Directory.Exists(localRepo))
{
Directory.CreateDirectory(localRepo);
}
string localFile = "";
string localLast = "";
string DownloadURL = "";
try
{
// in primis scarico update info...
UpdateInfoEventArgs updateData = getUpdateInfo(remoteUrl);
if (updateData.IsUpdateAvailable)
{
DownloadURL = updateData.DownloadURL;
localFile = string.Format(@"{0}\{1}_Build_{2}.zip", localRepo, packName, updateData.CurrentVersion);
localLast = string.Format(@"{0}\{1}.zip", localRepo, packName);
// scarica file e salva in directory locale...
using (var http = new HttpClient())
{
//var client = new WebClient();
//bool doAuth = !string.IsNullOrEmpty($"{userName}{passwd}");
if (doAuth)
{
//client.Credentials = new System.Net.NetworkCredential(userName, passwd);
http.DefaultRequestHeaders.Accept.Clear();
var byteArray = System.Text.ASCIIEncoding.UTF8.GetBytes($"{userName}:{passwd}");
http.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
}
//client.DownloadFile(updateData.DownloadURL, localFile);
// url da chiamare
http.BaseAddress = new Uri(DownloadURL);
// lettura
var data = http.GetAsync(DownloadURL).Result;
using (var myReader = data.Content.ReadAsStreamAsync())
{
//var myReader = data.Content.ReadAsStreamAsync();
if (data.StatusCode != HttpStatusCode.OK)
{
Log.Info($"Errore in chiamata getUpdateInfo per URL {remoteUrl}: status code: {data.StatusCode}");
}
else
{
using (Stream outStream = File.OpenWrite(localFile))
{
myReader.Result.CopyTo(outStream);
}
// ora lo copio come latest...
File.Copy(localFile, localLast, true);
// indico come fatto!
var thisFile = new FileInfo(localLast);
size = thisFile.Length;
}
}
}
}
else
{
localFile = string.Format(@"{0}\Error.log", localRepo);
// scrivo file in area target...
using (StreamWriter sw = File.AppendText(localFile))
{
sw.WriteLine($"{DateTime.Now:yyyy-MM-dd HH:mm:ss} ATTENZIONE! Installer NON disponibile | {remoteUrl}");
}
}
}
catch (Exception exc)
{
localFile = string.Format(@"{0}\Error.log", localRepo);
// scrivo file in area target...
using (StreamWriter sw = File.AppendText(localFile))
{
sw.WriteLine($"{DateTime.Now:yyyy-MM-dd HH:mm:ss} Errore in fase di download installers{Environment.NewLine}XML: {remoteUrl}{Environment.NewLine}URL: {DownloadURL}");
sw.WriteLine(exc.ToString());
}
}
return size;
}
/// <summary>
/// Recupera l'ultima versione disponibile
/// </summary>
/// <param name="remoteUrl"></param>
/// <returns></returns>
public UpdateInfoEventArgs getUpdateInfo(string remoteUrl)
{
//bool doAuth = !string.IsNullOrEmpty($"{userName}{passwd}");
UpdateInfoEventArgs args = new UpdateInfoEventArgs();
Version CurrentVersion;
bool Mandatory;
XmlDocument recXml = new XmlDocument();
try
{
// recupero dati
using (var http = new HttpClient())
{
if (doAuth)
{
http.DefaultRequestHeaders.Accept.Clear();
var byteArray = System.Text.ASCIIEncoding.UTF8.GetBytes($"{userName}:{passwd}");
http.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
}
// url da chiamare
http.BaseAddress = new Uri(remoteUrl);
// lettura
var data = http.GetAsync(remoteUrl).Result;
var myReader = data.Content.ReadAsStreamAsync();
if (data.StatusCode != HttpStatusCode.OK)
{
Log.Info($"Errore in chiamata getUpdateInfo per URL {remoteUrl}: status code: {data.StatusCode}");
}
else
{
recXml.Load(myReader.Result);
XmlNodeList recData = recXml.SelectNodes("item");
if (recData != null)
{
foreach (XmlNode item in recData)
{
XmlNode appCastVersion = item.SelectSingleNode("version");
Version.TryParse(appCastVersion?.InnerText, out CurrentVersion);
args.CurrentVersion = CurrentVersion;
XmlNode appCastChangeLog = item.SelectSingleNode("changelog");
args.ChangelogURL = appCastChangeLog?.InnerText;
XmlNode appCastUrl = item.SelectSingleNode("url");
args.DownloadURL = appCastUrl?.InnerText;
XmlNode mandatory = item.SelectSingleNode("mandatory");
Boolean.TryParse(mandatory?.InnerText, out Mandatory);
args.Mandatory = Mandatory;
args.IsUpdateAvailable = true;
}
}
}
}
}
catch (Exception exc)
{
Log.Info($"Eccezione in getUpdateInfo:{Environment.NewLine}{exc}");
// metto versione = 0 + errore...
args.IsUpdateAvailable = false;
args.CurrentVersion = new Version("0.0.0.0");
}
return args;
}
#endregion Public Methods
}
}
+1 -1
View File
@@ -77,7 +77,7 @@ namespace MP.FileData
{
if (!optionsBuilder.IsConfigured)
{
string connString = _configuration.GetConnectionString("Mp.Prog");
string connString = _configuration.GetConnectionString("MP.Land");
if (!string.IsNullOrEmpty(connString))
{
optionsBuilder.UseSqlServer(connString);
+5
View File
@@ -0,0 +1,5 @@
{
"version": 1,
"isRoot": true,
"tools": {}
}
+10
View File
@@ -0,0 +1,10 @@
<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
+16
View File
@@ -0,0 +1,16 @@
<div class="form-row text-light">
<div class="col-5 pr-0 text-left">
MP.Land <span class="small">v.@version</span>
</div>
<div class="col-7 pl-0 text-right">
<span class="small">@adesso</span>
<a class="text-light" href="https://www.egalware.com/" target="_blank">Egalware<img class="img-fluid" width="16" src="img/LogoBlu.svg" /></a>
</div>
</div>
@code {
protected DateTime adesso = DateTime.Now;
Version version = typeof(Program).Assembly.GetName().Version;
}
+84
View File
@@ -0,0 +1,84 @@
@using MP.Land.Components
@using System.Security.Claims
@*@using Microsoft.AspNetCore.Components.Authorization*@
@using MP.Land.Data
@inject MessageService AppMessages
@*@inject AuthenticationStateProvider AuthenticationStateProvider*@
<div class="form-row pt-3">
<div class="col-7 col-md-6 col-lg-4 col-xl-3">
@*<LoginDisplay></LoginDisplay>*@
@*<i class="fas fa-user-alt"></i> <b>@userName</b>*@
</div>
<div class="col-12 col-lg-4 col-xl-6 d-none d-lg-block text-center h4 text-truncate">
<span class="@PageIcon" aria-hidden="true"></span> @PageName
</div>
<div class="col-5 col-md-6 col-lg-4 col-xl-3 text-right">
@if (ShowSearch)
{
<SearchMod></SearchMod>
}
</div>
</div>
@code {
//[CascadingParameter]
//private Task<AuthenticationState> AuthenticationStateTask { get; set; }
[CascadingParameter(Name = "ShowSearch")]
private bool ShowSearch { get; set; }
private string userName = "";
private string PageName { get; set; }
private string PageIcon { get; set; }
protected override async Task OnInitializedAsync()
{
await forceReload();
}
protected override void OnInitialized()
{
AppMessages.EA_PageUpdated += OnPageUpdate;
}
public void OnPageUpdate()
{
PageName = AppMessages.PageName;
PageIcon = AppMessages.PageIcon;
InvokeAsync(() =>
{
StateHasChanged();
});
}
public void Dispose()
{
AppMessages.EA_PageUpdated -= OnPageUpdate;
}
private async Task forceReload()
{
userName = "N.A.";
await Task.Delay(1);
#if false
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
var user = authState.User;
if (user.Identity.IsAuthenticated)
{
userName = $"{user.Identity.Name}";
}
else
{
userName = "N.A.";
}
#endif
}
}
@* // Vedere anche:
// https://docs.microsoft.com/en-us/aspnet/core/blazor/security/?view=aspnetcore-5.0#:~:text=Blazor%20uses%20the%20existing%20ASP.NET%20Core%20authentication%20mechanisms,all%20client-side%20code%20can%20be%20modified%20by%20users
// https://docs.microsoft.com/en-us/aspnet/core/blazor/security/?view=aspnetcore-5.0*@
+54
View File
@@ -0,0 +1,54 @@
<div class="row">
<div class="col-12 col-lg-9 text-left">
<div class="row">
<div class="col-12 small">
@if (totalCount > 0)
{
<ul class="pagination pagination-sm mb-1">
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(1)"><i class="fas fa-angle-double-left"></i></button></li>
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(prevBlock)"><i class="fas fa-angle-left"></i></button></li>
@for (int i = @startPage; i <= endPage; ++i)
{
var pageNum = i;
<li class="page-item @cssActive(pageNum)"><button class="page-link" @onclick="() => PaginationItemClick(pageNum)">@pageNum</button></li>
}
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(nextBlock)"><i class="fas fa-angle-right"></i></button></li>
<li class="page-item"><button class="page-link" @onclick="() => PaginationItemClick(LastPage)"><i class="fas fa-angle-double-right"></i></button></li>
</ul>
}
</div>
</div>
<div class="row">
<div class="col-12 small">
@if (showLoading)
{
<div class="progress" style="height: 10px;">
<div class="progress-bar progress-bar-striped progress-bar-animated" style="width:@percLoading%;"></div>
</div>
}
</div>
</div>
</div>
<div class="col-12 col-lg-3">
<div class="d-flex">
<div class="p-1 flex-fill text-right">
@if (!showLoading)
{
<span>@totalCount records</span>
}
</div>
<div class="p-1 flex-fill text-right small">
@if (totalCount > 0)
{
<div class="input-group input-group-sm">
<select @bind="@PageSize" class="form-control form-control-sm">
<option value="2">2</option>
<option value="4">4</option>
<option value="10">10</option>
</select>
</div>
}
</div>
</div>
</div>
</div>
+189
View File
@@ -0,0 +1,189 @@
using Microsoft.AspNetCore.Components;
using System;
using System.Threading.Tasks;
namespace MP.Land.Components
{
public partial class DataPager : ComponentBase
{
#region Protected Fields
protected bool _showLoading = false;
#endregion Protected Fields
#region Private Properties
private int endPage
{
get
{
int answ = (int)(currPage / numPages) * numPages + numPages;
answ = answ < LastPage ? answ : LastPage;
return answ;
}
}
private int LastPage
{
get
{
return Math.Max((int)Math.Ceiling(totalCount / (double)PageSize), 1);
}
}
private int nextBlock
{
get
{
int answ = currPage + numPages;
answ = answ < LastPage ? answ : LastPage;
return answ;
}
}
private int numPages { get; set; } = 10;
private int prevBlock
{
get
{
int answ = currPage - numPages;
answ = answ > 0 ? answ : 1;
return answ;
}
}
// calcola un set 1 .. numPages centrato sulla pagina corrente...
private int startPage
{
get
{
int answ = (int)(currPage / numPages) * numPages;
answ = answ > 0 ? answ : 1;
return answ;
}
}
#endregion Private Properties
#region Protected Properties
protected int _numPage { get; set; } = 1;
protected int _numRecord { get; set; } = 4;
protected int percLoading { get; set; } = 0;
#endregion Protected Properties
#region Public Properties
[Parameter]
public int currPage
{
get
{
return _numPage;
}
set
{
bool doReport = !_numPage.Equals(value);
if (doReport)
{
_numPage = value;
reportChangePage();
}
}
}
[Parameter]
public EventCallback<int> numPageChanged { get; set; }
[Parameter]
public EventCallback<int> numRecordChanged { get; set; }
[Parameter]
public int PageSize
{
get
{
return _numRecord;
}
set
{
bool doReport = !_numRecord.Equals(value);
if (doReport)
{
_numRecord = value;
reportChange();
}
}
}
[Parameter]
public bool showLoading
{
get
{
return _showLoading;
}
set
{
if (value)
{
Random random = new Random();
percLoading = random.Next(30, 90);
}
else
{
percLoading = 5;
}
_showLoading = value;
}
}
[Parameter]
public int totalCount { get; set; } = 0;
#endregion Public Properties
#region Private Methods
private void reportChange()
{
numRecordChanged.InvokeAsync(PageSize);
}
private void reportChangePage()
{
numPageChanged.InvokeAsync(currPage);
}
#endregion Private Methods
#region Protected Methods
protected string cssActive(int numPage)
{
string answ = "";
if (numPage == currPage)
{
answ = "active";
}
return answ;
}
protected override async Task OnInitializedAsync()
{
await Task.Run(() => showLoading = false);
}
protected void PaginationItemClick(int page)
{
currPage = page;
}
#endregion Protected Methods
}
}
+154
View File
@@ -0,0 +1,154 @@
@using MP.Land.Data
@using System.Text
@using DiffMatchPatch
<div class="row">
<div class="col-6 table-success">
<div class="row">
<div class="col-4 text-success">
<h4>Archivio</h4>
</div>
<div class="col-4">
</div>
<div class="col-4 text-right">
<input @bind="@pHeight" class="text-right" width="20" inputmode="numeric" /> <i class="fas fa-arrows-alt-v"></i>
</div>
</div>
</div>
@if (numChanges > 0)
{
<div class="col-6 table-danger">
<div class="row">
<div class="col-4 text-danger">
<h4>Attuale</h4>
</div>
<div class="col-4">
</div>
<div class="col-4 text-right p-2">
<span class="border border-danger table-danger py-1 px-2"><b>@numChanges</b> modifiche</span>
</div>
</div>
</div>
}
</div>
<div class="row" style="height: @(pHeight)em; overflow-y: scroll;">
<div class="col-6 table-success">
<div class="border border-success p-2 bg-light">
<p>@((MarkupString)oldResult)</p>
</div>
</div>
@if (numChanges > 0)
{
<div class="col-6 table-danger">
<div class="border border-danger p-2 bg-light">
<p>@((MarkupString)newResult)</p>
</div>
</div>
}
</div>
@code {
string sepDest = "<br />";
protected int pHeight = 25;
protected string oldResult = "";
protected string newResult = "";
protected string _oldText = "";
protected string _newText = "";
[Parameter]
public EventCallback<int> diffDone { get; set; }
protected int numChanges { get; set; } = 0;
[Parameter]
public string oldText
{
get
{
return _oldText;
}
set
{
_oldText = value;
}
}
protected string oldTextFix
{
get
{
return _oldText.Replace(Environment.NewLine, sepDest).Replace("\n", sepDest).Replace("\r", sepDest);
}
}
protected string newTextFix
{
get
{
return _newText.Replace(Environment.NewLine, sepDest).Replace("\n", sepDest).Replace("\r", sepDest);
}
}
[Parameter]
public string newText
{
get
{
return _newText;
}
set
{
_newText = value;
ReloadData();
}
}
protected void ReloadData()
{
numChanges = 0;
// calcolo diff
diff_match_patch dmp = new diff_match_patch();
List<Diff> diff = dmp.diff_main(oldTextFix, newTextFix);
dmp.diff_cleanupSemantic(diff);
// predispongo la stringa secondo l'elenco dei diff....
StringBuilder sbNew = new StringBuilder();
StringBuilder sbOld = new StringBuilder();
foreach (var item in diff)
{
switch (item.operation)
{
case Operation.DELETE:
sbOld.Append($"<span class=\"border border-success table-success\">{item.text}</span>");
break;
case Operation.INSERT:
sbNew.Append($"<span class=\"border border-danger table-danger\">{item.text}</span>");
numChanges++;
break;
case Operation.EQUAL:
sbNew.Append($"<span class=\"text-dark\">{item.text}</span>");
sbOld.Append($"<span class=\"text-dark\">{item.text}</span>");
break;
default:
break;
}
}
newResult = sbNew.ToString().Trim();
oldResult = sbOld.ToString().Trim();
var pUpd = Task.Run(async () =>
{
await diffDone.InvokeAsync(numChanges);
});
pUpd.Wait();
}
protected override Task OnInitializedAsync()
{
ReloadData();
return base.OnInitializedAsync();
}
}
+86
View File
@@ -0,0 +1,86 @@
@using MP.AppAuth.Models
@using MP.Land.Data
@using Microsoft.Extensions.Configuration
@inject IConfiguration Configuration
@inject AppAuthService DataService
<div class="card">
<div class="card-header">
@if (authOk())
{
<a target="_blank" href="@(fullUrl(CurrItem.AppUrl))" class="text-info" title="Apri">
<h3 class="mb-0">@CurrItem.AppName&nbsp;<i class="fas fa-link"></i></h3>
</a>
}
else
{
<del>
<h3 class="mb-0 text-secondary">@CurrItem.AppName</h3>
</del>
}
</div>
<div class="card-body pb-0">
<div class="row">
@if (authOk())
{
<div class="col-3 text-info">
<i class="@(traduci($"{CurrItem.AppName}-ICON"))"></i>
</div>
<div class="col-9" style="overflow-y: auto; height: 8em;">
<b>@(traduci($"{CurrItem.AppName}-TITLE"))</b>
<ul style="mb-0">
@(traduci($"{CurrItem.AppName}-LIST"))
</ul>
</div>
}
else
{
<div class="col-3 text-secondary">
<i class="@(traduci($"{CurrItem.AppName}-ICON"))"></i>
</div>
<div class="col-9 text-secondary" style="overflow-y: auto; height: 8em;">
<b>@(traduci($"{CurrItem.AppName}-TITLE"))</b>
<ul style="mb-0">
@(traduci($"{CurrItem.AppName}-LIST"))
</ul>
</div>
}
</div>
</div>
<div class="card-footer text-danger py-1">
@if (authOk())
{
<span class="text-success">Programma Attivato</span>
}
else
{
<span class="text-danger">Licenza non attivata!</span>
}
</div>
</div>
@code {
[Parameter]
public UpdMan CurrItem { get; set; }
protected bool authOk()
{
bool answ = !string.IsNullOrEmpty(CurrItem.LicenseKey);
return answ;
}
protected string fullUrl(string relUrl)
{
return $"{Configuration["BaseUrl"]}{relUrl}";
}
protected MarkupString traduci(string lemma)
{
MarkupString answ;
string rawHtml = DataService.Traduci(lemma, "IT");
answ = new MarkupString(rawHtml);
return answ;
}
}
+7
View File
@@ -0,0 +1,7 @@
@*<h1 class="alert alert-info">Working</h1>*@
<div class="row">
<div class="col-12 text-center mt-5 py-5 alert alert-primary">
<h3>loading data</h3>
<i class="fas fa-spinner fa-spin fa-5x"></i>
</div>
</div>
+61
View File
@@ -0,0 +1,61 @@
@using Microsoft.AspNetCore.Components.Authorization
@inject AuthenticationStateProvider AuthenticationStateProvider
<AuthorizeView>
<Authorized>
<div class="input-group text-truncate">
<div class="input-group-prepend">
<a title="LogOut" href="Identity/Account/LogOut" class="btn btn-sm btn-danger"><i class="fas fa-sign-out-alt"></i></a>
</div>
<a title="Gestione account @userName" href="Identity/Account/Manage" class="btn btn-sm btn-outline-dark mx-0 px-1">
<div class="d-none d-sm-block">
<i class="fas fa-user-alt"></i> @StringLim(userName, 30)
</div>
<div class="d-block d-sm-none">
<i class="fas fa-user-alt"></i> @StringLim(userName, 15)
</div>
</a>
</div>
</Authorized>
<NotAuthorized>
<div class="input-group">
<div class="input-group-prepend">
<a title="LogIn" href="Identity/Account/LogIn" class="btn btn-sm btn-success"><i class="fas fa-sign-in-alt"></i></a>
</div>
<div class="form-control form-control-sm">
<i class="fas fa-user-alt"></i>&nbsp;@userName
</div>
</div>
</NotAuthorized>
</AuthorizeView>
@code{
private string userName = "";
protected override async Task OnInitializedAsync()
{
await forceReload();
}
private async Task forceReload()
{
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
var user = authState.User;
if (user.Identity.IsAuthenticated)
{
userName = $"{user.Identity.Name}";
}
else
{
userName = "Non Autenticato";
}
}
protected string StringLim(string original, int maxLen)
{
return original.Length <= maxLen ? original : $"{original.Substring(0, maxLen - 3)}...";
}
}
+43
View File
@@ -0,0 +1,43 @@
@using MP.Land.Components
@using MP.Land.Data
@using Majorsoft.Blazor.Components.Debounce
@inject MessageService MessageService
<div class="input-group input-group-sm">
<DebounceInput id="sVal" class="form-control" placeholder="@("Ricerca libera")" autocomplete="off" @ref="debInput" @bind-Value="@_searchVal" @bind-Value:event="OnInput" DebounceTime="@_debMsec" MinLength="@_minChar" OnValueChanged="e => { searchVal = e; }" ForceNotifyByEnter="true" ForceNotifyOnBlur="true" />
<div class="input-group-append">
<button @onclick="reset" class="btn btn-success input-group-text">reset</button>
</div>
</div>
@code {
private string _searchVal = "";
private int _debMsec = 300;
private int _minChar = 0;
private DebounceInput debInput;
[Parameter]
public string searchVal
{
get
{
return MessageService.SearchVal;
}
set
{
if (!MessageService.SearchVal.Equals(value))
{
MessageService.SearchVal = value;
}
}
}
private void reset()
{
_searchVal = "";
searchVal = "";
}
}
+14
View File
@@ -0,0 +1,14 @@
<div class="row text-center">
@if (authOk())
{
<div class="col-12 mt-2">
<h3 class="mb-0">@CurrItem.AppName&nbsp;<i class="fas fa-download"></i></h3>
</div>
<div class="col-12">
<button class="btn btn-block btn-outline-secondary" @onclick="() => DownloadPack()">@updArgs.CurrentVersion</button>
</div>
<div class="col-12">
@outMessage
</div>
}
</div>
+111
View File
@@ -0,0 +1,111 @@
using Microsoft.AspNetCore.Components;
using MP.AppAuth;
using MP.AppAuth.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using MP.Land.Data;
using System.Diagnostics;
namespace MP.Land.Components
{
public partial class SingleDownload
{
#region Protected Fields
protected string outMessage = "";
protected UpdateInfoEventArgs updArgs = new UpdateInfoEventArgs();
protected UpdateMan updateManAuth = new UpdateMan("SWDownloader", "viaD@nte16");
#endregion Protected Fields
#region Protected Properties
[Inject]
protected IConfiguration Configuration { get; set; }
[Inject]
protected AppAuthService DataService { get; set; }
#endregion Protected Properties
#region Public Properties
[Parameter]
public UpdMan CurrItem { get; set; }
#endregion Public Properties
#region Protected Methods
protected bool authOk()
{
bool answ = !string.IsNullOrEmpty(CurrItem.LicenseKey);
return answ;
}
/// <summary>
/// effettua download del pacchetto indicato
/// </summary>
protected void DownloadPack()
{
long size = 0;
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
if (CurrItem.IsAuth)
{
size = updateManAuth.downloadLatest(CurrItem.ManifestUrl, localPath(CurrItem.LocalRepo), CurrItem.PackName);
}
else
{
size = UpdateMan.obj.downloadLatest(CurrItem.ManifestUrl, localPath(CurrItem.LocalRepo), CurrItem.PackName);
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
if (size > 0)
{
outMessage = $"Scaricati {(double)size / (1024 * 1024):N2} Mb in {ts.TotalSeconds:N2} s";
}
else
{
outMessage = $"Download non riuscito per {CurrItem.AppName}";
}
}
protected string fullUrl(string relUrl)
{
return $"{Configuration["BaseUrl"]}{relUrl}";
}
protected string localPath(string localRepo)
{
return @$"{Configuration["downloadPath"]}\{localRepo}\{Configuration["appVers"]}"; ;
}
protected override void OnInitialized()
{
// Recupero info ADM...
if (CurrItem.IsAuth)
{
updArgs = updateManAuth.getUpdateInfo(CurrItem.ManifestUrl);
}
else
{
updArgs = UpdateMan.obj.getUpdateInfo(CurrItem.ManifestUrl);
}
}
protected MarkupString traduci(string lemma)
{
MarkupString answ;
string rawHtml = DataService.Traduci(lemma, "IT");
answ = new MarkupString(rawHtml);
return answ;
}
#endregion Protected Methods
}
}
+68
View File
@@ -0,0 +1,68 @@
@using MP.AppAuth.Models
@inject IJSRuntime JSRuntime
<div class="card">
<div class="card-header py-2 font-weight-bold">
<div class="row">
<div class="col-4 col-md-4">
<div class="badge badge-pill badge-dark px-2 py-1">
<div class="px-1">
<span>EgalWare <img width="24" class="img-fluid" src="img/LogoBluGreen.png" /></span>
</div>
</div>
</div>
<div class="col-8 text-right">
<h4 class="py-0 mb-0">@Environment</h4>
</div>
</div>
</div>
<div class="card-body px-3">
<div class="row">
<div class="col-6 col-md-4">
<div id="qrCodeImg_@(CurrItem.MatrOpr)"></div>
</div>
<div class="col-6 col-md-8">
<h2><b>@CurrItem.Cognome</b> @CurrItem.Nome</h2>
matr: @CurrItem.MatrOpr
</div>
</div>
</div>
@*<div class="card-footer text-muted py-1">
Card login MAPO-TAB
</div>*@
</div>
@code {
[Parameter]
public AnagraficaOperatori CurrItem { get; set; }
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (!firstRender)
{
await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{CurrItem.MatrOpr}");
await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{CurrItem.MatrOpr}", rawCode);
}
}
[Parameter]
public string BaseUrl { get; set; }
[Parameter]
public string Environment { get; set; }
protected string rawCode
{
get
{
string answ = "";
if (CurrItem != null)
{
answ = $"{BaseUrl}MatrOpr={CurrItem.MatrOpr}&UserAuthKey={CurrItem.AuthKey}";
}
return answ;
}
}
}
+1
View File
@@ -0,0 +1 @@

+29
View File
@@ -0,0 +1,29 @@
{
"ExcludedTags": [
"M4",
"M5",
"M4+A",
"M4+B",
"M5+A",
"M5+B"
],
"ExcludedFileExt": [
".xls",
".xls#",
".xlsx"
],
"FileNameExtReplace": {
".P-2": ""
},
"MaxChar2Search": 100,
"Mode": 0,
"Name": "Tag da Commento Filename",
"OutExcludeFileName": true,
"OutReplace": {
"(": " ",
")": " "
},
"RegExPattern": "\\b{{fileName}}.{0,2}\\([\\w\\d\\s./\\-=]+\\)",
"RegExRepFileName": true,
"ReplaceCR": true
}
+23
View File
@@ -0,0 +1,23 @@
{
"ExcludedTags": [],
"ExcludedFileExt": [
".xls",
".xls#",
".xlsx"
],
"FileNameExtReplace": {
".P-2": ""
},
"MaxChar2Search": 1,
"Mode": 1,
"Name": "Tag da Directory + Filename",
"OutExcludeFileName": false,
"OutReplace": {
".WPD": "",
".MPF": "",
".SPF": ""
},
"RegExPattern": "",
"RegExRepFileName": true,
"ReplaceCR": false
}
+35
View File
@@ -0,0 +1,35 @@
{
"ExcludedTags": [
"M4",
"M5",
"M4+A",
"M4+B",
"M5+A",
"M5+B",
"M6+A",
"M6+B",
"+A"
],
"ExcludedFileExt": [
".xls",
".xls#",
".xlsx"
],
"FileNameExtReplace": {
".P-2": "",
".tim": ""
},
"MaxChar2Search": 100,
"Mode": 0,
"Name": "Tag da Commento Filename Tornoss TISIS",
"OutExcludeFileName": true,
"OutReplace": {
"(": " ",
")": " ",
"<": " ",
">": " "
},
"RegExPattern": "\\b{{fileName}}.{0,2}\\([\\<\\w\\d\\s./\\-=\\+\\>]+\\)",
"RegExRepFileName": true,
"ReplaceCR": true
}
+175
View File
@@ -0,0 +1,175 @@
using Microsoft.Extensions.Configuration;
using System;
using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using NLog;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Caching.Memory;
using System.Diagnostics;
using System.Text;
using Newtonsoft.Json;
namespace MP.Land.Data
{
public class AppAuthService : IDisposable
{
#region Private Fields
private static IConfiguration _configuration;
private static ILogger<AppAuthService> _logger;
private static List<MP.AppAuth.Models.Macchine> ElencoMacchine = new List<MP.AppAuth.Models.Macchine>();
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private readonly IDistributedCache distributedCache;
private readonly IMemoryCache memoryCache;
/// <summary>
/// Durata assoluta massima della cache
/// </summary>
private int chAbsExp = 15;
/// <summary>
/// Durata della cache in modalità inattiva (non acceduta) prima di venire rimossa
/// NON estende oltre il tempo massimo di validità della cache (chAbsExp)
/// </summary>
private int chSliExp = 5;
private Dictionary<string, string> Vocabolario = new Dictionary<string, string>();
#endregion Private Fields
#region Public Fields
public static AppAuth.Controllers.AppAuthController dbController;
#endregion Public Fields
#region Public Constructors
public AppAuthService(IConfiguration configuration, ILogger<AppAuthService> logger, IMemoryCache memoryCache, IDistributedCache distributedCache)
{
_logger = logger;
_configuration = configuration;
// conf cache
this.memoryCache = memoryCache;
this.distributedCache = distributedCache;
// conf DB
string connStr = _configuration.GetConnectionString("MP.Land");
if (string.IsNullOrEmpty(connStr))
{
_logger.LogError("ConnString empty!");
}
else
{
dbController = new AppAuth.Controllers.AppAuthController(configuration);
_logger.LogInformation("DbController OK");
}
}
#endregion Public Constructors
#region Private Properties
private DistributedCacheEntryOptions cacheOpt
{
get
{
return new DistributedCacheEntryOptions().SetAbsoluteExpiration(DateTime.Now.AddMinutes(chAbsExp)).SetSlidingExpiration(TimeSpan.FromMinutes(chSliExp));
}
}
private DistributedCacheEntryOptions cacheOptLong
{
get
{
return new DistributedCacheEntryOptions().SetAbsoluteExpiration(DateTime.Now.AddMinutes(chAbsExp * 10)).SetSlidingExpiration(TimeSpan.FromMinutes(chSliExp));
}
}
#endregion Private Properties
#region Protected Methods
protected void CheckVoc()
{
string cacheKey = ":MP:VOCAB";
string rawData;
if (Vocabolario.Count == 0)
{
var redisDataList = distributedCache.Get(cacheKey);
if (redisDataList != null)
{
rawData = Encoding.UTF8.GetString(redisDataList);
Vocabolario = JsonConvert.DeserializeObject<Dictionary<string, string>>(rawData);
}
else
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
Vocabolario = dbController.VocabolarioGetAll().ToDictionary(x => $"{x.Lingua}#{x.Lemma}", x => x.Traduzione);
rawData = JsonConvert.SerializeObject(Vocabolario);
redisDataList = Encoding.UTF8.GetBytes(rawData);
distributedCache.Set(cacheKey, redisDataList, cacheOptLong);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuato rilettura da DB + caching per Vocabolario: {ts.TotalMilliseconds} ms");
}
}
}
#endregion Protected Methods
#region Public Methods
public async Task<List<AppAuth.Models.AnagraficaOperatori>> AnagOperList(string searchVal)
{
List<AppAuth.Models.AnagraficaOperatori> dbResult = new List<AppAuth.Models.AnagraficaOperatori>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = dbController.AnagOpGetAll(searchVal);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per AnagOperList: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
public void Dispose()
{
// Clear database controller
dbController.Dispose();
}
public string Traduci(string lemma, string lingua = "IT")
{
string answ = $"__{lemma}__";
string keyReq = $"{lingua}#{lemma}";
CheckVoc();
// cerco in vocabolario...
if (Vocabolario.ContainsKey(keyReq))
{
answ = Vocabolario[keyReq];
}
return answ;
}
public async Task<List<AppAuth.Models.UpdMan>> UpdManList()
{
List<AppAuth.Models.UpdMan> dbResult = new List<AppAuth.Models.UpdMan>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = dbController.UpdManGetAll();
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per UpdManList: {ts.TotalMilliseconds} ms");
return await Task.FromResult(dbResult);
}
#endregion Public Methods
}
}
+17
View File
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace MP.Land.Data
{
public class AutocompleteModel
{
#region Public Properties
public string LabelField { get; set; }
public string ValueField { get; set; }
#endregion Public Properties
}
}
+155
View File
@@ -0,0 +1,155 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Timers;
namespace MP.Land.Data
{
public class MessageService
{
#region Private Fields
private string _pageIcon;
private string _pageName;
private string _searchVal = "";
private SelectData _selFilter = SelectData.Init(4, 15);
private bool showSearch;
#endregion Private Fields
#region Public Events
public event Action EA_FilterUpdated;
public event Action EA_HideSearch;
public event Action EA_PageUpdated;
public event Action EA_SearchUpdated;
public event Action EA_ShowSearch;
#endregion Public Events
#region Public Properties
public string PageIcon
{
get => _pageIcon;
set
{
if (_pageIcon != value)
{
_pageIcon = value;
ReportPageUpd();
}
}
}
public string PageName
{
get => _pageName;
set
{
if (_pageName != value)
{
_pageName = value;
ReportPageUpd();
}
}
}
public string SearchVal
{
get => _searchVal;
set
{
if (_searchVal != value)
{
_searchVal = value;
ReportSearch();
}
}
}
public SelectData SelFilter
{
get => _selFilter;
set
{
if (_selFilter != value)
{
_selFilter = value;
ReportFilter();
}
}
}
public bool ShowSearch
{
get => showSearch;
set
{
if (showSearch != value)
{
showSearch = value;
if (showSearch)
{
ReportShowSearch();
}
else
{
ReportHideSearch();
}
}
}
}
#endregion Public Properties
#region Private Methods
private void ReportFilter()
{
if (EA_FilterUpdated != null)
{
EA_FilterUpdated?.Invoke();
}
}
private void ReportHideSearch()
{
if (EA_HideSearch != null)
{
EA_HideSearch?.Invoke();
}
}
private void ReportPageUpd()
{
if (EA_PageUpdated != null)
{
EA_PageUpdated?.Invoke();
}
}
private void ReportSearch()
{
if (EA_SearchUpdated != null)
{
EA_SearchUpdated?.Invoke();
}
}
private void ReportShowSearch()
{
if (EA_ShowSearch != null)
{
EA_ShowSearch?.Invoke();
}
}
#endregion Private Methods
}
}
+113
View File
@@ -0,0 +1,113 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace MP.Land.Data
{
public class SelectData
{
#region Public Properties
public DateTime DateEnd { get; set; } = DateTime.Now.AddMinutes(1);
public DateTime DateStart { get; set; } = DateTime.Now.AddDays(-7);
public string FileName { get; set; } = "";
/// <summary>
/// Primo record x selezione paginata, tipicamente primo della "decina" della pagina corrente
/// </summary>
public int FirstRecord
{
get
{
int primaPag = PageNum % 10;
int decina = PageNum - primaPag;
return PageSize * decina + 1;
}
}
public string IdxMacchina { get; set; } = "";
/// <summary>
/// Recorda da saltare x arrivare alla pagina corrente
/// </summary>
public int NumSkip
{
get
{
return PageSize * (PageNum - 1);
}
}
public bool OnlyActive { get; set; } = true;
public bool OnlyMod { get; set; } = false;
public bool OnlyNoTag { get; set; } = false;
public int PageNum { get; set; } = 1;
public int PageSize { get; set; } = 4;
public string SearchVal { get; set; } = "";
public string Tag { get; set; } = "";
#endregion Public Properties
#region Public Methods
/// <summary>
/// Inizializzazione con periodo e arrotondamento
/// </summary>
/// <param name="minRound"></param>
/// <param name="numDayPrev"></param>
/// <returns></returns>
public static SelectData Init(int minRound, int numDayPrev)
{
TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today);
int minDay = (int)((DayElapsed.TotalMinutes / minRound) + 1) * minRound;
DateTime endRounded = DateTime.Today.AddMinutes(minDay);
SelectData answ = new SelectData()
{
DateEnd = endRounded,
DateStart = endRounded.AddDays(-numDayPrev),
SearchVal = ""
};
return answ;
}
public override bool Equals(object obj)
{
if (!(obj is SelectData item))
return false;
if (PageSize != item.PageSize)
return false;
if (PageNum != item.PageNum)
return false;
if (OnlyActive != item.OnlyActive)
return false;
if (OnlyMod != item.OnlyMod)
return false;
if (OnlyNoTag != item.OnlyNoTag)
return false;
if (SearchVal != item.SearchVal)
return false;
if (FileName != item.FileName)
return false;
if (IdxMacchina != item.IdxMacchina)
return false;
if (Tag != item.Tag)
return false;
if (DateEnd != item.DateEnd)
return false;
if (DateStart != item.DateStart)
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
#endregion Public Methods
}
}
@@ -0,0 +1,39 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.WebUtilities;
namespace MP.Land.Extensions
{
public static class NavigationManagerExtension
{
#region Public Methods
/// <summary>
/// Estensione metodo NavigationManager
///
/// https://code-maze.com/query-strings-blazor-webassembly/
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="navManager"></param>
/// <param name="key"></param>
/// <returns></returns>
public static T ExtractQueryStringByKey<T>(this NavigationManager navManager, string key)
{
var uri = navManager.ToAbsoluteUri(navManager.Uri);
QueryHelpers.ParseQuery(uri.Query)
.TryGetValue(key, out var queryValue);
if (typeof(T).Equals(typeof(int)))
{
int.TryParse(queryValue, out int result);
return (T)(object)result;
}
if (typeof(T).Equals(typeof(string)))
return (T)(object)queryValue.ToString();
return default;
}
#endregion Public Methods
}
}
+56
View File
@@ -0,0 +1,56 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>MP.Land</RootNamespace>
<Version>1.1.2109.2118</Version>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Components\ArchiveStatus.razor.cs" />
<Compile Remove="Components\FileEditor.razor.cs" />
<Compile Remove="Components\TagSearch.razor.cs" />
<Compile Remove="Data\FileArchDataService.cs" />
<Compile Remove="Pages\Archive.razor.cs" />
<Compile Remove="Pages\Setup.razor.cs" />
</ItemGroup>
<ItemGroup>
<Content Remove="Components\ArchiveStatus.razor" />
<Content Remove="Components\CodArtSelector.razor" />
<Content Remove="Components\FileEditor.razor" />
<Content Remove="Components\TagSearch.razor" />
<Content Remove="Pages\Archive.razor" />
<Content Remove="Pages\Setup.razor" />
</ItemGroup>
<ItemGroup>
<None Include="wwwroot\lib\index.svg" />
<None Include="wwwroot\lib\jquery.min.js" />
<None Include="wwwroot\lib\LICENSE" />
<None Include="wwwroot\lib\qrcode.js" />
<None Include="wwwroot\lib\qrcode.min.js" />
<None Include="wwwroot\lib\README.md" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="DiffMatchPatch" Version="1.0.3" />
<PackageReference Include="Majorsoft.Blazor.Components.Debounce" Version="1.5.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.10">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.14.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MP.AppAuth\MP.AppAuth.csproj" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
</Target>
</Project>
+46
View File
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="true"
throwExceptions="false"
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
<!-- optional, add some variables
https://github.com/nlog/NLog/wiki/Configuration-file#variables
-->
<variable name="myvar" value="myvalue" />
<!--
See https://github.com/nlog/nlog/wiki/Configuration-file
for information on customizing logging rules and outputs.
-->
<targets>
<!--
add your targets here
See https://github.com/nlog/NLog/wiki/Targets for possible targets.
See https://github.com/nlog/NLog/wiki/Layout-Renderers for the possible layout renderers.
-->
<!--
Write events to a file with the date in the filename.
<target xsi:type="File" name="f" fileName="${basedir}/logs/${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message}" />
-->
<target xsi:type="File" name="fileTarget" fileName="${basedir}/logs/${shortdate}.log" layout="${longdate} | ${uppercase:${level}} | ${logger:shortName=false} | ${message}" />
<target xsi:type="ColoredConsole" name="consoleTarget" layout="${longdate} | ${uppercase:${level}} | ${logger:shortName=true}| ${message}" />
</targets>
<rules>
<!-- add your logging rules here -->
<!--
Write all events with minimal level of Debug (So Debug, Info, Warn, Error and Fatal, but not Trace) to "f"
<logger name="*" minlevel="Debug" writeTo="f" />
-->
<logger name="*" minlevel="Trace" writeTo="consoleTarget" />
<!--<logger name="Microsoft.*" maxlevel="Info" final="true" />-->
<logger name="*" minlevel="Info" writeTo="fileTarget" />
</rules>
</nlog>
+55
View File
@@ -0,0 +1,55 @@
@page "/About"
@using MP.Land.Data
@inject MessageService AppMService
<div class="row mx-2">
<div class="col-12 col-lg-8 offset-lg-2">
<div class="card">
<div class="card-header text-center">
<div class="row">
<div class="col-4"></div>
<div class="col-4">
<h2>@Titolo</h2>
</div>
<div class="col-4">
<div class="badge badge-pill badge-dark px-4 py-2">
<div class="px-1">
<a class="text-light" href="https://www.egalware.com/" target="_blank">powered by&nbsp;EgalWare <img width="24" class="img-fluid" src="img/LogoBluGreen.png" /></a>
</div>
</div>
</div>
</div>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-3"></div>
<div class="col-12 col-lg-6 py-3">
<img src="img/LogoMapoFull.png" class="img-fluid" />
</div>
<div class="col-lg-3"></div>
<div class="col-12">
<h4 class="card-title">@Messaggio</h4>
<p>MoonPro / MAPO sono una suite di applicazioni e dispositivi hw dedicati per l'IOT,l'industry 4.0 e la gestione automatizzata dei processi produttivi.</p>
<p>Per maggiori informazioni <a href="http://www.steamware.net/iot" target="_blank">visita il link</a> sul nostro sito.</p>
</div>
</div>
</div>
</div>
</div>
</div>
@code {
protected string Titolo = "";
protected string Messaggio = "";
protected override void OnInitialized()
{
Titolo = "MES | SCADA | IOT";
Messaggio = "Soluzione integrata per la gestione della produzione";
AppMService.ShowSearch = false;
AppMService.PageName = "About";
AppMService.PageIcon = "fas fa-info-circle pr-2";
}
}
+85
View File
@@ -0,0 +1,85 @@
@page "/Contacts"
@using MP.Land.Data
@inject MessageService AppMService
<div class="row mx-2">
<div class="col-12 col-lg-8 offset-lg-2">
<div class="card">
<div class="card-header text-center">
<div class="row">
<div class="col-4"></div>
<div class="col-4">
<h2>@Titolo</h2>
</div>
<div class="col-4">
<div class="badge badge-pill badge-dark px-4 py-2">
<div class="px-1">
<a class="text-light" href="https://www.egalware.com/" target="_blank">powered by&nbsp;EgalWare <img width="24" class="img-fluid" src="img/LogoBluGreen.png" /></a>
</div>
</div>
</div>
</div>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-3"></div>
<div class="col-12 col-lg-6 py-3">
<img src="img/LogoMapoFull.png" class="img-fluid" />
</div>
<div class="col-lg-3"></div>
<div class="col-12">
<h4 class="card-title">@Messaggio</h4>
</div>
<div class="col-sm-4">
<h4>Sede Operativa</h4>
<address>
<strong>EgalWare s.r.l.</strong><br />
via Nazionale, 93<br />
24068 Seriate - BG<br />
<abbr title="Phone">P:</abbr>
035.290178<br />
<abbr title="Phone">P:</abbr>
035.460560
</address>
</div>
<div class="col-sm-4">
<h4>Sede Legale</h4>
<address>
<strong>EgalWare s.r.l.</strong><br />
via Nazionale, 93<br />
24068 Seriate - BG<br />
<br />
<abbr title="P.Iva">VAT:</abbr>03985390164
</address>
</div>
<div class="col-sm-4">
<h4>Supporto</h4>
<address>
<strong>Web:</strong><br />
Accedi al supporto dal <a href="https://support.egalware.com/" target="_blank">nostro sito web</a><br />
<br />
<strong>Email:</strong><br />
Scrivi un email a <a href="mailto:info@egalware.com">info at egalware.com</a>
</address>
</div>
</div>
</div>
</div>
</div>
</div>
@code {
protected string Titolo = "";
protected string Messaggio = "";
protected override void OnInitialized()
{
Titolo = "Mapo MES";
Messaggio = "I nostri contattatti e siti di supporto";
AppMService.ShowSearch = false;
AppMService.PageName = "Contacts";
AppMService.PageIcon = "fas fa-envelope pr-2";
}
}
+41
View File
@@ -0,0 +1,41 @@
@page
@model MP.Land.Pages.ErrorModel
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Error</title>
<link href="~/css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="~/css/app.css" rel="stylesheet" />
</head>
<body>
<div class="main">
<div class="content px-4">
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
</div>
</div>
</body>
</html>
+48
View File
@@ -0,0 +1,48 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
namespace MP.Land.Pages
{
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
[IgnoreAntiforgeryToken]
public class ErrorModel : PageModel
{
#region Private Fields
private readonly ILogger<ErrorModel> _logger;
#endregion Private Fields
#region Public Constructors
public ErrorModel(ILogger<ErrorModel> logger)
{
_logger = logger;
}
#endregion Public Constructors
#region Public Properties
public string RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
#endregion Public Properties
#region Public Methods
public void OnGet()
{
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
#endregion Public Methods
}
}
+49
View File
@@ -0,0 +1,49 @@
@page "/"
@using MP.Land.Data
@using MP.Land.Components
<div class="alert alert-secondary">
<div class="row">
<div class="col-12 col-md-9">
<h1>MAPO Land</h1>
<div>
Pannello di gestione della <a href="https://steamware.net/prodotti/iot/" target="_blank">suite MAPO MES</a>: l'integrazione di MES + SCADA + IOT + Gestione Commesse
</div>
</div>
<div class="col-12 col-md-3 text-center">
<div class="h2">
MES Suite
</div>
<div class="badge badge-pill badge-dark px-4 py-2">
<div class="px-1">
<a class="text-light" href="https://www.egalware.com/" target="_blank">powered by&nbsp;EgalWare <img width="24" class="img-fluid" src="img/LogoBluGreen.png" /></a>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-body">
@if (ListRecords == null)
{
<LoadingData></LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
}
else
{
<div class="row">
@foreach (var item in ListRecords)
{
<div class="col-4 mb-2">
<HomeLink CurrItem="@item"></HomeLink>
</div>
}
</div>
}
</div>
</div>
+67
View File
@@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using MP.Land.Data;
using MP.Land.Components;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Configuration;
using MP.AppAuth.Models;
namespace MP.Land.Pages
{
public partial class Index
{
#region Private Fields
private List<MP.AppAuth.Models.UpdMan> ListRecords;
#endregion Private Fields
#region Protected Fields
protected int totalCount = 0;
#endregion Protected Fields
#region Protected Properties
[Inject]
protected MessageService AppMService { get; set; }
[Inject]
protected AppAuthService DataService { get; set; }
#endregion Protected Properties
#region Protected Methods
protected override void OnInitialized()
{
AppMService.ShowSearch = false;
AppMService.PageName = "Home";
AppMService.PageIcon = "fas fa-home pr-2";
}
protected override async Task OnInitializedAsync()
{
await ReloadAllData();
}
protected async Task ReloadAllData()
{
await ReloadData();
}
protected async Task ReloadData()
{
// importante altrimenti NON mostra update UI
await Task.Delay(1);
ListRecords = await DataService.UpdManList();
totalCount = ListRecords.Count();
await Task.Delay(1);
}
#endregion Protected Methods
}
}
+161
View File
@@ -0,0 +1,161 @@
@page "/SysInfo"
@using MP.AppAuth
@using MP.Land.Data
@using Microsoft.Extensions.Configuration
@inject MessageService AppMService
@inject IConfiguration Configuration
<div class="row mx-2">
<div class="col-12 col-lg-8 offset-lg-2">
<div class="card">
<div class="card-header text-center">
<div class="row">
<div class="col-4"></div>
<div class="col-4">
<h2>@Titolo</h2>
</div>
<div class="col-4">
<div class="badge badge-pill badge-dark px-4 py-2">
<div class="px-1">
<a class="text-light" href="https://www.egalware.com/" target="_blank">powered by&nbsp;EgalWare <img width="24" class="img-fluid" src="img/LogoBluGreen.png" /></a>
</div>
</div>
</div>
</div>
</div>
<div class="card-body">
<div class="row">
<div class="col">
<div id="accordion">
<div class="card">
<div class="card-header text-uppercase btn btn-block" id="heading04">
<h5 class="mb-0">
<asp:LinkButton runat="server" ID="lbtGrp01" class="collapsed" data-toggle="collapse" data-target="#collapse04" aria-expanded="true" aria-controls="collapse04">
Global data
</asp:LinkButton>
</h5>
</div>
<div id="collapse04" class="collapse" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body">
<div class="list-group">
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Environment</h5>
</div>
<p class="mb-1">@Environment</p>
</div>
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Main DB Conf</h5>
</div>
<p class="mb-1">@DbNameExample</p>
</div>
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">.net framework</h5>
</div>
<p class="mb-1">@currHwSwInfo.runtimeImg</p>
</div>
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Main Assembly</h5>
</div>
<p class="mb-1">@currHwSwInfo.mainAssembly</p>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header text-uppercase btn btn-block" id="heading01">
<h5 class="mb-0">
<asp:LinkButton runat="server" ID="LinkButton1" class="collapsed" data-toggle="collapse" data-target="#collapse01" aria-expanded="true" aria-controls="collapse01">
Stats (Server, IIS, APP)
</asp:LinkButton>
</h5>
</div>
<div id="collapse01" class="collapse" aria-labelledby="heading01" data-parent="#accordion">
<div class="card-body">
<div class="list-group">
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Server Stats</h5>
</div>
<p class="mb-1">
<pre>@currHwSwInfo.ServerStats</pre>
</p>
</div>
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">IIS Stats</h5>
</div>
<p class="mb-1">
<pre>@currHwSwInfo.IISStats</pre>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header text-uppercase btn btn-block" id="heading05">
<h5 class="mb-0">
<asp:LinkButton runat="server" ID="lbtGrp02" class="collapsed" data-toggle="collapse" data-target="#collapse05" aria-expanded="false" aria-controls="collapse05">
Other Libraries
</asp:LinkButton>
</h5>
</div>
<div id="collapse05" class="collapse" aria-labelledby="headingTwo" data-parent="#accordion">
<div class="card-body">
<div class="list-group">
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Elenco librerie</h5>
<span>@currHwSwInfo.numLibraries</span>
</div>
<p class="mb-1">
<pre style="width: 100%; white-space: pre-wrap;">@currHwSwInfo.librariesVers</pre>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@code {
// imposto i vari dati da mostrare a video senza indicare come bypassare...
protected string Titolo = "MAPO System Info";
protected string Messaggio = "HW & SW details";
protected HwSwInfo currHwSwInfo = HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly());
protected string DbNameExample
{
get
{
string answ = Configuration["ConnectionStrings:DefaultConnection"];
if (answ.IndexOf(";User ID=") > 0)
{
answ = answ.Substring(0, answ.IndexOf(";User ID="));
}
return answ;
}
}
protected string Environment
{
get
{
string answ = Configuration["Environment"];
return answ;
}
}
//string connStr = memLayer.ML.confReadString("DbConfConnectionString");
//currHwSwInfo = currHwSwInfo;
}
+28
View File
@@ -0,0 +1,28 @@
@page "/Test"
@using Majorsoft.Blazor.Components.Debounce
<h3>Test</h3>
<DebounceInput id="in1" class="form-control w-100" placeholder="@("Digitare almeno " + _minCharsLength + " caratteri")" autocomplete="off"
@ref="input1"
@bind-Value="@_debounceInputValue" @bind-Value:event="OnInput"
DebounceTime="@_debounceMilisec"
MinLength="@_minCharsLength"
OnValueChanged="e => { _notifiedInputValue = e; }"
ForceNotifyByEnter="@_forceNotifyByEnter"
ForceNotifyOnBlur="@_forceNotifyOnBlur" />
<div>Notified value: @_notifiedInputValue</div>
<div>Actual value: @_debounceInputValue</div>
<input type="button" class="btn btn-primary" value="Read out actual value" @onclick="(_ => { _debounceInputValue = input1.Value; })" />
@code {
//DebounceInput
private string _debounceInputValue = "";
private string _notifiedInputValue = "";
private int _debounceMilisec = 200;
private int _minCharsLength = 2;
private bool _forceNotifyByEnter = true;
private bool _forceNotifyOnBlur = true;
private DebounceInput input1;
}
+67
View File
@@ -0,0 +1,67 @@
@page "/UpdateManager"
@using MP.Land.Data
@using MP.Land.Components
<div class="alert alert-secondary">
<div class="row">
<div class="col-12 col-md-3">
<img src="img/LogoMapoFull.png" class="img-fluid" width="200" />
</div>
<div class="col-12 col-md-6 text-center">
<h1>Aggiornamento Moduli</h1>
<div>
<b>Ultime release applicazioni</b>
</div>
<p>Scaricare uno o più pacchetti selezionando dall'elenco riportato.</p>
</div>
<div class="col-12 col-md-3 text-center">
<div class="h2">
ALL Packages <i class="fas fa-download"></i>
</div>
<button class="btn btn-success btn-block" @onclick="() => DownloadAll()">Download ALL Latest</button>
</div>
</div>
</div>
@if (showUpdate)
{
<div class="alert alert-success alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<div class="row">
<div class="col-4">
@outMessages
</div>
<div class="col-8">
@if (showProgress)
{
<div class="progress">
<div class="progress-bar progress-bar-striped progress-bar-animated" style="width:@percLoading%;"></div>
</div>
}
</div>
</div>
</div>
}
<div class="card">
<div class="card-body">
@if (ListRecords == null)
{
<LoadingData></LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
}
else
{
<div class="row">
@foreach (var item in ListRecords)
{
<div class="col-4 mb-2">
<SingleDownload CurrItem="@item"></SingleDownload>
</div>
}
</div>
}
</div>
</div>
+143
View File
@@ -0,0 +1,143 @@
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Configuration;
using MP.AppAuth;
using MP.Land.Data;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
namespace MP.Land.Pages
{
public partial class UpdateManager
{
#region Private Fields
private List<MP.AppAuth.Models.UpdMan> ListRecords;
#endregion Private Fields
#region Protected Fields
protected int numDone = 0;
protected int numTot = 0;
protected int totalCount = 0;
protected double TotalMb = 0;
protected UpdateMan updateManAuth = new UpdateMan("SWDownloader", "viaD@nte16");
#endregion Protected Fields
#region Protected Properties
[Inject]
protected MessageService AppMService { get; set; }
[Inject]
protected IConfiguration Configuration { get; set; }
[Inject]
protected AppAuthService DataService { get; set; }
protected string outMessages { get; set; } = "";
protected int percLoading { get; set; } = 0;
protected bool showProgress { get; set; } = false;
protected bool showUpdate { get; set; } = false;
#endregion Protected Properties
#region Private Methods
private async Task<long> scaricaSingolo(AppAuth.Models.UpdMan item)
{
long size = 0;
if (item.IsAuth)
{
size = updateManAuth.downloadLatest(item.ManifestUrl, localPath(item.LocalRepo), item.PackName);
}
else
{
size = UpdateMan.obj.downloadLatest(item.ManifestUrl, localPath(item.LocalRepo), item.PackName);
}
numDone++;
percLoading = 100 * numDone / numTot;
return await Task.FromResult(size);
}
#endregion Private Methods
#region Protected Methods
/// <summary>
/// Cicla su tutti i record ed effettua il download
/// </summary>
protected async Task DownloadAll()
{
// init progress...
showProgress = true;
showUpdate = true;
outMessages = $"Iniziato download per {numTot} packages";
StateHasChanged();
percLoading = 0;
TotalMb = 0;
numDone = 0;
numTot = ListRecords.Count;
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
// ciclo su tutti
foreach (var item in ListRecords)
{
long size = 0;
size = await scaricaSingolo(item);
TotalMb += (double)size / (1024 * 1024);
outMessages = $"Scaricati {numDone}/{numTot} packages | {TotalMb:N2} Mb";
StateHasChanged();
await Task.Delay(1);
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
outMessages = $"Effettuato download di {numDone} update | {TotalMb:N2} Mb in {ts.TotalSeconds:N2} s";
StateHasChanged();
await Task.Delay(1000);
showProgress = false;
StateHasChanged();
}
protected string localPath(string localRepo)
{
return @$"{Configuration["downloadPath"]}\{localRepo}\{Configuration["appVers"]}"; ;
}
protected override void OnInitialized()
{
AppMService.ShowSearch = false;
AppMService.PageName = "Update Manager";
AppMService.PageIcon = "fas fa-download pr-2";
}
protected override async Task OnInitializedAsync()
{
await ReloadAllData();
}
protected async Task ReloadAllData()
{
await ReloadData();
}
protected async Task ReloadData()
{
// importante altrimenti NON mostra update UI
await Task.Delay(1);
ListRecords = await DataService.UpdManList();
totalCount = ListRecords.Count();
await Task.Delay(1);
}
#endregion Protected Methods
}
}
+31
View File
@@ -0,0 +1,31 @@
@page "/UserQr"
@using MP.Land.Data
@using MP.Land.Components
<div class="card">
<div class="card-body">
@if (ListRecords == null)
{
<LoadingData></LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
}
else
{
<div class="row">
@foreach (var item in ListRecords)
{
<div class="col-6 my-2 userCard">
<UserCard CurrItem="@item" BaseUrl="@BaseUrlTab" Environment="@Environment"></UserCard>
</div>
}
</div>
}
</div>
<div class="card-footer p-1">
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="PagerReloadNum" numPageChanged="PagerReloadPage" totalCount="totalCount" showLoading="isLoading" />
</div>
</div>
+154
View File
@@ -0,0 +1,154 @@
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Configuration;
using MP.AppAuth.Models;
using MP.Land.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace MP.Land.Pages
{
public partial class UserQr : IDisposable
{
#region Private Fields
private List<AnagraficaOperatori> ListRecords;
private List<AnagraficaOperatori> SearchRecords;
#endregion Private Fields
#region Protected Fields
protected string CardMessage = "User Card";
protected int totalCount = 0;
#endregion Protected Fields
#region Private Properties
[Inject]
private IConfiguration Configuration { get; set; }
private int currPage
{
get
{
return AppMService.SelFilter.PageNum;
}
set
{
AppMService.SelFilter.PageNum = value;
}
}
private bool isLoading { get; set; } = false;
private int numRecord
{
get
{
return AppMService.SelFilter.PageSize;
}
set
{
AppMService.SelFilter.PageSize = value;
}
}
#endregion Private Properties
#region Protected Properties
[Inject]
protected MessageService AppMService { get; set; }
protected string BaseUrlTab
{
get => $"{Configuration["BaseUrl"]}{Configuration["QrJumpPath"]}";
}
[Inject]
protected AppAuthService DataService { get; set; }
protected string Environment
{
get => Configuration["Environment"];
}
#endregion Protected Properties
#region Private Methods
private async void OnSeachUpdated()
{
ListRecords = null;
currPage = 1;
await Task.Delay(1);
await ReloadData();
}
#endregion Private Methods
#region Protected Methods
protected override async Task OnInitializedAsync()
{
AppMService.ShowSearch = true;
AppMService.PageName = "User Card";
AppMService.PageIcon = "fas fa-qrcode pr-2";
await ReloadData();
AppMService.EA_SearchUpdated += OnSeachUpdated;
}
protected async Task PagerReloadNum(int newNum)
{
ListRecords = null;
numRecord = newNum;
await ReloadData();
isLoading = false;
}
protected async Task PagerReloadPage(int newNum)
{
ListRecords = null;
currPage = newNum;
await ReloadData();
isLoading = false;
}
protected async Task ReloadData()
{
isLoading = true;
// importante altrimenti NON mostra update UI
await Task.Delay(1);
SearchRecords = await DataService.AnagOperList(AppMService.SearchVal);
ListRecords = SearchRecords.Skip((currPage - 1) * numRecord).Take(numRecord).ToList();
totalCount = SearchRecords.Count();
await Task.Delay(1);
isLoading = false;
StateHasChanged();
}
protected MarkupString traduci(string lemma)
{
MarkupString answ;
//string rawHtml = "<li>primo</li><li>secondo</li>";
string rawHtml = DataService.Traduci(lemma, "IT");
answ = new MarkupString(rawHtml);
// cerco nella cache Redis
return answ;
}
#endregion Protected Methods
#region Public Methods
public void Dispose()
{
AppMService.EA_SearchUpdated -= OnSeachUpdated;
}
#endregion Public Methods
}
}
+75
View File
@@ -0,0 +1,75 @@
@page "/"
@using System.Globalization
@using Microsoft.AspNetCore.Localization
@namespace MP.Land.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
Layout = null;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>MP.Land</title>
<base href="~/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="font-awesome/css/fontawesome.min.css" />
<link href="css/site.css" rel="stylesheet" />
<link href="MP.Land.styles.css" rel="stylesheet" />
</head>
<body>
<component type="typeof(App)" render-mode="Server" />
<div id="blazor-error-ui">
<environment include="Staging,Production">
An error has occurred. This application may no longer respond until reloaded.
</environment>
<environment include="Development">
An unhandled exception has occurred. See browser dev tools for details.
</environment>
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<!-- inside of body section and after the div/app tag -->
<script src="jquery/jquery.min.js"></script>
<script src="popper.js/umd/popper.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="font-awesome/js/all.min.js"></script>
<script src="_framework/blazor.server.js"></script>
<script type="text/javascript" src="~/lib/qrcode.js"></script>
<script type="text/javascript">
function clearContent(elementID) {
console.log(elementID);
document.getElementById(elementID).innerHTML = "";
}
// gestione qrcode... da https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-enable-qrcodes?view=aspnetcore-5.0
//var qrcode = new QRCode("qrCodeImg");
function displayQr(elementName, rawData) {
console.log(elementName);
try {
if (elementName != "" && rawData != "") {
qrcode = new QRCode(document.getElementById(elementName),
{
text: rawData,
width: 200,
height: 200
});
//qrcode = new QRCode(document.getElementById(elementName));
//qrcode.clear();
//qrcode.makeCode(rawData);
}
}
catch
{ }
}
</script>
</body>
</html>
+54
View File
@@ -0,0 +1,54 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using NLog.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace MP.Land
{
public class Program
{
#region Public Methods
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.ConfigureLogging(logging =>
{
logging.ClearProviders();
logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace);
})
.UseNLog();
public static void Main(string[] args)
{
// inclusione NLog:
// https://github.com/NLog/NLog/wiki/Getting-started-with-ASP.NET-Core-5
// https://codewithmukesh.com/blog/logging-with-nlog-in-aspnet-core/
var logger = NLog.Web.NLogBuilder.ConfigureNLog("NLog.config").GetCurrentClassLogger();
try
{
logger.Info("MP.Land Application Starting Up");
CreateHostBuilder(args).Build().Run();
}
catch (Exception exception)
{
logger.Error(exception, "Stopped MP.Land program because of exception");
throw;
}
finally
{
NLog.LogManager.Shutdown();
}
}
#endregion Public Methods
}
}
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DeleteExistingFiles>False</DeleteExistingFiles>
<ExcludeApp_Data>False</ExcludeApp_Data>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<PublishProvider>FileSystem</PublishProvider>
<PublishUrl>bin\publish\net5.0\</PublishUrl>
<WebPublishMethod>FileSystem</WebPublishMethod>
</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>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>
</SiteUrlToLaunchAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
<SelfContained>false</SelfContained>
<MSDeployServiceURL>https://IIS01:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>jenkins</UserName>
<_SavePWD>True</_SavePWD>
<TargetFramework>net5.0</TargetFramework>
<EnableMsDeployAppOffline>True</EnableMsDeployAppOffline>
</PropertyGroup>
</Project>
@@ -0,0 +1,27 @@
<?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>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>
</SiteUrlToLaunchAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
<SelfContained>false</SelfContained>
<MSDeployServiceURL>https://IIS02:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>jenkins</UserName>
<_SavePWD>True</_SavePWD>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</Project>
@@ -0,0 +1,21 @@
<?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>
<WebPublishMethod>Package</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
<DesktopBuildPackageLocation>bin\publish\MP.Land.zip</DesktopBuildPackageLocation>
<PackageAsSingleFile>true</PackageAsSingleFile>
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
<TargetFramework>net5.0</TargetFramework>
<SelfContained>false</SelfContained>
</PropertyGroup>
</Project>
@@ -0,0 +1,27 @@
<?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>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>
</SiteUrlToLaunchAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
<SelfContained>false</SelfContained>
<MSDeployServiceURL>https://w2019-iis-dev:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/MP/LAND</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>jenkins</UserName>
<_SavePWD>True</_SavePWD>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</Project>
+28
View File
@@ -0,0 +1,28 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:7314",
"sslPort": 44311
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"MP.Land": {
"commandName": "Project",
"dotnetRunMessages": "true",
"launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
+27
View File
@@ -0,0 +1,27 @@
<body>
<i>Modulo gestione Programmi MAPO</i>
<h4>Versione: {{CURRENT-REL}}</h4>
<br />
Note di rilascio:
<ul>
<li>
<b>Ultime modifiche:</b>
<ul>{{LAST-CHANGES}}</ul>
</li>
<li>
<b>v.1.* &rarr;</b>
<ul>
<li>Prima release dotnet5</li>
<li>Integrazione EFCore</li>
</ul>
</li>
</ul>
<div>
<div style="float: left;">
<img src="logoSteamware.png" />
</div>
<div style="float: right;">
<a href="https://www.steamware.net/IOT" target="_blank">&copy; Steamware 2006-2021</a>
</div>
</div>
</body>
+27
View File
@@ -0,0 +1,27 @@
<body>
<i>Modulo gestione Programmi MAPO</i>
<h4>Versione: 1.1.2109.2118</h4>
<br />
Note di rilascio:
<ul>
<li>
<b>Ultime modifiche:</b>
<ul>{{LAST-CHANGES}}</ul>
</li>
<li>
<b>v.1.* &rarr;</b>
<ul>
<li>Prima release dotnet5</li>
<li>Integrazione EFCore</li>
</ul>
</li>
</ul>
<div>
<div style="float: left;">
<img src="logoSteamware.png" />
</div>
<div style="float: right;">
<a href="https://www.steamware.net/IOT" target="_blank">&copy; Steamware 2006-2021</a>
</div>
</div>
</body>
+1
View File
@@ -0,0 +1 @@
1.1.2109.2118
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.0.0.0</version>
<url>https://nexus.steamware.net/repository/SWS/{{DIRNAME}}/{{BRANCHNAME}}/{{PACKNAME}}.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/{{DIRNAME}}/{{BRANCHNAME}}/ChangeLog.html</changelog>
<mandatory>false</mandatory>
</item>
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.1.2109.2118</version>
<url>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
</item>
+60
View File
@@ -0,0 +1,60 @@
@inherits LayoutComponentBase
@using MP.Land.Data
@using MP.Land.Components
@inject MessageService AppMService
@implements IDisposable
<div class="page">
<div class="sidebar d-print-none">
<NavMenu />
</div>
<CascadingValue Name="ShowSearch" Value=@ShowSearch>
<div class="main mr-1">
<div class="top-row d-print-none">
<CmpTop></CmpTop>
</div>
<div class="content pt-1 pt-lg-2 mb-5">
@Body
</div>
<div class="fixed-bottom bottom-row">
<CmpFooter></CmpFooter>
</div>
</div>
</CascadingValue>
</div>
@code {
bool ShowSearch { get; set; } = false;
protected override void OnInitialized()
{
AppMService.EA_ShowSearch += OnShowSearch;
AppMService.EA_HideSearch += OnHideSearch;
}
public void OnShowSearch()
{
ShowSearch = true;
InvokeAsync(() =>
{
StateHasChanged();
});
}
public void OnHideSearch()
{
ShowSearch = false;
InvokeAsync(() =>
{
StateHasChanged();
});
}
public void Dispose()
{
AppMService.EA_ShowSearch -= OnShowSearch;
AppMService.EA_ShowSearch -= OnHideSearch;
}
}
+78
View File
@@ -0,0 +1,78 @@
.page {
position: relative;
display: flex;
flex-direction: column;
}
.main {
flex: 1;
}
.sidebar, .sidebarSmall {
background-image: linear-gradient(180deg, rgb(5, 39, 103) 20%, #3aa6ff 90%);
}
.top-row {
background-color: #f7f7f7;
border-bottom: 1px solid #d6d5d5;
height: 3.5rem;
align-items: center;
/*justify-content: space-evenly;
display: flex;*/
}
.top-row ::deep a, .top-row .btn-link {
white-space: nowrap;
margin-left: 1.5rem;
}
.top-row a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}
.bottom-row {
color: #dedede;
background-color: #000000;
height: 2rem;
align-items: center;
}
@media (min-width: 641px) {
.page {
flex-direction: row;
}
.sidebar {
width: 250px;
height: 100vh;
position: sticky;
top: 0;
}
.sidebarSmall {
width: 80px;
height: 100vh;
position: sticky;
top: 0;
}
.top-row {
position: sticky;
top: 0;
z-index: 1;
}
.bottom-row {
position: fixed;
bottom: 0;
z-index: 1;
}
.main > div {
padding-left: 0.5rem !important;
padding-right: 0.5rem !important;
/*padding-left: 2rem !important;
padding-right: 1.5rem !important;*/
}
}
+57
View File
@@ -0,0 +1,57 @@
<div class="top-row pl-4 navbar navbar-dark">
<a class="navbar-brand" href="">MP.Land</a>
<button class="navbar-toggler" @onclick="ToggleNavMenu">
<span class="navbar-toggler-icon"></span>
</button>
</div>
<div class="@NavMenuCssClass" @onclick="ToggleNavMenu">
<ul class="nav flex-column">
<li class="nav-item px-3">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<span class="fas fa-home fa-2x pr-2" aria-hidden="true"></span> Home
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="UserQr">
<span class="fas fa-qrcode fa-2x pr-2" aria-hidden="true"></span> QR Card User
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="UpdateManager">
<span class="fas fa-download fa-2x pr-2" aria-hidden="true"></span> Update Manager
</NavLink>
</li>
@*<li class="nav-item px-3">
<NavLink class="nav-link" href="ConfImport">
<span class="fas fa-file-import fa-2x pr-2" aria-hidden="true"></span> Config Import
</NavLink>
</li>*@
<li class="nav-item px-3">
<NavLink class="nav-link" href="About">
<span class="fas fa-info-circle fa-2x pr-2" aria-hidden="true"></span> About
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="Contacts">
<span class="fas fa-envelope fa-2x pr-2" aria-hidden="true"></span> Contacts
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="SysInfo">
<span class="fas fa-wrench fa-2x pr-2" aria-hidden="true"></span> System Info
</NavLink>
</li>
</ul>
</div>
@code {
private bool collapseNavMenu = true;
private string NavMenuCssClass => collapseNavMenu ? "collapse" : null;
private void ToggleNavMenu()
{
collapseNavMenu = !collapseNavMenu;
}
}
+62
View File
@@ -0,0 +1,62 @@
.navbar-toggler {
background-color: rgba(255, 255, 255, 0.1);
}
.top-row {
height: 3.5rem;
background-color: rgba(0,0,0,0.4);
}
.navbar-brand {
font-size: 1.1rem;
}
.oi {
width: 2rem;
font-size: 1.1rem;
vertical-align: text-top;
top: -2px;
}
.nav-item {
font-size: 0.9rem;
padding-bottom: 0.5rem;
}
.nav-item:first-of-type {
padding-top: 1rem;
}
.nav-item:last-of-type {
padding-bottom: 1rem;
}
.nav-item ::deep a {
color: #d7d7d7;
border-radius: 4px;
height: 3rem;
display: flex;
align-items: center;
line-height: 3rem;
}
.nav-item ::deep a.active {
background-color: rgba(255,255,255,0.25);
color: white;
}
.nav-item ::deep a:hover {
background-color: rgba(255,255,255,0.1);
color: white;
}
@media (min-width: 641px) {
.navbar-toggler {
display: none;
}
.collapse {
/* Never collapse the sidebar for wide screens */
display: block;
}
}
+126
View File
@@ -0,0 +1,126 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Localization;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using MP.Land.Data;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
namespace MP.Land
{
public class Startup
{
#region Public Constructors
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
#endregion Public Constructors
#region Public Properties
public IConfiguration Configuration { get; }
#endregion Public Properties
#region Public Methods
// 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())
{
app.UseDeveloperExceptionPage();
//app.UseMigrationsEndPoint();
}
else
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
// cultura IT...
var supportedCultures = new[]{
new CultureInfo("it-IT")
};
app.UseRequestLocalization(new RequestLocalizationOptions
{
DefaultRequestCulture = new RequestCulture("it-IT"),
SupportedCultures = supportedCultures,
FallBackToParentCultures = false
});
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture("it-IT");
// fix forwarders
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
//app.UseAuthentication();
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
//app.UseAuthentication();
//app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
//endpoints.MapControllers();
endpoints.MapBlazorHub();
//endpoints.MapHealthChecksUI();
//endpoints.MapHealthChecks("/health", new HealthCheckOptions
//{
// Predicate = _ => true,
// ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
//});
endpoints.MapFallbackToPage("/_Host");
});
}
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
// cookie applicazione da 14 gg (defaul) a 30
services.ConfigureApplicationCookie(o =>
{
o.ExpireTimeSpan = TimeSpan.FromDays(30);
o.SlidingExpiration = true;
});
services.AddStackExchangeRedisCache(options =>
{
//options.ConfigurationOptions = new StackExchange.Redis.ConfigurationOptions() { KeepAlive = 180, DefaultDatabase = 1, EndPoints = { { "localhost", 6379 } } };
options.Configuration = Configuration["ConnectionStrings:Redis"];
options.InstanceName = "MP:Land";
});
services.AddLocalization();
services.AddRazorPages();
services.AddServerSideBlazor();
services.AddSingleton<IConfiguration>(Configuration);
services.AddScoped<AppAuthService>();
services.AddScoped<MessageService>();
}
#endregion Public Methods
}
}
+10
View File
@@ -0,0 +1,10 @@
@using System.Net.Http
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using MP.Land
@using MP.Land.Shared
+11
View File
@@ -0,0 +1,11 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"Environment": "Steam DEV"
}
+17
View File
@@ -0,0 +1,17 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"BaseUrl": "IIS02",
"Environment": "PROD",
"ConnectionStrings": {
"DefaultConnection": "Server=localhost\\SQLEXPRESS;Database=MoonPro;Trusted_Connection=True;MultipleActiveResultSets=true",
"MP.Land": "Server=localhost\\SQLEXPRESS;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;"
}
}
+13
View File
@@ -0,0 +1,13 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"BaseUrl": "https://IIS01/",
"Environment": "Steam STAG"
}
+27
View File
@@ -0,0 +1,27 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
//"LogLevel": {
// "Default": "Debug",
// "Microsoft": "Information",
// "Microsoft.AspNetCore.SignalR": "Debug",
// "Microsoft.AspNetCore.Http.Connections": "Debug",
// "System": "Information"
//}
},
"AllowedHosts": "*",
"BaseUrl": "https://localhost:44309/",
"QrJumpPath": "MP/TAB/jumper?",
"Environment": "Steam DEV",
"downloadPath": "C:\\Steamware\\installers\\MP",
"appVers": "stable",
"ConnectionStrings": {
"DefaultConnection": "Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;MultipleActiveResultSets=true",
"MP.Land": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",
"Redis": "localhost:6379,defaultDatabase=1,keepAlive=180,asyncTimeout=5000"
}
}
+8
View File
@@ -0,0 +1,8 @@
[
{
"outputFileName": "wwwroot/bootstrap/css/bootstrap.min.css",
"inputFiles": [
"wwwroot/bootstrap/css/bootstrap.css"
]
}
]
+10
View File
@@ -0,0 +1,10 @@
[
{
"outputFile": "wwwroot/css/font.css",
"inputFile": "wwwroot/css/font.less"
},
{
"outputFile": "wwwroot/css/site.css",
"inputFile": "wwwroot/css/site.less"
}
]
+22
View File
@@ -0,0 +1,22 @@
{
"version": "1.0",
"defaultProvider": "cdnjs",
"libraries": [
{
"library": "bootstrap@4.6.0",
"destination": "wwwroot/bootstrap/"
},
{
"library": "popper.js@1.16.1",
"destination": "wwwroot/popper.js/"
},
{
"library": "jquery@3.5.1",
"destination": "wwwroot/jquery/"
},
{
"library": "font-awesome@5.15.4",
"destination": "wwwroot/font-awesome/"
}
]
}
+1
View File
@@ -0,0 +1 @@

+31
View File
@@ -0,0 +1,31 @@
param([string]$ProjectDir, [string]$ProjectPath);
$FileVers="Resources\VersNum.txt"
$FileManIn="Resources\manifest-original.xml"
$FileManOut="Resources\manifest.xml"
$FileCLogIn="Resources\ChangeLog-original.html"
$FileCLogOut="Resources\ChangeLog.html"
$MajMin="1.1."
$currentDate = get-date -format yyMM;
$currentTime = get-date -format ddHH;
$find = "<Version>(.|\n)*?</Version>";
$currRelNum=$MajMin + $currentDate +"." + $currentTime
$replace = "<Version>" + $MajMin + $currentDate +"." + $currentTime + "</Version>";
$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}}", "MP-LAND"
$manData = $manData -replace "{{BRANCHNAME}}", "stable/LAST"
$manData = $manData -replace "{{PACKNAME}}", "MP.Land"
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
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+325
View File
@@ -0,0 +1,325 @@
/*!
* Bootstrap Reboot v4.6.0 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/
*,
*::before,
*::after {
box-sizing: border-box;
}
html {
font-family: sans-serif;
line-height: 1.15;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
display: block;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
text-align: left;
background-color: #fff;
}
[tabindex="-1"]:focus:not(:focus-visible) {
outline: 0 !important;
}
hr {
box-sizing: content-box;
height: 0;
overflow: visible;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 0;
margin-bottom: 0.5rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title],
abbr[data-original-title] {
text-decoration: underline;
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
border-bottom: 0;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: .5rem;
margin-left: 0;
}
blockquote {
margin: 0 0 1rem;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 80%;
}
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -.25em;
}
sup {
top: -.5em;
}
a {
color: #007bff;
text-decoration: none;
background-color: transparent;
}
a:hover {
color: #0056b3;
text-decoration: underline;
}
a:not([href]):not([class]) {
color: inherit;
text-decoration: none;
}
a:not([href]):not([class]):hover {
color: inherit;
text-decoration: none;
}
pre,
code,
kbd,
samp {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: 1em;
}
pre {
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
-ms-overflow-style: scrollbar;
}
figure {
margin: 0 0 1rem;
}
img {
vertical-align: middle;
border-style: none;
}
svg {
overflow: hidden;
vertical-align: middle;
}
table {
border-collapse: collapse;
}
caption {
padding-top: 0.75rem;
padding-bottom: 0.75rem;
color: #6c757d;
text-align: left;
caption-side: bottom;
}
th {
text-align: inherit;
text-align: -webkit-match-parent;
}
label {
display: inline-block;
margin-bottom: 0.5rem;
}
button {
border-radius: 0;
}
button:focus:not(:focus-visible) {
outline: 0;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
input {
overflow: visible;
}
button,
select {
text-transform: none;
}
[role="button"] {
cursor: pointer;
}
select {
word-wrap: normal;
}
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
button:not(:disabled),
[type="button"]:not(:disabled),
[type="reset"]:not(:disabled),
[type="submit"]:not(:disabled) {
cursor: pointer;
}
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
padding: 0;
border-style: none;
}
input[type="radio"],
input[type="checkbox"] {
box-sizing: border-box;
padding: 0;
}
textarea {
overflow: auto;
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
display: block;
width: 100%;
max-width: 100%;
padding: 0;
margin-bottom: .5rem;
font-size: 1.5rem;
line-height: inherit;
color: inherit;
white-space: normal;
}
progress {
vertical-align: baseline;
}
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
[type="search"] {
outline-offset: -2px;
-webkit-appearance: none;
}
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
summary {
display: list-item;
cursor: pointer;
}
template {
display: none;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.css.map */
File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More