Merge branch 'release/AddCompoMgmtDelete01'
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>WebDoorCreator - Egalware</i>
|
||||
<h4>Version: 0.9.2406.1909</h4>
|
||||
<h4>Version: 0.9.2406.1916</h4>
|
||||
<br /> Release note:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
0.9.2406.1909
|
||||
0.9.2406.1916
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>0.9.2406.1909</version>
|
||||
<version>0.9.2406.1916</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/WDC/stable/WDC.UI.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/WDC/stable/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -2465,6 +2465,72 @@ namespace WebDoorCreator.Data.Services
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
|
||||
public async Task<int> CountMissingTemplate(string defaultPath)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
int numMissing = 0;
|
||||
///dizionario componenti - directory
|
||||
Dictionary<string, string> DictCompoDir = new Dictionary<string, string>();
|
||||
// ciclo x tutti gli oggetti "FOLDER" della tabella
|
||||
try
|
||||
{
|
||||
Stopwatch sw = new Stopwatch();
|
||||
sw.Start();
|
||||
|
||||
// in primis cerco le directory fisiche e la loro rappresentazione come nome componente...
|
||||
string[] hwDirectories = Directory.GetDirectories(defaultPath);
|
||||
foreach (var hw in hwDirectories)
|
||||
{
|
||||
string[] iniFiles = Directory.GetFiles(hw, "Config.ini");
|
||||
if (iniFiles != null && iniFiles.Length > 0)
|
||||
{
|
||||
List<string> lines = File.ReadAllLines(iniFiles[0]).ToList();
|
||||
IniFile fIni = new IniFile(iniFiles[0]);
|
||||
|
||||
var compoName = fIni.ReadString("Compo", "Name", "COMPONAME");
|
||||
string compoCode = compoName.Split("/")[0].Trim();
|
||||
|
||||
// aggiungo al dizionari
|
||||
if (!DictCompoDir.ContainsKey(compoName))
|
||||
{
|
||||
DictCompoDir.Add(compoName, hw);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//var listFolder = await ListValuesGetAll("*", "Folder");
|
||||
var listTemplate = await ListValuesGetAll("*", "template");
|
||||
if (listTemplate != null && listTemplate.Count > 0)
|
||||
{
|
||||
// ciclo elenco template...
|
||||
foreach (var item in listTemplate)
|
||||
{
|
||||
string fPath = Path.Combine(defaultPath, item.TableName, item.Value);
|
||||
// se non contiene "." aggiungo ".lua"
|
||||
if (!item.Label.Contains("."))
|
||||
{
|
||||
fPath += ".lua";
|
||||
}
|
||||
// controllo se esiste...
|
||||
if (!File.Exists(fPath))
|
||||
{
|
||||
numMissing++;
|
||||
}
|
||||
}
|
||||
}
|
||||
sw.Stop();
|
||||
TimeSpan ts = sw.Elapsed;
|
||||
Log.Debug($"CountMissingTemplate in: {ts.TotalMilliseconds} ms");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Exception during CountMissingTemplate: {exc}{Environment.NewLine}");
|
||||
}
|
||||
return numMissing;
|
||||
}
|
||||
|
||||
public async Task<bool> ListValuesLuaNgeInsert(string defaultPath)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
@@ -2475,16 +2541,12 @@ namespace WebDoorCreator.Data.Services
|
||||
|
||||
try
|
||||
{
|
||||
//ciclo nelle directories usando la colonna opcode
|
||||
//foreach (var itemOld in HwsList)
|
||||
string dir = defaultPath;
|
||||
// ciclo nelle directories usando la colonna opcode
|
||||
string compoCode = "";
|
||||
string compoTempOrShape = "";
|
||||
Stopwatch stopWatch = new Stopwatch();
|
||||
stopWatch.Start();
|
||||
//string[] templateDirectories = Directory.GetDirectories(dir);
|
||||
string[] hwDirectories = Directory.GetDirectories(dir);
|
||||
|
||||
string[] hwDirectories = Directory.GetDirectories(defaultPath);
|
||||
|
||||
int ordin = 1;
|
||||
foreach (var hw in hwDirectories)
|
||||
@@ -2495,7 +2557,7 @@ namespace WebDoorCreator.Data.Services
|
||||
foreach (string templateDirectory in templateDirectories)
|
||||
{
|
||||
var tName = templateDirectory.Split("\\");
|
||||
var fName = templateDirectory.Split("\\");
|
||||
//var fName = templateDirectory.Split("\\");
|
||||
|
||||
foreach (var file in iniFiles)
|
||||
{
|
||||
@@ -3754,7 +3816,7 @@ namespace WebDoorCreator.Data.Services
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
var rawList = JsonConvert.DeserializeObject<Dictionary<string, FileDTO>>(rawData);
|
||||
if(rawList!=null)
|
||||
if (rawList != null)
|
||||
{
|
||||
filesDict = rawList;
|
||||
}
|
||||
|
||||
@@ -71,17 +71,20 @@
|
||||
}
|
||||
</div>
|
||||
<div class="col-4 text-end">
|
||||
@if (searchRecords != null && searchRecords.Count() > 0)
|
||||
{
|
||||
<div class="text-nowrap">
|
||||
<div class="btn-group w-50" role="group">
|
||||
<button type="button" class="btn btn-sm col-3 btn-secondary" disabled>FILTER BY: </button>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<button type="button" class="btn btn-sm btn-outline-success" @onclick="()=>updateNumMissing()" title="Check missing template">@tplMissing missing</button>
|
||||
</div>
|
||||
@if (searchRecords != null && searchRecords.Count() > 0)
|
||||
{
|
||||
<div class="text-nowrap btn-group w-75" role="group">
|
||||
<button type="button" class="btn btn-sm col-3 btn-outline-secondary ps-0 pe-2" disabled>FILTER BY:</button>
|
||||
<button type="button" class="btn btn-sm col-3 @filtBtnAddCss()" @onclick="()=>filtBtnSet(Core.Enum.fileStatus.add)">Add</button>
|
||||
<button type="button" class="btn btn-sm col-3 @filtBtnUpdCss()" @onclick="()=>filtBtnSet(Core.Enum.fileStatus.mod)">Update</button>
|
||||
<button type="button" class="btn btn-sm col-3 @filtBtnRemCss()" @onclick="()=>filtBtnSet(Core.Enum.fileStatus.rem)">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -165,7 +168,7 @@ else if (files2Chk != null && files2Chk.Count() > 0)
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
}
|
||||
else if (files2Chk == null || files2Chk.Count() == 0)
|
||||
|
||||
@@ -199,6 +199,23 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
await doScan(true, true);
|
||||
sendDataVal = 90;
|
||||
}
|
||||
private int numTplMissing { get; set; } = -1;
|
||||
protected string tplMissing
|
||||
{
|
||||
get => numTplMissing >= 0 ? $"{numTplMissing}" : "???";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// verifica numero template missing x eventuale fix con creazione nuovi file vuoti
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected async Task updateNumMissing()
|
||||
{
|
||||
isLoading = true;
|
||||
numTplMissing = await WDCService.CountMissingTemplate(rootPathCur);
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Scansione e comparazione directory COMPO
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>0.9.2406.1909</Version>
|
||||
<Version>0.9.2406.1916</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>aspnet-WebDoorCreator.UI-dfe95fed-1398-4144-bd43-8b3a765d6608</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
Reference in New Issue
Block a user