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
|
// GET: Admin/Devices
|
||||||
public async Task<IActionResult> Index() =>
|
public async Task<IActionResult> Index() =>
|
||||||
View(await _context.Devices.OrderBy(d => d.Manufacturer).
|
View(await _context.Devices.OrderBy(d => d.Manufacturer).ThenBy(d => d.Model).ThenBy(d => d.Revision).
|
||||||
ThenBy(d => d.Model).
|
ThenBy(d => d.CompactFlash).ThenBy(d => d.Type).ToListAsync());
|
||||||
ThenBy(d => d.Revision).
|
|
||||||
ThenBy(d => d.CompactFlash).
|
|
||||||
ThenBy(d => d.Type).ToListAsync());
|
|
||||||
|
|
||||||
// GET: Admin/Devices/Details/5
|
// GET: Admin/Devices/Details/5
|
||||||
public async Task<IActionResult> Details(int? id)
|
public async Task<IActionResult> Details(int? id)
|
||||||
@@ -33,14 +30,9 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
|
|||||||
|
|
||||||
var model = new DeviceDetails
|
var model = new DeviceDetails
|
||||||
{
|
{
|
||||||
Report = await _context.Devices.Include(d => d.ATA).
|
Report = await _context.Devices.Include(d => d.ATA).Include(d => d.ATAPI).Include(d => d.SCSI).
|
||||||
Include(d => d.ATAPI).
|
Include(d => d.MultiMediaCard).Include(d => d.SecureDigital).
|
||||||
Include(d => d.SCSI).
|
Include(d => d.USB).Include(d => d.FireWire).Include(d => d.PCMCIA).
|
||||||
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)
|
FirstOrDefaultAsync(m => m.Id == id)
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -71,35 +63,17 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
|
|||||||
d.Revision == model.Report.Revision && d.Id != id).
|
d.Revision == model.Report.Revision && d.Id != id).
|
||||||
Select(d => d.Id).Where(d => model.SameAll.All(r => r != d)).ToList();
|
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 &&
|
Where(d => d.Manufacturer == model.Report.Manufacturer &&
|
||||||
d.Model == model.Report.Model &&
|
d.Model == model.Report.Model &&
|
||||||
d.Revision == model.Report.Revision).
|
d.Revision == model.Report.Revision &&
|
||||||
Include(d => d.Report).
|
d.Report.Id != model.Report.Id).ToList();
|
||||||
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.
|
model.StatsButManufacturer = _context.DeviceStats.Include(d => d.Report).
|
||||||
Where(d => d.Model == model.Report.Model &&
|
Where(d => d.Model == model.Report.Model &&
|
||||||
d.Revision == model.Report.Revision).
|
d.Revision == model.Report.Revision &&
|
||||||
Include(d => d.Report).
|
d.Report.Id != model.Report.Id).AsEnumerable().
|
||||||
Include(d => d.Report).
|
Where(d => model.StatsAll.All(s => s.Id != d.Id)).ToList();
|
||||||
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);
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -367,7 +367,7 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@("Yes")
|
<a asp-action="Details" asp-route-id="@item.Report.Id" target="_blank">Yes</a>
|
||||||
}
|
}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
Reference in New Issue
Block a user