ok filtro x file status
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>WebDoorCreator - Egalware</i>
|
||||
<h4>Version: 0.9.2309.1108</h4>
|
||||
<h4>Version: 0.9.2309.1109</h4>
|
||||
<br /> Release note:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
0.9.2309.1108
|
||||
0.9.2309.1109
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>0.9.2309.1108</version>
|
||||
<version>0.9.2309.1109</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>
|
||||
|
||||
@@ -8,6 +8,17 @@
|
||||
Current Data
|
||||
</div>
|
||||
</div>
|
||||
@if (searchRecords != null && searchRecords.Count() > 0)
|
||||
{
|
||||
<div class="text-end my-2">
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" class="btn btn-sm col-3 btn-secondary" 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>
|
||||
}
|
||||
@if (isLoading)
|
||||
{
|
||||
<ProgressDisplay Title="@titleMsg" CurrVal="@sendDataVal" MaxVal="@sendDataMaxVal" ExpTimeMSec="8000"></ProgressDisplay>
|
||||
@@ -36,10 +47,10 @@ else if (files2Chk != null && files2Chk.Count() > 0)
|
||||
<tbody>
|
||||
@foreach (var item in files2Chk)
|
||||
{
|
||||
<tr class="row" style="cursor: pointer;">
|
||||
<tr class="row" style="cursor: pointer;">
|
||||
@*<td class="col-1">
|
||||
<button class="btn btn-sm btn-info" data-bs-toggle="modal" data-bs-target="#fileDiffModal" @onclick="()=>showDiff(item, item.Value.status)"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
</td>*@
|
||||
<button class="btn btn-sm btn-info" data-bs-toggle="modal" data-bs-target="#fileDiffModal" @onclick="()=>showDiff(item, item.Value.status)"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
</td>*@
|
||||
@if (item.Value.status == Core.Enum.fileStatus.add || item.Value.status == Core.Enum.fileStatus.mod)
|
||||
{
|
||||
<td class="col-1" data-bs-toggle="modal" data-bs-target="#fileDiffModal" @onclick="()=>showDiff(item, item.Value.status)">
|
||||
@@ -82,8 +93,8 @@ else if (files2Chk != null && files2Chk.Count() > 0)
|
||||
<td class="col-4" colspan="4" data-bs-toggle="modal" data-bs-target="#fileDiffModal" @onclick="()=>showDiff(item, item.Value.status)"></td>
|
||||
}
|
||||
@*<td class="col-1 text-end">
|
||||
<button class="btn btn-sm btn-info" data-bs-toggle="modal" data-bs-target="#fileDiffModal" @onclick="()=>showDiff(item, item.Value.status)"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
</td>*@
|
||||
<button class="btn btn-sm btn-info" data-bs-toggle="modal" data-bs-target="#fileDiffModal" @onclick="()=>showDiff(item, item.Value.status)"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
</td>*@
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
private Dictionary<string, FileDTO> searchRecords = new Dictionary<string, FileDTO>();
|
||||
private Dictionary<string, FileDTO> files2Save = new Dictionary<string, FileDTO>();
|
||||
|
||||
private List<Core.Enum.fileStatus> stats2show = new List<Core.Enum.fileStatus>();
|
||||
|
||||
private int sendDataMaxVal = 100;
|
||||
|
||||
private int sendDataVal = 0;
|
||||
@@ -97,6 +99,109 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
}
|
||||
}
|
||||
|
||||
protected bool _showAdd { get; set; } = true;
|
||||
|
||||
protected bool showAdd
|
||||
{
|
||||
get => _showAdd;
|
||||
set => _showAdd = value;
|
||||
}
|
||||
protected bool _showUpd { get; set; } = true;
|
||||
|
||||
protected bool showUpd
|
||||
{
|
||||
get => _showUpd;
|
||||
set => _showUpd = value;
|
||||
}
|
||||
protected bool _showDel { get; set; } = true;
|
||||
|
||||
protected bool showDel
|
||||
{
|
||||
get => _showDel;
|
||||
set => _showDel = value;
|
||||
}
|
||||
|
||||
protected async Task filtBtnSet(Core.Enum.fileStatus fileStat)
|
||||
{
|
||||
switch (fileStat)
|
||||
{
|
||||
case Core.Enum.fileStatus.add:
|
||||
showAdd = !showAdd;
|
||||
if (showAdd && !stats2show.Contains(Core.Enum.fileStatus.add))
|
||||
{
|
||||
stats2show.Add(Core.Enum.fileStatus.add);
|
||||
}
|
||||
else if (!showAdd && stats2show.Contains(Core.Enum.fileStatus.add))
|
||||
{
|
||||
stats2show.Remove(Core.Enum.fileStatus.add);
|
||||
}
|
||||
break;
|
||||
case Core.Enum.fileStatus.mod:
|
||||
showUpd = !showUpd;
|
||||
if (showUpd && !stats2show.Contains(Core.Enum.fileStatus.mod))
|
||||
{
|
||||
stats2show.Add(Core.Enum.fileStatus.mod);
|
||||
}
|
||||
else if (!showUpd && stats2show.Contains(Core.Enum.fileStatus.mod))
|
||||
{
|
||||
stats2show.Remove(Core.Enum.fileStatus.mod);
|
||||
}
|
||||
break;
|
||||
case Core.Enum.fileStatus.rem:
|
||||
showDel = !showDel;
|
||||
if (showDel && !stats2show.Contains(Core.Enum.fileStatus.rem))
|
||||
{
|
||||
stats2show.Add(Core.Enum.fileStatus.rem);
|
||||
}
|
||||
else if (!showDel && stats2show.Contains(Core.Enum.fileStatus.rem))
|
||||
{
|
||||
stats2show.Remove(Core.Enum.fileStatus.rem);
|
||||
}
|
||||
break;
|
||||
}
|
||||
await ReloadData();
|
||||
}
|
||||
protected string filtBtnAddCss()
|
||||
{
|
||||
string answ = "";
|
||||
if (showAdd)
|
||||
{
|
||||
answ = "btn-primary";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "btn-secondary";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
protected string filtBtnUpdCss()
|
||||
{
|
||||
string answ = "";
|
||||
if (showUpd)
|
||||
{
|
||||
answ = "btn-warning";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "btn-secondary";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
protected string filtBtnRemCss()
|
||||
{
|
||||
string answ = "";
|
||||
if (showDel)
|
||||
{
|
||||
answ = "btn-danger";
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "btn-secondary";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
protected string btnCssClass(Core.Enum.fileStatus fStat, bool doAct)
|
||||
{
|
||||
string answ = "";
|
||||
@@ -264,6 +369,9 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
}
|
||||
|
||||
searchRecords = searchRecords.Where(x => x.Value.status > 0).ToDictionary(x => x.Key, x => x.Value);
|
||||
stats2show.Add(Core.Enum.fileStatus.add);
|
||||
stats2show.Add(Core.Enum.fileStatus.mod);
|
||||
stats2show.Add(Core.Enum.fileStatus.rem);
|
||||
await ReloadData();
|
||||
sendDataVal = 100;
|
||||
isLoading = false;
|
||||
@@ -285,6 +393,7 @@ namespace WebDoorCreator.UI.Components.FilesMan
|
||||
|
||||
totalCount = searchRecords.Count;
|
||||
files2Chk = searchRecords
|
||||
.Where(x => stats2show.Contains(x.Value.status))
|
||||
.Skip(numRecord * (currPage - 1))
|
||||
.Take(numRecord)
|
||||
.ToDictionary(x => x.Key, x => x.Value);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>0.9.2309.1108</Version>
|
||||
<Version>0.9.2309.1109</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<UserSecretsId>aspnet-WebDoorCreator.UI-dfe95fed-1398-4144-bd43-8b3a765d6608</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
Reference in New Issue
Block a user