|
File |
- Rev |
- Size |
- State |
+ Rev / State / Size |
Macchina |
Tags |
Modificato |
@@ -149,17 +145,26 @@
- @record.Rev
- |
-
- @((((double)record.Size) / 1024).ToString("N2")) k
- |
-
+
+
+ @record.Rev
+
+
@record.DiskStatus
+
+
+ @CalcSize(record.Size)
+
+
+
+
|
@record.Macchina.Nome
diff --git a/MP.Prog/Pages/Archive.razor.cs b/MP.Prog/Pages/Archive.razor.cs
index d5203f1b..e79a7898 100644
--- a/MP.Prog/Pages/Archive.razor.cs
+++ b/MP.Prog/Pages/Archive.razor.cs
@@ -1,254 +1,78 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
+using MP.FileData;
using MP.FileData.DatabaseModels;
using MP.Prog.Data;
using NLog;
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Threading;
using System.Threading.Tasks;
namespace MP.Prog.Pages
{
public partial class Archive : ComponentBase, IDisposable
{
- #region Private Fields
+ #region Public Properties
- private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
- private FileModel currRecord = null;
- private List ListRecords;
- private List MacList;
- private List TagList;
+ public bool DeleteDialogOpen { get; set; }
- #endregion Private Fields
+ #endregion Public Properties
+
+ #region Public Methods
+
+ public string checkSelect(int FileId)
+ {
+ string answ = "";
+ if (currRecord != null)
+ {
+ try
+ {
+ answ = (currRecord.FileId == FileId) ? "table-info" : "";
+ }
+ catch
+ { }
+ }
+ return answ;
+ }
+
+ public void Dispose()
+ {
+ MServ.EA_SearchUpdated -= OnSeachUpdated;
+ MServ.EA_FilterUpdated -= OnFilterUpdated;
+ }
+
+ public async void OnFilterUpdated()
+ {
+ await ReloadData();
+ }
+
+ public void OnSeachUpdated()
+ {
+ SearchVal = MServ.SearchVal;
+ StateHasChanged();
+ }
+
+ #endregion Public Methods
#region Protected Fields
protected string _SearchTag;
-
protected string defTag = "";
-
protected int totalCount = 0;
#endregion Protected Fields
- #region Private Properties
-
- private int currPage
- {
- get
- {
- return AppMService.File_Filter.PageNum;
- }
- set
- {
- AppMService.File_Filter.PageNum = value;
- }
- }
-
- private bool isLoading { get; set; } = false;
-
- private int numRecord
- {
- get
- {
- return AppMService.File_Filter.PageSize;
- }
- set
- {
- AppMService.File_Filter.PageSize = value;
- }
- }
-
- private bool OnlyActive
- {
- get
- {
- bool answ = false;
- if (AppMService.File_Filter != null)
- {
- answ = AppMService.File_Filter.OnlyActive;
- }
- return answ;
- }
- set
- {
- if (!AppMService.File_Filter.OnlyActive.Equals(value))
- {
- AppMService.File_Filter.OnlyActive = value;
- var pUpd = Task.Run(async () =>
- {
- await AsyncReload();
- });
- pUpd.Wait();
- }
- }
- }
-
- private bool OnlyMod
- {
- get
- {
- bool answ = false;
- if (AppMService.File_Filter != null)
- {
- answ = AppMService.File_Filter.OnlyMod;
- }
- return answ;
- }
- set
- {
- if (!AppMService.File_Filter.OnlyMod.Equals(value))
- {
- AppMService.File_Filter.OnlyMod = value;
- var pUpd = Task.Run(async () =>
- {
- await AsyncReload();
- });
- pUpd.Wait();
- }
- }
- }
-
- private bool OnlyNoTag
- {
- get
- {
- bool answ = false;
- if (AppMService.File_Filter != null)
- {
- answ = AppMService.File_Filter.OnlyNoTag;
- }
- return answ;
- }
- set
- {
- if (!AppMService.File_Filter.OnlyNoTag.Equals(value))
- {
- AppMService.File_Filter.OnlyNoTag = value;
- var pUpd = Task.Run(async () =>
- {
- await AsyncReload();
- });
- pUpd.Wait();
- }
- }
- }
-
- private string SearchVal
- {
- get
- {
- string answ = "";
- if (AppMService.File_Filter != null)
- {
- answ = AppMService.File_Filter.SearchVal;
- }
- return answ;
- }
- set
- {
- if (!AppMService.File_Filter.SearchVal.Equals(value))
- {
- AppMService.File_Filter.SearchVal = value;
- var pUpd = Task.Run(async () =>
- {
- await AsyncReload();
- });
- pUpd.Wait();
- }
- }
- }
-
- private string SelFileName
- {
- get
- {
- string answ = "";
- if (AppMService.File_Filter != null)
- {
- answ = AppMService.File_Filter.FileName;
- }
- return answ;
- }
- set
- {
- if (!AppMService.File_Filter.FileName.Equals(value))
- {
- AppMService.File_Filter.FileName = value;
- var pUpd = Task.Run(async () =>
- {
- await AsyncReload();
- });
- pUpd.Wait();
- }
- }
- }
-
- private string SelIdxMacc
- {
- get
- {
- string answ = "";
- if (AppMService.File_Filter != null)
- {
- answ = AppMService.File_Filter.IdxMacchina;
- }
- return answ;
- }
- set
- {
- if (!AppMService.File_Filter.IdxMacchina.Equals(value))
- {
- AppMService.File_Filter.IdxMacchina = value;
- var pUpd = Task.Run(async () =>
- {
- await AsyncReload();
- });
- pUpd.Wait();
- }
- }
- }
-
- private string SelTag
- {
- get
- {
- string answ = "";
- if (AppMService.File_Filter != null)
- {
- answ = AppMService.File_Filter.Tag;
- }
- return answ;
- }
- set
- {
- if (!AppMService.File_Filter.Tag.Equals(value))
- {
- AppMService.File_Filter.Tag = value;
- var pUpd = Task.Run(async () =>
- {
- await AsyncReload();
- });
- pUpd.Wait();
- }
- }
- }
-
- #endregion Private Properties
-
#region Protected Properties
[Inject]
- protected MessageService AppMService { get; set; }
-
- [Inject]
- protected FileArchDataService DataService { get; set; }
+ protected FileArchDataService FDService { get; set; }
[Inject]
protected IJSRuntime JSRuntime { get; set; }
+ [Inject]
+ protected MessageService MServ { get; set; }
+
[Inject]
protected NavigationManager NavManager { get; set; }
@@ -270,7 +94,7 @@ namespace MP.Prog.Pages
{
var pUpd = Task.Run(async () =>
{
- TagList = await DataService.TagGetFilt(SearchTag);
+ TagList = await FDService.TagGetFilt(SearchTag);
});
pUpd.Wait();
}
@@ -280,61 +104,6 @@ namespace MP.Prog.Pages
#endregion Protected Properties
- #region Public Properties
-
- public bool DeleteDialogOpen { get; set; }
-
- #endregion Public Properties
-
- #region Private Methods
-
- private string cssActive(bool active)
- {
- string answ = active ? "text-dark" : "text-secondary textStriked";
- return answ;
- }
-
- private string cssStatusByCod(FileData.FileState currStatus)
- {
- string answ = "badge";
- switch (currStatus)
- {
- case FileData.FileState.Changed:
- answ += " badge-warning";
- break;
-
- case FileData.FileState.Deleted:
- answ += " badge-danger";
- break;
-
- case FileData.FileState.Ok:
- answ += " badge-success";
- break;
-
- case FileData.FileState.ND:
- default:
- answ += " badge-light";
- break;
- }
- return answ;
- }
-
- private async Task OnDialogClose(bool accepted)
- {
- DeleteDialogOpen = false;
- currPage = 1;
- await AsyncReload();
- //StateHasChanged();
- }
-
- private void OpenDialog()
- {
- DeleteDialogOpen = true;
- StateHasChanged();
- }
-
- #endregion Private Methods
-
#region Protected Methods
protected async Task AsyncReload()
@@ -346,6 +115,16 @@ namespace MP.Prog.Pages
isLoading = false;
}
+ ///
+ /// Restituisce size calcolata
+ ///
+ ///
+ ///
+ protected string CalcSize(long origSize)
+ {
+ return MeasureUtils.SizeSuffix(origSize, 1);
+ }
+
protected async Task Edit(FileModel selRecord)
{
if (!selRecord.Active)
@@ -355,7 +134,7 @@ namespace MP.Prog.Pages
}
// rileggo dal DB il record corrente...
- currRecord = await DataService.FileGetByKey(selRecord.FileId);
+ currRecord = await FDService.FileGetByKey(selRecord.FileId);
}
protected async Task FilterPath(string searchVal)
@@ -371,7 +150,7 @@ namespace MP.Prog.Pages
{
SelTag = searchVal;
currPage = 1;
- await ReloadAllData();
+ await ReloadData();
isLoading = false;
}
@@ -381,8 +160,8 @@ namespace MP.Prog.Pages
ListRecords = null;
// importante altrimenti NON mostra update UI
await Task.Delay(1);
- //AppMService.File_Filter = SelectData.Init(5, 10);
- var numCheck = await DataService.updateAllArchive(numDays, false);
+ //MServ.File_Filter = SelectData.Init(5, 10);
+ var numCheck = await FDService.UpdateAllArchive(numDays, false, MServ.UserName);
await ReloadAllData();
await Task.Delay(1);
await RefreshDisplayLoading();
@@ -391,11 +170,11 @@ namespace MP.Prog.Pages
protected override async Task OnInitializedAsync()
{
SearchTag = defTag;
- AppMService.ShowSearch = true;
- AppMService.PageName = "Archivio File Programmi";
- AppMService.PageIcon = "fas fa-folder pr-2";
- AppMService.EA_SearchUpdated += OnSeachUpdated;
- AppMService.EA_FilterUpdated += OnFilterUpdated;
+ MServ.ShowSearch = true;
+ MServ.PageName = "Archivio File Programmi";
+ MServ.PageIcon = "fas fa-folder pr-2";
+ MServ.EA_SearchUpdated += OnSeachUpdated;
+ MServ.EA_FilterUpdated += OnFilterUpdated;
await ReloadAllData();
isLoading = false;
}
@@ -423,10 +202,10 @@ namespace MP.Prog.Pages
protected async Task ReloadAllData()
{
isLoading = true;
- MacList = await DataService.ArchMaccGetAll();
+ MacList = await FDService.ArchMaccGetAll();
SelIdxMacc = "0";
SearchTag = defTag;
- TagList = await DataService.TagGetFilt(SearchTag);
+ TagList = await FDService.TagGetFilt(SearchTag);
await ReloadData();
}
@@ -435,18 +214,18 @@ namespace MP.Prog.Pages
isLoading = true;
// importante altrimenti NON mostra update UI
await Task.Delay(1);
- totalCount = await DataService.FileCountFilt(AppMService.File_Filter);
- //SearchRecords = await FDService.FileGetFilt(AppMService.File_Filter);
+ totalCount = await FDService.FileCountFilt(MServ.File_Filter);
+ //SearchRecords = await FDService.FileGetFilt(MServ.File_Filter);
//// faccio paginazione SOLO NELLA DECINA attuale... (quindi non tutte le pagine ma solo subset)
//ListRecords = SearchRecords.Skip(numRecord * (currPage % 10 - 1)).Take(numRecord).ToList();
- ListRecords = await DataService.FileGetFilt(AppMService.File_Filter);
+ ListRecords = await FDService.FileGetFilt(MServ.File_Filter);
await Task.Delay(1);
}
protected void ResetData()
{
- DataService.rollBackEdit(currRecord);
+ FDService.rollBackEdit(currRecord);
currRecord = null;
}
@@ -455,8 +234,8 @@ namespace MP.Prog.Pages
currRecord = null;
ListRecords = null;
currPage = 1;
- AppMService.File_Filter = SelectData.Init(5, 10);
- AppMService.SearchVal = "";
+ MServ.File_Filter = SelectData.Init(5, 10);
+ MServ.SearchVal = "";
SearchTag = defTag;
await ReloadAllData();
isLoading = false;
@@ -493,7 +272,7 @@ namespace MP.Prog.Pages
{
currRecord = null;
ListRecords = null;
- DataService.ResetController();
+ FDService.ResetController();
await ReloadData();
await Task.Delay(1);
isLoading = false;
@@ -501,41 +280,268 @@ namespace MP.Prog.Pages
#endregion Protected Methods
- #region Public Methods
+ #region Private Fields
- public string checkSelect(int FileId)
+ private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
+ private FileModel currRecord = null;
+ private List ListRecords;
+ private List MacList;
+ private List TagList;
+
+ #endregion Private Fields
+
+ #region Private Properties
+
+ private int currPage
{
- string answ = "";
- if (currRecord != null)
+ get
{
- try
+ return MServ.File_Filter.PageNum;
+ }
+ set
+ {
+ MServ.File_Filter.PageNum = value;
+ }
+ }
+
+ private bool isLoading { get; set; } = false;
+
+ private int numRecord
+ {
+ get
+ {
+ return MServ.File_Filter.PageSize;
+ }
+ set
+ {
+ MServ.File_Filter.PageSize = value;
+ }
+ }
+
+ private bool OnlyActive
+ {
+ get
+ {
+ bool answ = false;
+ if (MServ.File_Filter != null)
{
- answ = (currRecord.FileId == FileId) ? "table-info" : "";
+ answ = MServ.File_Filter.OnlyActive;
}
- catch
- { }
+ return answ;
+ }
+ set
+ {
+ if (!MServ.File_Filter.OnlyActive.Equals(value))
+ {
+ MServ.File_Filter.OnlyActive = value;
+ var pUpd = Task.Run(async () =>
+ {
+ await AsyncReload();
+ });
+ pUpd.Wait();
+ }
+ }
+ }
+
+ private bool OnlyMod
+ {
+ get
+ {
+ bool answ = false;
+ if (MServ.File_Filter != null)
+ {
+ answ = MServ.File_Filter.OnlyMod;
+ }
+ return answ;
+ }
+ set
+ {
+ if (!MServ.File_Filter.OnlyMod.Equals(value))
+ {
+ MServ.File_Filter.OnlyMod = value;
+ var pUpd = Task.Run(async () =>
+ {
+ await AsyncReload();
+ });
+ pUpd.Wait();
+ }
+ }
+ }
+
+ private bool OnlyNoTag
+ {
+ get
+ {
+ bool answ = false;
+ if (MServ.File_Filter != null)
+ {
+ answ = MServ.File_Filter.OnlyNoTag;
+ }
+ return answ;
+ }
+ set
+ {
+ if (!MServ.File_Filter.OnlyNoTag.Equals(value))
+ {
+ MServ.File_Filter.OnlyNoTag = value;
+ var pUpd = Task.Run(async () =>
+ {
+ await AsyncReload();
+ });
+ pUpd.Wait();
+ }
+ }
+ }
+
+ private string SearchVal
+ {
+ get
+ {
+ string answ = "";
+ if (MServ.File_Filter != null)
+ {
+ answ = MServ.File_Filter.SearchVal;
+ }
+ return answ;
+ }
+ set
+ {
+ if (!MServ.File_Filter.SearchVal.Equals(value))
+ {
+ MServ.File_Filter.SearchVal = value;
+ var pUpd = Task.Run(async () =>
+ {
+ await AsyncReload();
+ });
+ pUpd.Wait();
+ }
+ }
+ }
+
+ private string SelFileName
+ {
+ get
+ {
+ string answ = "";
+ if (MServ.File_Filter != null)
+ {
+ answ = MServ.File_Filter.FileName;
+ }
+ return answ;
+ }
+ set
+ {
+ if (!MServ.File_Filter.FileName.Equals(value))
+ {
+ MServ.File_Filter.FileName = value;
+ var pUpd = Task.Run(async () =>
+ {
+ await AsyncReload();
+ });
+ pUpd.Wait();
+ }
+ }
+ }
+
+ private string SelIdxMacc
+ {
+ get
+ {
+ string answ = "";
+ if (MServ.File_Filter != null)
+ {
+ answ = MServ.File_Filter.IdxMacchina;
+ }
+ return answ;
+ }
+ set
+ {
+ if (!MServ.File_Filter.IdxMacchina.Equals(value))
+ {
+ MServ.File_Filter.IdxMacchina = value;
+ var pUpd = Task.Run(async () =>
+ {
+ await AsyncReload();
+ });
+ pUpd.Wait();
+ }
+ }
+ }
+
+ private string SelTag
+ {
+ get
+ {
+ string answ = "";
+ if (MServ.File_Filter != null)
+ {
+ answ = MServ.File_Filter.Tag;
+ }
+ return answ;
+ }
+ set
+ {
+ if (!MServ.File_Filter.Tag.Equals(value))
+ {
+ MServ.File_Filter.Tag = value;
+ var pUpd = Task.Run(async () =>
+ {
+ await AsyncReload();
+ });
+ pUpd.Wait();
+ }
+ }
+ }
+
+ #endregion Private Properties
+
+ #region Private Methods
+
+ private string cssActive(bool active)
+ {
+ string answ = active ? "text-dark" : "text-secondary textStriked";
+ return answ;
+ }
+
+ private string cssStatusByCod(FileState currStatus)
+ {
+ string answ = "badge";
+ switch (currStatus)
+ {
+ case FileState.Changed:
+ answ += " text-bg-warning";
+ break;
+
+ case FileState.Deleted:
+ answ += " text-bg-danger";
+ break;
+
+ case FileState.Ok:
+ answ += " text-bg-success";
+ break;
+
+ case FileState.ND:
+ default:
+ answ += " text-bg-light";
+ break;
}
return answ;
}
- public void Dispose()
+ private async Task OnDialogClose(bool accepted)
{
- AppMService.EA_SearchUpdated -= OnSeachUpdated;
- AppMService.EA_FilterUpdated -= OnFilterUpdated;
- }
-
- public async void OnFilterUpdated()
- {
- await ReloadData();
+ DeleteDialogOpen = false;
+ currPage = 1;
+ await AsyncReload();
//StateHasChanged();
}
- public void OnSeachUpdated()
+ private void OpenDialog()
{
- SearchVal = AppMService.SearchVal;
+ DeleteDialogOpen = true;
StateHasChanged();
}
- #endregion Public Methods
+ #endregion Private Methods
}
}
\ No newline at end of file
diff --git a/MP.Prog/Program.cs b/MP.Prog/Program.cs
index e5b33f61..592ac919 100644
--- a/MP.Prog/Program.cs
+++ b/MP.Prog/Program.cs
@@ -23,10 +23,13 @@ namespace MP.Prog
})
.ConfigureLogging(logging =>
{
+ // impostante per non perdere le regole di log
logging.ClearProviders();
logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Error);
})
- .UseNLog();
+ // importante per eseguire la conf regike logging
+ .UseNLog(new NLogAspNetCoreOptions() { RemoveLoggerFactoryFilter = false });
+ //.UseNLog();
public static void Main(string[] args)
{
diff --git a/MP.Prog/Properties/launchSettings.json b/MP.Prog/Properties/launchSettings.json
index 9f3861d2..00384491 100644
--- a/MP.Prog/Properties/launchSettings.json
+++ b/MP.Prog/Properties/launchSettings.json
@@ -1,7 +1,7 @@
{
"iisSettings": {
- "windowsAuthentication": false,
- "anonymousAuthentication": true,
+ "windowsAuthentication": true,
+ "anonymousAuthentication": false,
"iisExpress": {
"applicationUrl": "http://localhost:7312",
"sslPort": 44309
diff --git a/MP.Prog/Resources/ChangeLog.html b/MP.Prog/Resources/ChangeLog.html
index dc5c645b..b2c82f16 100644
--- a/MP.Prog/Resources/ChangeLog.html
+++ b/MP.Prog/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
Modulo gestione Programmi MAPO
- Versione: 6.16.2410.2116
+ Versione: 6.16.2410.2211
Note di rilascio:
diff --git a/MP.Prog/Resources/VersNum.txt b/MP.Prog/Resources/VersNum.txt
index 7c94c9f8..608c2973 100644
--- a/MP.Prog/Resources/VersNum.txt
+++ b/MP.Prog/Resources/VersNum.txt
@@ -1 +1 @@
-6.16.2410.2116
+6.16.2410.2211
diff --git a/MP.Prog/Resources/manifest.xml b/MP.Prog/Resources/manifest.xml
index b774c00c..bfe55f7a 100644
--- a/MP.Prog/Resources/manifest.xml
+++ b/MP.Prog/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 6.16.2410.2116
+ 6.16.2410.2211
https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/MP.Prog.zip
https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/ChangeLog.html
false
diff --git a/MP.Prog/Startup.cs b/MP.Prog/Startup.cs
index a1cb43b6..fc459f4f 100644
--- a/MP.Prog/Startup.cs
+++ b/MP.Prog/Startup.cs
@@ -1,3 +1,4 @@
+using Microsoft.AspNetCore.Authentication.Negotiate;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Hosting;
@@ -8,6 +9,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using MP.Prog.Data;
+using NLog;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
@@ -84,8 +86,8 @@ namespace MP.Prog
app.UseRouting();
- //app.UseAuthentication();
- //app.UseAuthorization();
+ app.UseAuthentication();
+ app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
@@ -105,6 +107,16 @@ namespace MP.Prog
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
+ // Aggiunta auth windows
+ services.AddAuthentication(NegotiateDefaults.AuthenticationScheme)
+ .AddNegotiate();
+
+ services.AddAuthorization(options =>
+ {
+ // By default, all incoming requests will be authorized according to the default policy.
+ options.FallbackPolicy = options.DefaultPolicy;
+ });
+
// cookie applicazione da 14 gg (defaul) a 30
services.ConfigureApplicationCookie(o =>
diff --git a/MP.Prog/appsettings.json b/MP.Prog/appsettings.json
index 3f754328..397f561f 100644
--- a/MP.Prog/appsettings.json
+++ b/MP.Prog/appsettings.json
@@ -39,7 +39,7 @@
"rules": [
{
"logger": "*",
- "minLevel": "Info",
+ "minLevel": "Trace",
"writeTo": "logconsole"
},
{
|