PROG
- fix gestione display versioni fix update in selezione
This commit is contained in:
@@ -331,6 +331,11 @@ namespace MP.FileData.Controllers
|
||||
return done;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cerca il file x chiave ID
|
||||
/// </summary>
|
||||
/// <param name="FileId"></param>
|
||||
/// <returns></returns>
|
||||
public FileModel FileGetByKey(int FileId)
|
||||
{
|
||||
FileModel thisFile = null;
|
||||
@@ -344,6 +349,39 @@ namespace MP.FileData.Controllers
|
||||
return thisFile;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cerca un file dato un fice successivo specificando rev richiesta)
|
||||
/// </summary>
|
||||
/// <param name="FileId"></param>
|
||||
/// <param name="Rev"></param>
|
||||
/// <returns></returns>
|
||||
public FileModel FileGetByKeyRev(int FileId, int Rev)
|
||||
{
|
||||
FileModel oFile = null;
|
||||
FileModel tFile = null;
|
||||
using (MoonPro_ProgContext localDbCtx = new MoonPro_ProgContext(_configuration))
|
||||
{
|
||||
oFile = localDbCtx
|
||||
.DbSetProgFile
|
||||
.Where(x => x.FileId == FileId)
|
||||
.FirstOrDefault();
|
||||
// se la rev è diversa --> la cerco!
|
||||
if (oFile.Rev == Rev)
|
||||
{
|
||||
tFile = oFile;
|
||||
}
|
||||
else
|
||||
{
|
||||
tFile = localDbCtx
|
||||
.DbSetProgFile
|
||||
.Where(x => x.Name == oFile.Name && x.IdxMacchina == oFile.IdxMacchina && x.Path == oFile.Path)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
return tFile;
|
||||
}
|
||||
|
||||
|
||||
public List<DatabaseModels.FileModel> FileGetByPath(string path, bool onlyActive)
|
||||
{
|
||||
List<DatabaseModels.FileModel> dbResult = new List<DatabaseModels.FileModel>();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<div class="col-6 table-primary">
|
||||
<div class="row">
|
||||
<div class="col-4 text-primary">
|
||||
<h4>Archivio</h4>
|
||||
<h4><i class="fas fa-database"></i> @OldTitle</h4>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
</div>
|
||||
@@ -18,7 +18,14 @@
|
||||
<div class="col-6 table-warning">
|
||||
<div class="row">
|
||||
<div class="col-4 text-warning">
|
||||
<h4>Attuale</h4>
|
||||
@if(CompareVers)
|
||||
{
|
||||
<h4><i class="fas fa-database"></i> @NewTitle</h4>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h4><i class="fas fa-server"></i> @NewTitle</h4>
|
||||
}
|
||||
</div>
|
||||
<div class="col-4">
|
||||
</div>
|
||||
|
||||
@@ -12,23 +12,32 @@ namespace MP.Prog.Components
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public bool CompareVers { get; set; } = false;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<int> diffDone { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public string newText
|
||||
public string NewText
|
||||
{
|
||||
get => _newText;
|
||||
set => _newText = value;
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public string oldText
|
||||
public string NewTitle { get; set; } = "Attuale";
|
||||
|
||||
[Parameter]
|
||||
public string OldText
|
||||
{
|
||||
get => _oldText;
|
||||
set => _oldText = value;
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public string OldTitle { get; set; } = "Archivio";
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Fields
|
||||
@@ -69,7 +78,7 @@ namespace MP.Prog.Components
|
||||
numChanges = 0;
|
||||
// calcolo diff
|
||||
diff_match_patch dmp = new diff_match_patch();
|
||||
List<Diff> diff = dmp.diff_main(oldText, newText);
|
||||
List<Diff> diff = dmp.diff_main(OldText, NewText);
|
||||
//List<Diff> diff = dmp.diff_main(oldTextFix, newTextFix);
|
||||
dmp.diff_cleanupSemantic(diff);
|
||||
|
||||
@@ -86,12 +95,12 @@ namespace MP.Prog.Components
|
||||
switch (item.operation)
|
||||
{
|
||||
case Operation.DELETE:
|
||||
sbOld.Append($"<span class=\"border border-success table-success\">{HttpUtility.HtmlEncode(item.text)}</span>");
|
||||
sbOld.Append($"<span class=\"border border-success bg-success bg-opacity-25\">{HttpUtility.HtmlEncode(item.text)}</span>");
|
||||
numChanges++;
|
||||
break;
|
||||
|
||||
case Operation.INSERT:
|
||||
sbNew.Append($"<span class=\"border border-danger table-danger\">{HttpUtility.HtmlEncode(item.text)}</span>");
|
||||
sbNew.Append($"<span class=\"border border-danger bg-danger bg-opacity-25\">{HttpUtility.HtmlEncode(item.text)}</span>");
|
||||
numChanges++;
|
||||
break;
|
||||
|
||||
@@ -129,8 +138,6 @@ namespace MP.Prog.Components
|
||||
string fixVal = origVal.Trim()
|
||||
.Replace(" ", " ")
|
||||
.Replace(Environment.NewLine, sepDest);
|
||||
//.Replace("\r", sepDest)
|
||||
//.Replace("\n", sepDest);
|
||||
return new MarkupString(fixVal);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,43 +1,86 @@
|
||||
<div class="card">
|
||||
<div class="card-header bg-secondary text-light">
|
||||
<div class="row">
|
||||
<div class="card-header bg-dark text-light">
|
||||
<div class="d-flex just">
|
||||
<div class="col-4">
|
||||
<h3>Dettaglio modifiche</h3>
|
||||
<div class="d-flex">
|
||||
<div class="px-0">
|
||||
<h4>Dettaglio modifiche</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
@if (_currItem.Active)
|
||||
{
|
||||
@if (_currItem.DiskStatus != FileData.FileState.Ok)
|
||||
<div class="d-flex justify-content-around text-nowrap">
|
||||
@if (_currItem.Rev > 0)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<button type="button" class="btn btn-primary w-100" value="Cancel" @onclick="RejectChange">Mantieni Archivio <i class="fas fa-arrow-right"></i></button>
|
||||
<div class="px-0">
|
||||
@if (CompareRev)
|
||||
{
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">SX</span>
|
||||
<select @bind="@SelRevSx" class="form-select form-select-sm text-end" style="min-width: 4rem;">
|
||||
@if (ListRevSx != null)
|
||||
{
|
||||
foreach (var item in ListRevSx)
|
||||
{
|
||||
<option value="@item">@item</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<span class="input-group-text">DX</span>
|
||||
<select @bind="@SelRevDx" class="form-select form-select-sm text-end" style="min-width: 4rem;">
|
||||
@if (ListRevDx != null)
|
||||
{
|
||||
foreach (var item in ListRevDx)
|
||||
{
|
||||
<option value="@item">@item</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<button class="btn btn-secondary" title="Chiudi Confronto" @onclick="DoCompare"><i class="fa-solid fa-clock-rotate-left"></i></button>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-primary" title="Confronta release differenti" @onclick="DoCompare"><i class="fa-solid fa-clock-rotate-left"></i> Compara Versioni</button>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@if (_currItem.Active)
|
||||
{
|
||||
@if (_currItem.DiskStatus != FileData.FileState.Ok)
|
||||
{
|
||||
<div class="px-0">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<button type="button" class="btn btn-primary w-100" value="Cancel" @onclick="RejectChange">Mantieni Archivio <i class="fas fa-arrow-right"></i></button>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<button type="button" class="btn btn-warning w-100" value="Cancel" @onclick="ApproveChange"><i class="fas fa-arrow-left"></i> Accetta Modifiche</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<button type="button" class="btn btn-warning w-100" value="Cancel" @onclick="ApproveChange"><i class="fas fa-arrow-left"></i> Accetta Modifiche</button>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="px-0">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<button type="button" class="btn btn-success w-100" value="" @onclick="ExportArchive">Sostituisci da Archivio <i class="fas fa-file-download"></i></button>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<button type="button" class="btn btn-success w-100" value="" @onclick="ExportArchive">Sostituisci da Archivio <i class="fas fa-file-download"></i></button>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
</div>
|
||||
<div class="col-2 text-end">
|
||||
<button type="button" class="btn btn-light w-100" value="Cancel" @onclick="cancelUpdate" title="Chiudi">Chiudi <i class="fas fa-xmark"></i></button>
|
||||
<div class="col-4 text-end">
|
||||
<button type="button" class="btn btn-light" value="Cancel" @onclick="cancelUpdate" title="Chiudi">Chiudi <i class="fas fa-xmark"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body small py-1">
|
||||
<DiffView oldText="@_currItem.FileStringContent" newText="@(CurrFileContent(_currItem.Path))"></DiffView>
|
||||
<DiffView OldTitle="@TitleSx" CompareVers="@CompareRev" OldText="@FileContSx" NewTitle="@TitleDx" NewText="@FileContDx"></DiffView>
|
||||
</div>
|
||||
</div>
|
||||
@@ -47,6 +47,86 @@ namespace MP.Prog.Components
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
private bool CompareRev = false;
|
||||
protected int SelRevSx
|
||||
{
|
||||
get => _selRevSx;
|
||||
set
|
||||
{
|
||||
if (_selRevSx != value)
|
||||
{
|
||||
_selRevSx = value;
|
||||
// ricarico file SX
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
await LoadRevision();
|
||||
});
|
||||
pUpd.Wait();
|
||||
FixTitles();
|
||||
}
|
||||
}
|
||||
}
|
||||
protected int SelRevDx
|
||||
{
|
||||
get => _selRevDx;
|
||||
set
|
||||
{
|
||||
if (_selRevDx != value)
|
||||
{
|
||||
_selRevDx = value;
|
||||
// ricarico file DX
|
||||
var pUpd = Task.Run(async () =>
|
||||
{
|
||||
await LoadRevision();
|
||||
});
|
||||
pUpd.Wait();
|
||||
FixTitles();
|
||||
}
|
||||
}
|
||||
}
|
||||
private int _selRevSx = 0;
|
||||
private int _selRevDx = 0;
|
||||
|
||||
private List<int> ListRevSx
|
||||
{
|
||||
get
|
||||
{
|
||||
List<int> answ = new List<int>() { 0 };
|
||||
for (int i = 1; i < SelRevDx; i++)
|
||||
{
|
||||
answ.Add(i);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
private List<int> ListRevDx
|
||||
{
|
||||
get
|
||||
{
|
||||
List<int> answ = new List<int>();
|
||||
for (int i = 0; i <= _currItem.Rev; i++)
|
||||
{
|
||||
answ.Add(i);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private async Task DoCompare()
|
||||
{
|
||||
CompareRev = !CompareRev;
|
||||
await LoadRevision();
|
||||
FixTitles();
|
||||
}
|
||||
|
||||
private void FixTitles()
|
||||
{
|
||||
// sistemo titoli
|
||||
TitleSx = CompareRev ? $"Rev. {SelRevSx}" : "Archivio";
|
||||
TitleDx = CompareRev ? $"Rev. {SelRevDx}" : "Attuale";
|
||||
}
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public string CurrFileContent(string fullPath)
|
||||
@@ -91,12 +171,6 @@ namespace MP.Prog.Components
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
//private string userName = "";
|
||||
//protected override void OnInitialized()
|
||||
//{
|
||||
// userName = MServ.UserName;
|
||||
//}
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async Task ApproveChange()
|
||||
@@ -150,7 +224,7 @@ namespace MP.Prog.Components
|
||||
await DataReset.InvokeAsync(0);
|
||||
await FDService.FileExport(_currItem);
|
||||
await DataReset.InvokeAsync(0);
|
||||
await FDService.UpdateMachineArchive(_currItem.IdxMacchina, 1, false, false,MServ.UserName);
|
||||
await FDService.UpdateMachineArchive(_currItem.IdxMacchina, 1, false, false, MServ.UserName);
|
||||
await DataUpdated.InvokeAsync(1);
|
||||
}
|
||||
else
|
||||
@@ -188,6 +262,38 @@ namespace MP.Prog.Components
|
||||
}
|
||||
}
|
||||
|
||||
private string FileContSx { get; set; } = "";
|
||||
private string FileContDx { get; set; } = "";
|
||||
|
||||
private string TitleSx { get; set; } = "Archivio";
|
||||
private string TitleDx { get; set; } = "Attuale";
|
||||
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
FileContSx = _currItem.FileStringContent;
|
||||
FileContDx = CurrFileContent(_currItem.Path);
|
||||
SelRevDx = _currItem.Rev;
|
||||
FixTitles();
|
||||
}
|
||||
|
||||
private async Task LoadRevision()
|
||||
{
|
||||
if (CompareRev)
|
||||
{
|
||||
var reqSx = await FDService.FileGetByKeyRev(_currItem.FileId, SelRevSx);
|
||||
var reqDx = await FDService.FileGetByKeyRev(_currItem.FileId, SelRevDx);
|
||||
FileContSx = reqSx.FileStringContent;
|
||||
FileContDx = reqDx.FileStringContent;
|
||||
}
|
||||
else
|
||||
{
|
||||
FileContSx = _currItem.FileStringContent;
|
||||
FileContDx = CurrFileContent(_currItem.Path);
|
||||
}
|
||||
FixTitles();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
</span>
|
||||
</div>
|
||||
<input type="text" class="form-control form-control-sm" placeholder="Ricerca Tag" @bind-value="@SearchTag" />
|
||||
<select @bind="@SelTag" class="form-control form-control-sm">
|
||||
<select @bind="@SelTag" class="form-select form-select-sm">
|
||||
@if (TagList != null)
|
||||
{
|
||||
foreach (var item in TagList)
|
||||
|
||||
@@ -169,6 +169,17 @@ namespace MP.Prog.Data
|
||||
{
|
||||
return Task.FromResult(dbController.FileGetByKey(FileId));
|
||||
}
|
||||
/// <summary>
|
||||
/// Restituisce il file dato un ID + revisione
|
||||
/// cerca a pari nome, macchina + REV specifica)
|
||||
/// </summary>
|
||||
/// <param name="FileId">Id del file originale</param>
|
||||
/// <param name="Rev">Rev specifica richiesta</param>
|
||||
/// <returns></returns>
|
||||
public Task<FileModel> FileGetByKeyRev(int FileId, int Rev)
|
||||
{
|
||||
return Task.FromResult(dbController.FileGetByKeyRev(FileId, Rev));
|
||||
}
|
||||
|
||||
public async Task<List<FileModel>> FileGetFilt(SelectData CurrFilter)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RootNamespace>MP.Prog</RootNamespace>
|
||||
<Version>6.16.2410.2211</Version>
|
||||
<Version>6.16.2410.2218</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -123,18 +123,7 @@
|
||||
{
|
||||
<tr class="@checkSelect(record.FileId)">
|
||||
<td class="text-nowrap">
|
||||
@if (currRecord == null)
|
||||
{
|
||||
<button class="btn btn-sm btn-info" @onclick="() => Edit(record)" title="Edit record #@record.FileId">
|
||||
<i class="oi oi-pencil"></i>
|
||||
</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-sm btn-secondary disabled">
|
||||
<i class="oi oi-pencil"></i>
|
||||
</button>
|
||||
}
|
||||
<button class="btn btn-sm btn-info" @onclick="() => Edit(record)" title="Edit record #@record.FileId"><i class="fa-solid fa-magnifying-glass"></i></button>
|
||||
</td>
|
||||
<td>
|
||||
<div class="@(cssActive(record.Active))">
|
||||
@@ -150,11 +139,11 @@
|
||||
@record.Rev
|
||||
</div>
|
||||
<div class="px-0">
|
||||
<span title="@record.DiskStatus | Ultimo controllo: @record.LastCheck.ToString("yyyy.MM.dd HH:mm:ss")">
|
||||
<span class="@(cssStatusByCod(record.DiskStatus))">
|
||||
@record.DiskStatus
|
||||
</span>
|
||||
</span>
|
||||
<span title="@record.DiskStatus | Ultimo controllo: @record.LastCheck.ToString("yyyy.MM.dd HH:mm:ss")">
|
||||
<span class="@(cssStatusByCod(record.DiskStatus))">
|
||||
@record.DiskStatus
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="px-0">
|
||||
@CalcSize(record.Size)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo gestione Programmi MAPO</i>
|
||||
<h4>Versione: 6.16.2410.2211</h4>
|
||||
<h4>Versione: 6.16.2410.2218</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2410.2211
|
||||
6.16.2410.2218
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2410.2211</version>
|
||||
<version>6.16.2410.2218</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/MP.Prog.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
//"DetailedErrors": true,
|
||||
"DetailedErrors": true,
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
|
||||
Reference in New Issue
Block a user