mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Link to existing report.
This commit is contained in:
@@ -17,11 +17,8 @@ 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)
|
||||
@@ -33,14 +30,9 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
|
||||
|
||||
var model = new DeviceDetails
|
||||
{
|
||||
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).
|
||||
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)
|
||||
};
|
||||
|
||||
@@ -71,35 +63,17 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
|
||||
d.Revision == model.Report.Revision && d.Id != id).
|
||||
Select(d => d.Id).Where(d => model.SameAll.All(r => r != d)).ToList();
|
||||
|
||||
model.StatsAll = _context.DeviceStats.
|
||||
model.StatsAll = _context.DeviceStats.Include(d => d.Report).
|
||||
Where(d => d.Manufacturer == model.Report.Manufacturer &&
|
||||
d.Model == model.Report.Model &&
|
||||
d.Revision == model.Report.Revision).
|
||||
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();
|
||||
d.Revision == model.Report.Revision &&
|
||||
d.Report.Id != model.Report.Id).ToList();
|
||||
|
||||
model.StatsButManufacturer = _context.DeviceStats.
|
||||
Where(d => d.Model == model.Report.Model &&
|
||||
d.Revision == model.Report.Revision).
|
||||
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();
|
||||
model.StatsButManufacturer = _context.DeviceStats.Include(d => d.Report).
|
||||
Where(d => d.Model == model.Report.Model &&
|
||||
d.Revision == model.Report.Revision &&
|
||||
d.Report.Id != model.Report.Id).AsEnumerable().
|
||||
Where(d => model.StatsAll.All(s => s.Id != d.Id)).ToList();
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user