From 8a0fb121ae417d607a692e4a4c28c6bd402d27db Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 25 Mar 2025 12:24:01 +0100 Subject: [PATCH] =?UTF-8?q?TAB3:=20-=20correzione=20modalit=C3=A0=20calcol?= =?UTF-8?q?o=20immagini=20con=20nuova=20conf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MP-TAB3/Components/MachineBlock.razor.cs | 11 +++++++++-- MP-TAB3/MP-TAB3.csproj | 2 +- MP-TAB3/Program.cs | 18 +++++++++++++++++- MP-TAB3/Resources/ChangeLog.html | 2 +- MP-TAB3/Resources/VersNum.txt | 2 +- MP-TAB3/Resources/manifest.xml | 2 +- MP-TAB3/appsettings.Production.json | 1 + MP-TAB3/appsettings.json | 3 ++- MP.MON/Components/Pages/Index.razor.cs | 4 ---- 9 files changed, 33 insertions(+), 12 deletions(-) diff --git a/MP-TAB3/Components/MachineBlock.razor.cs b/MP-TAB3/Components/MachineBlock.razor.cs index 184ad592..391ad709 100644 --- a/MP-TAB3/Components/MachineBlock.razor.cs +++ b/MP-TAB3/Components/MachineBlock.razor.cs @@ -320,7 +320,10 @@ namespace MP_TAB3.Components { url = "Steamware.png"; } - string fullPath = Path.Combine(imgBasePath, url); + string fullPath = $"{imgBasePath}/{url}"; +#if false + string fullPath = Path.Combine(imgBasePath, url); +#endif return fullPath; } @@ -357,6 +360,7 @@ namespace MP_TAB3.Components TabDServ.ConfigGetVal("TAB_ShowQtaExtra", ref showQtaExtra); await ReloadXDL(true); // se configurata uso cartella virtuale... altrimenti cartella processo +#if false var sImgBasePath = config.GetValue("ServerConf:ImgBasePath") ?? (config.GetValue("OptConf:ImgBasePath") ?? ""); if (!string.IsNullOrEmpty(sImgBasePath)) { @@ -365,7 +369,10 @@ namespace MP_TAB3.Components else { imgBasePath = $"{Environment.CurrentDirectory}/images/"; - } + } +#endif + string baseUrl = config.GetValue("SpecialConf:AppUrl") ?? (config.GetValue("OptConf:AppUrl") ?? ""); + imgBasePath = $"{baseUrl}/macchine/small"; await loadDetails(); detailLoaded = true; } diff --git a/MP-TAB3/MP-TAB3.csproj b/MP-TAB3/MP-TAB3.csproj index 3e6b5c7f..b7cefb4b 100644 --- a/MP-TAB3/MP-TAB3.csproj +++ b/MP-TAB3/MP-TAB3.csproj @@ -3,7 +3,7 @@ net6.0 enable - 6.16.2503.1714 + 6.16.2503.2512 enable MP_TAB3 diff --git a/MP-TAB3/Program.cs b/MP-TAB3/Program.cs index 0d4d14d3..4471706a 100644 --- a/MP-TAB3/Program.cs +++ b/MP-TAB3/Program.cs @@ -86,9 +86,25 @@ if (!string.IsNullOrEmpty(BasePathDisegni)) }); } } - logger.Info("Add disegni path"); +// gestione immagini macchine +string BasePathMacchine = configuration.GetValue("ServerConf:BasePathMacchine") ?? configuration.GetValue("OptConf:BasePathMacchine") ?? ""; +if (!string.IsNullOrEmpty(BasePathMacchine)) +{ + // verifico esista folder disegni + if (Directory.Exists(BasePathMacchine)) + { + // gestione cartella x PDF + app.UseStaticFiles(new StaticFileOptions + { + FileProvider = new PhysicalFileProvider(BasePathMacchine), + RequestPath = "/macchine", + }); + } +} +logger.Info("Add macchine path"); + app.UseRouting(); app.MapBlazorHub(); diff --git a/MP-TAB3/Resources/ChangeLog.html b/MP-TAB3/Resources/ChangeLog.html index 452e9a71..8617ed9d 100644 --- a/MP-TAB3/Resources/ChangeLog.html +++ b/MP-TAB3/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2503.1714

+

Versione: 6.16.2503.2512


Note di rilascio:
  • diff --git a/MP-TAB3/Resources/VersNum.txt b/MP-TAB3/Resources/VersNum.txt index 33d6972f..e3c58283 100644 --- a/MP-TAB3/Resources/VersNum.txt +++ b/MP-TAB3/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2503.1714 +6.16.2503.2512 diff --git a/MP-TAB3/Resources/manifest.xml b/MP-TAB3/Resources/manifest.xml index 772366d9..9f62762d 100644 --- a/MP-TAB3/Resources/manifest.xml +++ b/MP-TAB3/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2503.1714 + 6.16.2503.2512 https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html false diff --git a/MP-TAB3/appsettings.Production.json b/MP-TAB3/appsettings.Production.json index b257de82..8e1c51d2 100644 --- a/MP-TAB3/appsettings.Production.json +++ b/MP-TAB3/appsettings.Production.json @@ -24,6 +24,7 @@ "ServerConf": { "BaseAddr": "https://iis04.egalware.com/MP/TAB3/", "BasePathDisegni": "C:\\Steamware\\disegni", + "BasePathMacchine": "C:\\inetpub\\wwwroot\\MP\\macchine", "ImgBasePath": "https://iis04.egalware.com/MP/macchine/small/", "MpIoNS": "MoonPro:SQL2016DEV:MoonPro" }, diff --git a/MP-TAB3/appsettings.json b/MP-TAB3/appsettings.json index ef552d62..4537964a 100644 --- a/MP-TAB3/appsettings.json +++ b/MP-TAB3/appsettings.json @@ -76,7 +76,8 @@ "ServerConf": { "BaseAddr": "https://localhost:7295/MP/TAB3/", "BasePathDisegni": "\\\\iis01\\W$\\Files\\Disegni", - "ImgBasePath": "https://iis01.egalware.com/MP/macchine/small/", + "BasePathMacchine": "\\\\iis01\\c$\\inetpub\\wwwroot\\MP\\macchine", + "ImgBasePath": "http://iis01.egalware.com/MP/macchine/small/", "MpIoNS": "MoonPro:SQL2016DEV:MoonPro", "maxChar4Scroll": 21 }, diff --git a/MP.MON/Components/Pages/Index.razor.cs b/MP.MON/Components/Pages/Index.razor.cs index bcf6d73a..d5da8235 100644 --- a/MP.MON/Components/Pages/Index.razor.cs +++ b/MP.MON/Components/Pages/Index.razor.cs @@ -3,14 +3,10 @@ using MP.Data; using MP.Core.Conf; using MP.Data.DbModels; using MP.Data.Services; -using MP.MON; using Newtonsoft.Json; using NLog; -using System; -using static Org.BouncyCastle.Math.EC.ECCurve; using MP.Core.DTO; using MP.Data.Translate; -using Microsoft.AspNetCore.Components.Forms; namespace MP.MON.Components.Pages {