spostato controllo eventi inutilizzati in fileList
This commit is contained in:
@@ -8,6 +8,7 @@ namespace SMGen.Data.Data
|
||||
{
|
||||
public class FileLinesClass
|
||||
{
|
||||
public string file = "";
|
||||
public Dictionary<string, int> statesOK = new Dictionary<string, int>();
|
||||
public Dictionary<string, int> eventsOK = new Dictionary<string, int>();
|
||||
public List<string> lines = new List<string>();
|
||||
|
||||
@@ -360,6 +360,7 @@ namespace SMGen.Data.Services
|
||||
Log.Error($"{exc}{Environment.NewLine}");
|
||||
}
|
||||
|
||||
answ.file = currFile.tempFileName;
|
||||
answ.statesOK = StatesAll2;
|
||||
answ.eventsOK = evOk;
|
||||
answ.lines = lines.ToList();
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
}
|
||||
</th>
|
||||
<th scope="col"></th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -54,10 +55,70 @@
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{}
|
||||
{ }
|
||||
@if (!hasBit)
|
||||
{
|
||||
<td>
|
||||
<button class="btn btn-sm btn-info" @onclick="()=>doProc(item.Value)"><i class="fa-solid fa-code-compare"></i></button>
|
||||
</td>
|
||||
}
|
||||
}
|
||||
|
||||
</tr>
|
||||
@if (k != null && k.statesOK.Count > 0 && k.eventsOK.Count > 0 && k.lines.Count > 0 && item.Value.tempFileName == k.file)
|
||||
{
|
||||
<div class="d-flex justify-content-between p-3">
|
||||
<div class="card shadow-lg rounded mb-2">
|
||||
<div class="card-header">
|
||||
<h4>STATI</h4>
|
||||
</div>
|
||||
<div class="card-body overflow-auto" style="max-height: 50rem">
|
||||
@foreach (var line in k.lines)
|
||||
{
|
||||
@if (line.StartsWith("$STATE"))
|
||||
{
|
||||
|
||||
@if (k.statesOK.ContainsKey(line.Split(":")[2].ToUpper().Trim()))
|
||||
{
|
||||
<span class="text-success">@line</span>
|
||||
<br />
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-danger">@line</span>
|
||||
<br />
|
||||
}
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card shadow-lg rounded mb-2">
|
||||
<div class="card-header">
|
||||
<h4>EVENTI</h4>
|
||||
</div>
|
||||
<div class="card-body overflow-auto" style="max-height: 50rem">
|
||||
@foreach (var line in k.lines)
|
||||
{
|
||||
@if (line.StartsWith("$EVENT"))
|
||||
{
|
||||
<div>
|
||||
|
||||
@if (k.eventsOK.ContainsKey(line.Split(":")[2].ToUpper().Trim()))
|
||||
{
|
||||
<span class="text-success">@line</span>
|
||||
<br />
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-danger">@line</span>
|
||||
<br />
|
||||
}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -49,6 +49,21 @@ namespace SMGen.Components
|
||||
|
||||
private int _totalCount { get; set; } = 0;
|
||||
|
||||
protected FileLinesClass k = new FileLinesClass();
|
||||
|
||||
protected async Task doProc(FilesClass currFile)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
if (k.statesOK.Count <= 0 && k.eventsOK.Count <= 0 && k.lines.Count <= 0)
|
||||
{
|
||||
k = await SMGDService.DoCheckUnusedEvSt(currFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
k = new FileLinesClass();
|
||||
}
|
||||
}
|
||||
|
||||
private int currPage
|
||||
{
|
||||
get => currFilter.CurrPage;
|
||||
|
||||
Reference in New Issue
Block a user