Aggiunta gestione file statici esterni x PDF (ccon folders!)

This commit is contained in:
Samuele Locatelli
2024-04-23 09:23:59 +02:00
parent 366ed08fb4
commit c020e5fff3
6 changed files with 66 additions and 21 deletions
+38 -20
View File
@@ -1,5 +1,8 @@
using Microsoft.AspNetCore.Components;
using WebDoorCreator.Data;
using WebDoorCreator.Data.DbModels;
using WebDoorCreator.Data.Services;
using static Org.BouncyCastle.Math.EC.ECCurve;
namespace WebDoorCreator.UI.Data
{
@@ -7,35 +10,28 @@ namespace WebDoorCreator.UI.Data
{
#region Public Events
public event Action EA_UpdDoorOp = null!;
public event EventHandler EA_ConfDoorOp = delegate { };
public event Action EA_UpdDoorOp = null!;
#endregion Public Events
#region Public Properties
public bool isDoorOpUpd
{
get => _isDoorOpUpd;
set
{
_isDoorOpUpd = value;
reportDoorOpUpd();
_isDoorOpUpd = value;
reportDoorOpUpd();
}
}
#endregion Public Properties
#region Protected Methods
#region Public Methods
protected void reportDoorOpUpd()
{
if (EA_UpdDoorOp != null)
{
EA_UpdDoorOp?.Invoke();
}
}
public void ReportDoorOpConf(int doorId, int doorOpId, string objId)
{
DOPEventArgs currOpr = new DOPEventArgs()
@@ -50,19 +46,41 @@ namespace WebDoorCreator.UI.Data
EA_ConfDoorOp(this, currOpr);
}
}
#endregion Public Methods
#region Public Classes
public class DOPEventArgs : EventArgs
{
#region Public Properties
public int DoorId { get; set; } = 0;
public int DoorOpId { get; set; } = 0;
public string ObjectId { get; set; } = "";
#endregion Public Properties
}
#endregion Public Classes
#region Protected Methods
protected void reportDoorOpUpd()
{
if (EA_UpdDoorOp != null)
{
EA_UpdDoorOp?.Invoke();
}
}
#endregion Protected Methods
#region Private Properties
private bool _isDoorOpUpd { get; set; } = false;
private bool _isDoorOpConf { get; set; } = false;
#endregion Private Properties
private bool _isDoorOpUpd { get; set; } = false;
public class DOPEventArgs : EventArgs
{
public int DoorId { get; set; } = 0;
public int DoorOpId { get; set; } = 0;
public string ObjectId { get; set; } = "";
}
#endregion Private Properties
}
}
+17
View File
@@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Identity.UI;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.AspNetCore.Localization;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.FileProviders;
using StackExchange.Redis;
using System.Globalization;
using System.Text.Json.Serialization;
@@ -102,6 +103,22 @@ app.UseHttpsRedirection();
app.UseStaticFiles();
// gestione static files: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-8.0
string BasePathPdf = configuration.GetValue<string>("ServerConf:BasePathPdf") ?? configuration.GetValue<string>("OptConf:BasePathPdf") ?? "";
if (!string.IsNullOrEmpty(BasePathPdf))
{
// verifico esista folder disegni
if (Directory.Exists(BasePathPdf))
{
// gestione cartella x PDF
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(BasePathPdf),
RequestPath = "/docs",
});
}
}
app.UseRouting();
app.UseAuthentication();
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>0.9.2404.1909</Version>
<Version>0.9.2404.2309</Version>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-WebDoorCreator.UI-dfe95fed-1398-4144-bd43-8b3a765d6608</UserSecretsId>
</PropertyGroup>
@@ -15,6 +15,9 @@
"MaxDayCalcCache": 28,
"BaseUrl": "/UI"
},
"ServerConf": {
"BasePathPdf": "U:\\WebDoorSync\\WdcPdf"
},
"CompoBaseDirs": {
"CurrCompoDir": "U:\\WebDoorSync\\CurrentComp\\Compo",
"NewCompoDir": "U:\\WebDoorSync\\NewComp\\Compo"
+3
View File
@@ -28,6 +28,9 @@
"DisableIdentMigrate": true,
"DisableWDCMigrate": true
},
"ServerConf": {
"BasePathPdf": "\\\\IIS04\\WebDoorSync\\WdcPdf"
},
"RuntimeOpt": {
"WaitReloadSvg": 100,
"VetoRemoveProcessing": 5,
+4
View File
@@ -130,5 +130,9 @@
{
"outputFile": "Components/FilesMan/CompoCompare.razor.css",
"inputFile": "Components/FilesMan/CompoCompare.razor.less"
},
{
"outputFile": "Components/DoorDef/DoorDefSizingSI.razor.css",
"inputFile": "Components/DoorDef/DoorDefSizingSI.razor.less"
}
]