diff --git a/Controllers/FotoController.cs b/Controllers/FotoController.cs index c13d31b..dcbdd14 100644 --- a/Controllers/FotoController.cs +++ b/Controllers/FotoController.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Mvc; +using static VirtualTask.Controllers.LoginController; namespace VirtualTask.Controllers { @@ -6,7 +7,16 @@ namespace VirtualTask.Controllers [Route("foto")] public class FotoController : Controller { - private readonly string _rootPath = "/mnt/storagebox"; + string _rootPath = string.Empty; + + private readonly IConfiguration _configuration; + public FotoController(IConfiguration configuration) + { + _configuration = configuration; + var key = _configuration["ApplicationInsights:rootPath"]; + _rootPath = key; + } + [HttpGet("{folder}/{fileName}")] public IActionResult ShowOrServe(string folder, string fileName) @@ -19,8 +29,6 @@ namespace VirtualTask.Controllers // Percorso: /mnt/storagebox/{folder}/PHOTO/{fileName} var filePath = Path.Combine(_rootPath, safeFolder, "PHOTO", safeFileName); - - //SOLO PER TEST!!!!!! //filePath = "C:\\DATI\\V000000009_2.jpg"; @@ -28,25 +36,6 @@ namespace VirtualTask.Controllers if (!System.IO.File.Exists(filePath)) return NotFound("File non trovato"); - //var acceptHeader = Request.Headers["Accept"].ToString(); - - //if (!string.IsNullOrEmpty(acceptHeader) && acceptHeader.Contains("image")) - //{ - // // rileva content-type dinamico - // var ext = Path.GetExtension(safeFileName).ToLowerInvariant(); - // var contentType = ext switch - // { - // ".png" => "image/png", - // ".webp" => "image/webp", - // ".jpg" or ".jpeg" => "image/jpeg", - // _ => "application/octet-stream" - // }; - - // var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read); - // return File(stream, contentType); - //} - - // Se non è richiesta immagine → mostra view Razor ViewBag.Folder = safeFolder; ViewBag.FileName = safeFileName; return View("ShowImage"); diff --git a/Views/Rapp_New/Details.cshtml b/Views/Rapp_New/Details.cshtml index 5047aec..0e1ca47 100644 --- a/Views/Rapp_New/Details.cshtml +++ b/Views/Rapp_New/Details.cshtml @@ -19,11 +19,28 @@ Mag New } + + +
+
Dettaglio buono
+
+ + + + + + + + + + +
- @Html.DisplayNameFor(model => model.azienda_impianto) @Html.DisplayFor(model => model.azienda_impianto) -
-
- @Html.DisplayNameFor(model => model.seriale_rapportino) @Html.DisplayFor(model => model.seriale_rapportino) +
@@ -318,21 +335,23 @@ + @{ + if (!string.IsNullOrEmpty(Model.rafoto1)) + { +
+ - @{ - if (!string.IsNullOrEmpty(Model.rafoto1)) - { - //
- // @Html.DisplayNameFor(model => model.rafoto1) @Html.DisplayFor(model => model.rafoto1) - //
-
- - Immagine: @Html.DisplayNameFor(model => model.rafoto1) - -
- } - } - + + } + } + +
+ @Html.DisplayNameFor(model => model.azienda_impianto) @Html.DisplayFor(model => model.azienda_impianto) +
+ @Html.DisplayNameFor(model => model.seriale_rapportino) @Html.DisplayFor(model => model.seriale_rapportino) +
+ + @Html.DisplayNameFor(model => model.rafoto1) + +
+
+
diff --git a/appsettings.json b/appsettings.json index 7a369cc..645df6c 100644 --- a/appsettings.json +++ b/appsettings.json @@ -12,6 +12,7 @@ "rootUrlApi2": "https://api-vt.poloinformatico.it/VIRTU/", "rootWebLoghi": "C:\\ZAPIPOLO\\api_polo\\wwwroot\\VIRTU\\", "rootUrl": "https://virtualtask.it/", + "rootPath": "/mnt/storagebox", //TEST //"rootUrlApi": "http://testapi.poloinformatico.it:9001/api/Polo/",