mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Show tested media in uploaded report details.
This commit is contained in:
@@ -32,9 +32,10 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
|
|||||||
{
|
{
|
||||||
Report = await _context.Reports.Include(d => d.ATA).Include(d => d.ATA.ReadCapabilities).
|
Report = await _context.Reports.Include(d => d.ATA).Include(d => d.ATA.ReadCapabilities).
|
||||||
Include(d => d.ATAPI).Include(d => d.SCSI).
|
Include(d => d.ATAPI).Include(d => d.SCSI).
|
||||||
Include(d => d.SCSI.ReadCapabilities).Include(d => d.MultiMediaCard).
|
Include(d => d.SCSI.MultiMediaDevice).Include(d => d.SCSI.ReadCapabilities).
|
||||||
Include(d => d.SecureDigital).Include(d => d.USB).Include(d => d.FireWire).
|
Include(d => d.MultiMediaCard).Include(d => d.SecureDigital).
|
||||||
Include(d => d.PCMCIA).FirstOrDefaultAsync(m => m.Id == id)
|
Include(d => d.USB).Include(d => d.FireWire).Include(d => d.PCMCIA).
|
||||||
|
FirstOrDefaultAsync(m => m.Id == id)
|
||||||
};
|
};
|
||||||
|
|
||||||
if(model.Report is null)
|
if(model.Report is null)
|
||||||
@@ -67,6 +68,17 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
|
|||||||
model.ReadCapabilitiesId =
|
model.ReadCapabilitiesId =
|
||||||
model.Report.ATA?.ReadCapabilities?.Id ?? model.Report.SCSI?.ReadCapabilities?.Id ?? 0;
|
model.Report.ATA?.ReadCapabilities?.Id ?? model.Report.SCSI?.ReadCapabilities?.Id ?? 0;
|
||||||
|
|
||||||
|
// So we can check, as we know IDs with 0 will never exist, and EFCore does not allow null propagation in the LINQ
|
||||||
|
int ataId = model.Report.ATA?.Id ?? 0;
|
||||||
|
int atapiId = model.Report.ATAPI?.Id ?? 0;
|
||||||
|
int scsiId = model.Report.SCSI?.Id ?? 0;
|
||||||
|
int mmcId = model.Report.SCSI?.MultiMediaDevice?.Id ?? 0;
|
||||||
|
|
||||||
|
model.TestedMedias = _context.TestedMedia.
|
||||||
|
Where(t => t.AtaId == ataId || t.AtaId == atapiId || t.ScsiId == scsiId ||
|
||||||
|
t.MmcId == mmcId).OrderBy(t => t.Manufacturer).
|
||||||
|
ThenBy(t => t.Model).ThenBy(t => t.MediumTypeName).ToList();
|
||||||
|
|
||||||
return View(model);
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -224,4 +224,45 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
@if (Model.TestedMedias.Count > 0)
|
||||||
|
{
|
||||||
|
<div>
|
||||||
|
<h4>Tested media:</h4>
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
@Html.DisplayNameFor(model => model.TestedMedias[0].Manufacturer)
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
@Html.DisplayNameFor(model => model.TestedMedias[0].Model)
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
@Html.DisplayNameFor(model => model.TestedMedias[0].MediumTypeName)
|
||||||
|
</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach (var item in Model.TestedMedias)
|
||||||
|
{
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
@Html.DisplayFor(modelItem => item.Manufacturer)
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@Html.DisplayFor(modelItem => item.Model)
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
@Html.DisplayFor(modelItem => item.MediumTypeName)
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a asp-controller="TestedMedias" asp-action="Details" asp-route-id="@item.Id" class="btn btn-secondary" target="_blank">Details</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,16 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using DiscImageChef.CommonTypes.Metadata;
|
||||||
|
|
||||||
namespace DiscImageChef.Server.Models
|
namespace DiscImageChef.Server.Models
|
||||||
{
|
{
|
||||||
public class UploadedReportDetails
|
public class UploadedReportDetails
|
||||||
{
|
{
|
||||||
public UploadedReport Report { get; set; }
|
public UploadedReport Report { get; set; }
|
||||||
public List<int> SameAll { get; set; }
|
public List<int> SameAll { get; set; }
|
||||||
public List<int> SameButManufacturer { get; set; }
|
public List<int> SameButManufacturer { get; set; }
|
||||||
public List<int> ReportAll { get; set; }
|
public List<int> ReportAll { get; set; }
|
||||||
public List<int> ReportButManufacturer { get; set; }
|
public List<int> ReportButManufacturer { get; set; }
|
||||||
public int ReadCapabilitiesId { get; set; }
|
public int ReadCapabilitiesId { get; set; }
|
||||||
|
public List<TestedMedia> TestedMedias { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user