From 9303320cdcd2f509c7baa0df0c4e401488a3a60a Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 4 Nov 2025 17:39:59 +0100 Subject: [PATCH] Update image in test... --- EgwCoreLib.Lux.Data/Services/ImageCacheService.cs | 15 +++++++++++++++ Lux.API/Controllers/ImageController.cs | 12 ------------ Lux.UI/appsettings.json | 4 ++-- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/EgwCoreLib.Lux.Data/Services/ImageCacheService.cs b/EgwCoreLib.Lux.Data/Services/ImageCacheService.cs index b50ccdd1..6b2c755f 100644 --- a/EgwCoreLib.Lux.Data/Services/ImageCacheService.cs +++ b/EgwCoreLib.Lux.Data/Services/ImageCacheService.cs @@ -134,6 +134,21 @@ namespace EgwCoreLib.Lux.Data.Services fType = "png"; imgUID.Replace(".png", ""); } + switch (envir) + { + case Constants.EXECENVIRONMENTS.NULL: + break; + case Constants.EXECENVIRONMENTS.WINDOW: + fType = "svg"; + break; + case Constants.EXECENVIRONMENTS.BEAM: + case Constants.EXECENVIRONMENTS.WALL: + case Constants.EXECENVIRONMENTS.CABINET: + default: + fType = "png"; + break; + } + string rndImg = $"{DateTime.Now:HHmmssfff}"; string fullUrl = $"{baseUrl}/{tag}/{imgUID}-{rndImg}.{fType}?envir={envir}".Replace("////", "//"); return fullUrl; diff --git a/Lux.API/Controllers/ImageController.cs b/Lux.API/Controllers/ImageController.cs index 2cf19496..cd7c7879 100644 --- a/Lux.API/Controllers/ImageController.cs +++ b/Lux.API/Controllers/ImageController.cs @@ -99,18 +99,6 @@ namespace Lux.API.Controllers // ...se ricevo percorso --> leggo jwd/svg cablato if (!string.IsNullOrEmpty(id)) { - // se contiene ".svg" lo levo... - if (id.EndsWith(".svg")) - { - mimeType = "image/svg+xml"; - //id = id.Replace(".svg", ""); - } - else if (id.EndsWith(".png")) - { - mimeType = "image/png"; - //id.Replace(".png", ""); - } - // se contiene i caratteri casuali x forzare reload --> li levo if (id.Contains("-")) { diff --git a/Lux.UI/appsettings.json b/Lux.UI/appsettings.json index 74068ca7..f786bf0d 100644 --- a/Lux.UI/appsettings.json +++ b/Lux.UI/appsettings.json @@ -59,9 +59,9 @@ "HostOs": "Win", "CalcTag": "calc", "GenericBaseUrl": "generic", - //"Prog.ApiUrl": "https://office.egalware.com/lux/srv/api", "Prog.ApiUrl": "https://localhost:7135/api", - "ImageBaseUrl": "window", + //"Prog.ApiUrl": "https://office.egalware.com/lux/srv/api", + "ImageBaseUrl": "Image", "RouteBaseUrl": "window", "BomChannel": "Egw:bom", "HwListChannel": "Egw:hw:list",