mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Show subreports on device report details.
This commit is contained in:
@@ -17,8 +17,11 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
|
||||
|
||||
// GET: Admin/Devices
|
||||
public async Task<IActionResult> Index() =>
|
||||
View(await _context.Devices.OrderBy(d => d.Manufacturer).ThenBy(d => d.Model).ThenBy(d => d.Revision).
|
||||
ThenBy(d => d.CompactFlash).ThenBy(d => d.Type).ToListAsync());
|
||||
View(await _context.Devices.OrderBy(d => d.Manufacturer).
|
||||
ThenBy(d => d.Model).
|
||||
ThenBy(d => d.Revision).
|
||||
ThenBy(d => d.CompactFlash).
|
||||
ThenBy(d => d.Type).ToListAsync());
|
||||
|
||||
// GET: Admin/Devices/Details/5
|
||||
public async Task<IActionResult> Details(int? id)
|
||||
@@ -30,7 +33,15 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
|
||||
|
||||
var model = new DeviceDetails
|
||||
{
|
||||
Report = await _context.Devices.FirstOrDefaultAsync(m => m.Id == id)
|
||||
Report = await _context.Devices.Include(d => d.ATA).
|
||||
Include(d => d.ATAPI).
|
||||
Include(d => d.SCSI).
|
||||
Include(d => d.MultiMediaCard).
|
||||
Include(d => d.SecureDigital).
|
||||
Include(d => d.USB).
|
||||
Include(d => d.FireWire).
|
||||
Include(d => d.PCMCIA).
|
||||
FirstOrDefaultAsync(m => m.Id == id)
|
||||
};
|
||||
|
||||
if(model.Report is null)
|
||||
@@ -64,13 +75,31 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
|
||||
Where(d => d.Manufacturer == model.Report.Manufacturer &&
|
||||
d.Model == model.Report.Model &&
|
||||
d.Revision == model.Report.Revision).
|
||||
Include(d => d.Report).ToList();
|
||||
Include(d => d.Report).
|
||||
Include(d => d.Report.ATA).
|
||||
Include(d => d.Report.ATAPI).
|
||||
Include(d => d.Report.SCSI).
|
||||
Include(d => d.Report.MultiMediaCard).
|
||||
Include(d => d.Report.SecureDigital).
|
||||
Include(d => d.Report.USB).
|
||||
Include(d => d.Report.FireWire).
|
||||
Include(d => d.Report.PCMCIA).ToList();
|
||||
|
||||
model.StatsButManufacturer = _context.DeviceStats.
|
||||
Where(d => d.Model == model.Report.Model &&
|
||||
d.Revision == model.Report.Revision).
|
||||
Include(d => d.Report).AsEnumerable().
|
||||
Where(d => model.StatsAll.All(s => s.Id != d.Id)).ToList();
|
||||
Include(d => d.Report).
|
||||
Include(d => d.Report).
|
||||
Include(d => d.Report.ATA).
|
||||
Include(d => d.Report.ATAPI).
|
||||
Include(d => d.Report.SCSI).
|
||||
Include(d => d.Report.MultiMediaCard).
|
||||
Include(d => d.Report.SecureDigital).
|
||||
Include(d => d.Report.USB).
|
||||
Include(d => d.Report.FireWire).
|
||||
Include(d => d.Report.PCMCIA).
|
||||
AsEnumerable().Where(d => model.StatsAll.All(s => s.Id != d.Id)).
|
||||
ToList();
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
@@ -91,6 +91,54 @@
|
||||
<a asp-action="Edit" asp-route-id="@Model.Report.Id" class="btn btn-primary">Edit</a>
|
||||
<a asp-action="Index" class="btn btn-secondary">Back to List</a>
|
||||
</div>
|
||||
@if (Model.Report.ATA != null)
|
||||
{
|
||||
<div>
|
||||
<a asp-controller="Atas" asp-action="Details" asp-route-id="@Model.Report.ATA.Id" target="_blank">ATA report</a>
|
||||
</div>
|
||||
}
|
||||
@if (Model.Report.ATAPI != null)
|
||||
{
|
||||
<div>
|
||||
<a asp-controller="Atas" asp-action="Details" asp-route-id="@Model.Report.ATAPI.Id" target="_blank">ATAPI report</a>
|
||||
</div>
|
||||
}
|
||||
@if (Model.Report.SCSI != null)
|
||||
{
|
||||
<div>
|
||||
<a asp-controller="Scsis" asp-action="Details" asp-route-id="@Model.Report.SCSI.Id" target="_blank">SCSI report</a>
|
||||
</div>
|
||||
}
|
||||
@if (Model.Report.MultiMediaCard != null)
|
||||
{
|
||||
<div>
|
||||
<a asp-controller="MmcSds" asp-action="Details" asp-route-id="@Model.Report.MultiMediaCard.Id" target="_blank">MultiMediaCard report</a>
|
||||
</div>
|
||||
}
|
||||
@if (Model.Report.SecureDigital != null)
|
||||
{
|
||||
<div>
|
||||
<a asp-controller="MmcSds" asp-action="Details" asp-route-id="@Model.Report.SecureDigital.Id" target="_blank">SecureDigital report</a>
|
||||
</div>
|
||||
}
|
||||
@if (Model.Report.USB != null)
|
||||
{
|
||||
<div>
|
||||
<a asp-controller="Usbs" asp-action="Details" asp-route-id="@Model.Report.USB.Id" target="_blank">USB report</a>
|
||||
</div>
|
||||
}
|
||||
@if (Model.Report.FireWire != null)
|
||||
{
|
||||
<div>
|
||||
Has a FireWire report.
|
||||
</div>
|
||||
}
|
||||
@if (Model.Report.PCMCIA != null)
|
||||
{
|
||||
<div>
|
||||
Has a PCMCIA report.
|
||||
</div>
|
||||
}
|
||||
@if (Model.SameAll.Count > 0)
|
||||
{
|
||||
<div>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.0.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />
|
||||
<PackageReference Include="MimeKit" Version="2.3.2" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.0.0-rc1.final" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.0.0" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql.Design" Version="1.1.2" />
|
||||
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user