refresh con pager
This commit is contained in:
@@ -259,8 +259,9 @@ namespace MP.Prog.Data
|
||||
/// <summary>
|
||||
/// Aggiorna intero archivio scansionando dati x tutte le macchine che hanno un path valido
|
||||
/// </summary>
|
||||
/// <param name="numDayPre">Numero giorni x ricerca all'indietro da data corrente / 0 = nessun limite</param>
|
||||
/// <returns></returns>
|
||||
public async Task updateAllArchive()
|
||||
public async Task updateAllArchive(int numDayPre)
|
||||
{
|
||||
string ruleName = "Rule01.json";
|
||||
try
|
||||
@@ -316,7 +317,7 @@ namespace MP.Prog.Data
|
||||
Log.Info($"Conf rule generato:{Environment.NewLine}{rawRule}");
|
||||
}
|
||||
|
||||
dbController.CheckFileArchived(item.IdxMacchina, item.BasePath, "*.*", currRule);
|
||||
dbController.CheckFileArchived(item.IdxMacchina, item.BasePath, numDayPre, "*.*", currRule);
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
|
||||
@@ -4,13 +4,8 @@
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Components\DataPager.razor.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Remove="Components\CodArtSelector.razor" />
|
||||
<Content Remove="Components\DataPager.razor" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
+23
-10
@@ -1,5 +1,7 @@
|
||||
@page "/Archive"
|
||||
|
||||
@using MP.Prog.Components
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header table-primary h3">
|
||||
<div class="row">
|
||||
@@ -10,12 +12,19 @@
|
||||
<div class="form-row">
|
||||
<div class="col-1">
|
||||
<div class="form-group mb-0">
|
||||
<button id="btnForceCheck" class="btn btn-warning btn-sm btn-block" @onclick="() => ForceCheck()" title="Forza verifica archivio">
|
||||
<button id="btnForceCheck" class="btn btn-danger btn-sm btn-block" @onclick="() => ForceCheck(0)" title="Forza verifica archivio (totale)">
|
||||
<i class="far fa-folder-open"></i> <i class="fas fa-sync-alt"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="col-1">
|
||||
<div class="form-group mb-0">
|
||||
<button id="btnForceCheck" class="btn btn-warning btn-sm btn-block" @onclick="() => TestLoading()" title="Ultime modifiche (last 48h)">
|
||||
<i class="far fa-folder-open"></i> <i class="fas fa-sync-alt"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
</div>
|
||||
@@ -25,17 +34,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div class="col-1">
|
||||
<div class="input-group input-group-sm">
|
||||
<div class="input-group-prepend">
|
||||
</div>
|
||||
<div class="custom-control custom-switch">
|
||||
<input type="checkbox" class="custom-control-input" id="togModificati" title="Solo Aperti / Mostra tutti" @bind-value="@OnlyMod" checked="@OnlyMod" />
|
||||
<label class="custom-control-label small" for="togModificati"><sub>Modifiche</sub></label>
|
||||
<label class="custom-control-label small" for="togModificati"><sub>Mod</sub></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="col-7">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
@@ -63,14 +72,18 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body p-1">
|
||||
@if (isLoading == true)
|
||||
{
|
||||
<h1 class="alert alert-info">Bingo!</h1>
|
||||
}
|
||||
|
||||
@if (currRecord != null)
|
||||
{
|
||||
<MP.Prog.Components.FileEditor currItem="@currRecord" DataReset="ResetData" DataUpdated="UpdateData" TagList="@TagList" MacList="@MacList"></MP.Prog.Components.FileEditor>
|
||||
<FileEditor currItem="@currRecord" DataReset="ResetData" DataUpdated="UpdateData" TagList="@TagList" MacList="@MacList"></FileEditor>
|
||||
}
|
||||
@if (ListRecords == null)
|
||||
@if (ListRecords == null || isLoading == true)
|
||||
{
|
||||
<MP.Prog.Components.LoadingData></MP.Prog.Components.LoadingData>
|
||||
<d2>RELOADING</d2>
|
||||
<LoadingData></LoadingData>
|
||||
}
|
||||
else if (totalCount == 0)
|
||||
{
|
||||
@@ -158,6 +171,6 @@
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer p-1">
|
||||
@*<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />*@
|
||||
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="totalCount" showLoading="isLoading" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -5,6 +5,7 @@ using MP.Prog.Data;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Prog.Pages
|
||||
@@ -263,16 +264,20 @@ namespace MP.Prog.Pages
|
||||
pUpd.Wait();
|
||||
}
|
||||
|
||||
protected async Task ForceCheck()
|
||||
protected void ForceCheck(int maxHour)
|
||||
{
|
||||
isLoading = true;
|
||||
await DataService.updateAllArchive();
|
||||
currRecord = null;
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
AppMService.File_Filter = SelectData.Init(5, 10);
|
||||
isLoading = false;
|
||||
await ReloadAllData();
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
isLoading = true;
|
||||
currRecord = null;
|
||||
SearchRecords = null;
|
||||
ListRecords = null;
|
||||
await DataService.updateAllArchive(maxHour);
|
||||
AppMService.File_Filter = SelectData.Init(5, 10);
|
||||
isLoading = false;
|
||||
await ReloadAllData();
|
||||
});
|
||||
pUpd.Wait();
|
||||
}
|
||||
|
||||
protected void ForceReload(int newNum)
|
||||
@@ -341,6 +346,18 @@ namespace MP.Prog.Pages
|
||||
currRecord = selRecord;
|
||||
}
|
||||
|
||||
protected async void TestLoading()
|
||||
{
|
||||
await InvokeAsync(() =>
|
||||
{
|
||||
isLoading = !isLoading;
|
||||
//StateHasChanged();
|
||||
//Thread.Sleep(500);
|
||||
//Task.Delay(1);
|
||||
//isLoading = false;
|
||||
});
|
||||
}
|
||||
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
currRecord = null;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<RootNamespace>MP.Stats</RootNamespace>
|
||||
<UserSecretsId>826e877c-ba70-4253-84cb-d0b1cafd4440</UserSecretsId>
|
||||
<Version>1.0.2109.0318</Version>
|
||||
<Version>1.0.2109.1308</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo statistiche MAPO</i>
|
||||
<h4>Versione: 1.0.2109.0318</h4>
|
||||
<h4>Versione: 1.0.2109.1308</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.0.2109.0318
|
||||
1.0.2109.1308
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.0.2109.0318</version>
|
||||
<version>1.0.2109.1308</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/MP-STATS/stable/0/MP.Stats.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/MP-STATS/stable/0/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user