Merge branch 'release/AddPreviewPng_01'
This commit is contained in:
@@ -21,8 +21,8 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Egw.Lux.WebWindow.Base" Version="2.7.10-beta.2815" />
|
||||
<PackageReference Include="Egw.Lux.WebWindowComplex" Version="2.7.10-beta.2815" />
|
||||
<PackageReference Include="Egw.Lux.WebWindow.Base" Version="2.7.11.315" />
|
||||
<PackageReference Include="Egw.Lux.WebWindowComplex" Version="2.7.11.315" />
|
||||
<PackageReference Include="Egw.Window.Data" Version="2.7.10.2116" />
|
||||
<PackageReference Include="EgwMultiEngineManager.Data" Version="2.7.10.1" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Egw.Lux.WebWindow.Base" Version="2.7.10-beta.2815" />
|
||||
<PackageReference Include="Egw.Lux.WebWindow.Base" Version="2.7.11.315" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.21" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.21" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="8.0.21" />
|
||||
|
||||
@@ -88,6 +88,7 @@ namespace EgwCoreLib.Lux.Data.Services
|
||||
};
|
||||
|
||||
// Configurazione pipe dei messaggi
|
||||
PipePng = new MessagePipe(redisConn, pngChannel);
|
||||
PipeSvg = new MessagePipe(redisConn, svgChannel);
|
||||
PipeBom = new MessagePipe(RedisConn, bomChannel);
|
||||
PipeUpdate = new MessagePipe(RedisConn, updateChannel);
|
||||
|
||||
@@ -132,6 +132,19 @@ namespace EgwCoreLib.Lux.Data.Services
|
||||
return fullUrl;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera img redis PNG x id item richiesto
|
||||
/// </summary>
|
||||
/// <param name="imgUid">UID item</param>
|
||||
/// <param name="envir">Environment item</param>
|
||||
public string LoadPng(string imgUid, EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW)
|
||||
{
|
||||
// recupero img da cache
|
||||
string currKey = $"{redisBaseKey}:{envir}:Img:Png:{imgUid.Replace("/", ":")}";
|
||||
var rawVal = _redisService.Get(currKey);
|
||||
return $"{rawVal}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera img redis SVG x id item richiesto
|
||||
/// </summary>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using EgwCoreLib.Lux.Data.Services;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NLog;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
|
||||
namespace Lux.API.Controllers
|
||||
{
|
||||
@@ -8,8 +11,9 @@ namespace Lux.API.Controllers
|
||||
[ApiController]
|
||||
public class ImageController : ControllerBase
|
||||
{
|
||||
public ImageController(ILogger<ImageController> logger)
|
||||
public ImageController(ImageCacheService imgServ, ILogger<ImageController> logger)
|
||||
{
|
||||
_imgService = imgServ;
|
||||
_logger = logger;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -31,6 +35,37 @@ namespace Lux.API.Controllers
|
||||
return File(bytes, "image/svg+xml");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Chiamata GET: restituisce file PNG (da file o da cache)
|
||||
/// PUT: api/image/png/00000000-0000-0000-0000-000000000000
|
||||
/// </summary>
|
||||
/// <param name="id">id oggetto</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("png/{id}")]
|
||||
public async Task<IActionResult> png(string id)
|
||||
{
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
string base64Encoded = "";
|
||||
byte[] decodedBytes = new byte[0];
|
||||
// ...se ricevo percorso --> leggo jwd/svg cablato
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
// bonifica nome svg da
|
||||
base64Encoded = _imgService.LoadPng(id, EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.BEAM);
|
||||
// converto base64
|
||||
decodedBytes = Convert.FromBase64String(base64Encoded);
|
||||
|
||||
}
|
||||
sw.Stop();
|
||||
Log.Info($"pngString | {sw.Elapsed.TotalMilliseconds:N3} ms");
|
||||
//return Ok(decodedString);
|
||||
return File(decodedBytes, "image/png");
|
||||
}
|
||||
|
||||
private ImageCacheService _imgService { get; set; }
|
||||
private readonly ILogger<ImageController> _logger;
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>0.9.2511.0315</Version>
|
||||
<Version>0.9.2511.0318</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Egw.Lux.WebWindowComplex" Version="2.7.10-beta.2815" />
|
||||
<PackageReference Include="Egw.Lux.WebWindowComplex" Version="2.7.11.315" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.21" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.21" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-floating">
|
||||
<InputDouble CssClass="form-control form-control-lg text-end" Decimals="2" @bind-Value="@CurrRecord.Cost"></InputDouble>
|
||||
<InputDouble CssClass="form-control form-control-lg text-end" Decimals="2" Step="0.05" @bind-Value="@CurrRecord.Cost"></InputDouble>
|
||||
@* <input type="number" class="form-control text-end" @bind="@CurrRecord.Cost"> *@
|
||||
<label class="small bg-opacity-50">Costo</label>
|
||||
</div>
|
||||
|
||||
@@ -604,7 +604,7 @@ namespace Lux.UI.Components.Compo
|
||||
|
||||
private Dictionary<int, string> currGroupShape = new Dictionary<int, string>();
|
||||
|
||||
private string currOptXml = "";
|
||||
private Dictionary<int, string> currHwOption = new Dictionary<int, string>();
|
||||
|
||||
private int currPage = 1;
|
||||
|
||||
@@ -792,9 +792,10 @@ namespace Lux.UI.Components.Compo
|
||||
{
|
||||
if (currArgs.msgUid.Equals($"{hwOptChannel}:{EditRecord.OfferRowUID}"))
|
||||
{
|
||||
currOptXml = currArgs.newMessage;
|
||||
var rawDict = JsonConvert.DeserializeObject<Dictionary<int, string>>(currArgs.newMessage) ?? new Dictionary<int, string>();
|
||||
currHwOption = rawDict;
|
||||
// salvo in live data...
|
||||
CurrData.OptionsXml = currOptXml;
|
||||
CurrData.DictOptionsXml = currHwOption;
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50</UserSecretsId>
|
||||
<Version>0.9.2511.0315</Version>
|
||||
<Version>0.9.2511.0318</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -17,7 +17,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Egw.Lux.WebWindowComplex" Version="2.7.10-beta.2815" />
|
||||
<PackageReference Include="Egw.Lux.WebWindowComplex" Version="2.7.11.315" />
|
||||
<PackageReference Include="EgwCoreLib.Razor" Version="1.5.2511.312" />
|
||||
<PackageReference Include="EgwCoreLib.Utils" Version="1.5.2511.312" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.21" />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>LUX - Web Windows MES</i>
|
||||
<h4>Versione: 0.9.2511.0315</h4>
|
||||
<h4>Versione: 0.9.2511.0318</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
0.9.2511.0315
|
||||
0.9.2511.0318
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>0.9.2511.0315</version>
|
||||
<version>0.9.2511.0318</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user