fix grafici

This commit is contained in:
zaccaria.majid
2023-08-07 13:08:46 +02:00
parent d7cb3d2dbc
commit cf941dcede
3 changed files with 55 additions and 4 deletions
+35 -2
View File
@@ -1,15 +1,22 @@
<div class="p-2">
<div class="d-flex justify-content-between">
<div>
<CircleGauge Titolo="@($"{FilesTemp.Count()}")" Testo="Loaded Files" maxVal="FilesTemp.Count()" currVal="@succFiles" strokeColorVal="#27AE60" StyleTitolo="font-size: 2.7rem; font-weight:bold; fill: #212427;" StyleTesto="font-size: 1rem; fill: #ACACAC;" ShowCircleBtn="false"></CircleGauge>
</div>
</div>
<div class="p-2">
<table class="table">
<thead>
<tr>
<th scope="col">Rul file</th>
<th scope="col">Status</th>
<th scope="col">
@if(Files!=null && Files.Count>0)
@if (Files != null && Files.Count > 0)
{
<button @onclick="()=>Read_rule_file_transitions()">Process</button>
}
</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
@@ -40,10 +47,36 @@
<a class="btn btn-sm text-decoration-none" disabled><i class="fa-solid fa-download text-secondary"></i></a>
}
</td>
@if (item.Value.errorMsg != "")
{
<td>
<button class="btn btn-sm btn-danger" data-bs-toggle="modal" data-bs-target="#exampleModal" @onclick="()=>setCurrMsg(item.Value)"><i class="fa-solid fa-circle-exclamation"></i></button>
</td>
}
else
{}
}
</tr>
}
</tbody>
</table>
</div>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-danger text-warning">
<h1 class="modal-title fs-5" id="exampleModalLabel">Errore</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
@currMsg
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
+19 -2
View File
@@ -85,11 +85,12 @@ namespace SMGen.Components
await InvokeAsync(() => StateHasChanged());
}
protected int succFiles { get; set; } = 0;
protected async Task Read_rule_file_transitions()
{
Files = await SMGDService.FilesGetAll();
foreach (var item in Files.OrderBy(x=>x.Value.origFileName))
foreach (var item in Files.OrderBy(x => x.Value.origFileName))
{
item.Value.calcRunning = true;
await InvokeAsync(() => StateHasChanged());
@@ -104,9 +105,25 @@ namespace SMGen.Components
await SMGDService.EvalIn2StateRuleFile(item.Value, false, calcItSelf, calcEmptyState);
}
item.Value.calcRunning = false;
if (item.Value.isOk)
{
succFiles = succFiles + 1;
}
await InvokeAsync(() => StateHasChanged());
}
var currEvents = SMGDService.events2Add;
}
protected string currMsg { get; set; } = "";
protected string currFileName { get; set; } = "";
protected async Task setCurrMsg(FilesClass currFile)
{
if (currFile.errorMsg != "")
{
currMsg = currFile.errorMsg;
}
currFileName = currFile.origFileName;
}
}
}
+1
View File
@@ -29,6 +29,7 @@
<a class="dismiss">🗙</a>
</div>
<script src="~/lib/bootstrap/js/bootstrap.bundle.js"></script>
<script src="_framework/blazor.server.js"></script>
</body>
</html>